Skip to content

Commit

Permalink
fixed hhyo#2252
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhu214 committed Aug 24, 2023
1 parent 5e5c0f8 commit 01c386b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sql/engines/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,7 @@ def explain_check(self, db_name=None, sql="", close_conn=False):
conn = self.get_connection()
cursor = conn.cursor()
if db_name:
cursor.execute(
f" ALTER SESSION SET CURRENT_SCHEMA = :db_name ",
{"db_name": db_name},
)
conn.conn.current_schema=db_name
if re.match(r"^explain", sql, re.I):
sql = sql
else:
Expand Down Expand Up @@ -669,10 +666,7 @@ def query(
conn = self.get_connection()
cursor = conn.cursor()
if db_name:
cursor.execute(
f" ALTER SESSION SET CURRENT_SCHEMA = :db_name ",
{"db_name": db_name},
)
conn.current_schema=db_name
sql = sql.rstrip(";")
# 支持oralce查询SQL执行计划语句
if re.match(r"^explain", sql, re.I):
Expand Down

0 comments on commit 01c386b

Please sign in to comment.