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

解决平台报错:'NoneType' object is not subscriptable #2132

Merged
merged 3 commits into from
Apr 24, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sql/engines/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,9 @@ def explain_check(self, db_name=None, sql="", close_conn=False):
sql = sql.rstrip(";")
cursor.execute(sql)
# 获取影响行数
cursor.execute(f"select CARDINALITY from SYS.PLAN_TABLE$ where id = 0")
cursor.execute(
f"select CARDINALITY from (select CARDINALITY from PLAN_TABLE t where id = 0 order by t.timestamp desc) where rownum = 1"
LeoQuote marked this conversation as resolved.
Show resolved Hide resolved
)
rows = cursor.fetchone()
conn.rollback()
if not rows:
Expand Down