Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ bug ] Oracle工单,上线检测时,双引号引起的对象,检测错误 #1427

Closed
peng19832 opened this issue Mar 28, 2022 · 4 comments · Fixed by #1438
Closed

[ bug ] Oracle工单,上线检测时,双引号引起的对象,检测错误 #1427

peng19832 opened this issue Mar 28, 2022 · 4 comments · Fixed by #1438

Comments

@peng19832
Copy link
Contributor

在提交 issue 前,请查阅以下资源,请先进行搜索来保证没有类似的 issue。
文档 | FAQ

重现步骤

  1. 提交一个create table检测,表名(任意已存在表)用双引号引起,就可以通过检测,不报已存在;

期待结果和实际结果

期待结果:
执行前检测,可以检测双引号引起的对象

实际结果:
已存在表T0328:
image

尝试提交一个create table检测:
检测通过,未发现已存在表
image

版本信息

应用版本/分支:1.8.3
部署方式:Docker

@peng19832
Copy link
Contributor Author

有这几种情况:

  1. dbname.table
  2. "dbName".table
  3. dbname."Table"
  4. "dbName"."Table"
  5. table
  6. "Table"

@peng19832
Copy link
Contributor Author

if '.' in object_name:
schema_name = object_name.split('.')[0]
object_name = object_name.split('.')[1]
if '"' in schema_name:
schema_name = schema_name
if '"' not in object_name:
object_name = object_name.upper()
else:
schema_name = schema_name.upper()
if '"' not in object_name:
object_name = object_name.upper()
else:
schema_name = ( '"' + db_name + '"' )
if '"' not in object_name:
object_name = object_name.upper()

object_name = f"""{schema_name}.{object_name}"""

@nick2wang
Copy link
Collaborator

#1217 这个pr分支麻烦pull最新代码,然后处理下单元测试的error,如果有新的提交可以继续push上去

@peng19832
Copy link
Contributor Author

#1217 这个pr分支麻烦pull最新代码,然后处理下单元测试的error,如果有新的提交可以继续push上去

@nick2wang
大佬,我就if判断了几下变量,怎么写单元测试呢?
我看以前的tests.py里,都没有这两个方法的测试的嘛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants