Skip to content

Commit

Permalink
修复 oravle 上线 bug (#1698)
Browse files Browse the repository at this point in the history
提交oracle SQL上线
create table 接 create index 或 insert into。报表不存在,无法提交工单。
此处代码应移动至for开始处
  • Loading branch information
MQMMMQM authored Jul 22, 2022
1 parent 2fa4738 commit 36bd216
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sql/engines/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ def execute_check(self, db_name=None, sql="", close_conn=True):
for sqlitem in sqlitemList:
sql_lower = sqlitem.statement.lower().rstrip(";")
sql_nolower = sqlitem.statement.rstrip(";")
object_name = self.get_sql_first_object_name(sql=sql_lower)
if "." in object_name:
object_name = object_name
else:
object_name = f"""{db_name}.{object_name}"""
object_name_list.add(object_name)
# 禁用语句
if re.match(r"^select|^with|^explain", sql_lower):
result = ReviewResult(
Expand Down Expand Up @@ -746,12 +752,6 @@ def execute_check(self, db_name=None, sql="", close_conn=True):
sql=sql_lower,
object_name_list=object_name_list,
):
object_name = self.get_sql_first_object_name(sql=sql_lower)
if "." in object_name:
object_name = object_name
else:
object_name = f"""{db_name}.{object_name}"""
object_name_list.add(object_name)
result = ReviewResult(
id=line,
errlevel=1,
Expand Down

0 comments on commit 36bd216

Please # to comment.