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

oracle数据库删除数据时表名带双引号审核不通过 #2846

Open
lxfhe opened this issue Oct 21, 2024 · 0 comments
Open

oracle数据库删除数据时表名带双引号审核不通过 #2846

lxfhe opened this issue Oct 21, 2024 · 0 comments

Comments

@lxfhe
Copy link

lxfhe commented Oct 21, 2024

重现步骤

1、delete from "TEST" where "DEPTNO" = '000';或者delete from “JLERP_A"."TEST" where "DEPTNO" = '000'; 等表名使用双引号
2、提交SQL检测时页面没有任何信息,后台日志报execute_check和get_dml_table方法错误。
3、点SQL提交后,审核/执行信息显示“Json decode failed.执行结果Json解析失败, 请联系管理员”,扫描/影响行数为0。
4、点审核通过并执行后,当前状态为已正常结束,扫描/影响行数为0,数据未删除。

预期外的结果

oracle支持表名或schema+表名使用双引号。insert 语句在当前版本支持没有问题,但delete语句不支持。特别是通过insert 语句产生的回滚语句默认就是使用schema+表名且有双引号的delete语句,这就导致自动产生的回滚语句也无法通过审核。因此建议统一支持表名使用双引号

日志文本

2024-10-21 09:35:18,475 - default - WARNING - Oracle 语句执行报错,第1个SQL:delete
from “JLERP_A"."TEST" where "DEPTNO" = '000';,错误信息Traceback (most recent call last):
  File "/opt/archery/sql/engines/oracle.py", line 802, in execute_check
    elif len(object_name_list) > 0 and self.get_dml_table(
                                       ^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/engines/oracle.py", line 539, in get_dml_table
    table_name = re.match(r"^delete\s+from\s+([\w-]+)\s*", sql, re.M).group(1)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

版本

1.11.3

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

No response

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

No branches or pull requests

1 participant