diff --git a/sql/engines/oracle.py b/sql/engines/oracle.py index 4d6195c8b2..87e5267021 100644 --- a/sql/engines/oracle.py +++ b/sql/engines/oracle.py @@ -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( @@ -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,