Skip to content

Commit

Permalink
Merge pull request #1 from tonyhu214/tonyhu214-fix-#2252-cx_Oracle.Da…
Browse files Browse the repository at this point in the history
…tabaseError-DPI-1059-1

fix hhyo#2252
  • Loading branch information
tonyhu214 authored Aug 24, 2023
2 parents 5e5c0f8 + 01c386b commit 7f93cbe
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 7f93cbe

Please sign in to comment.