Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #2168
fix #2177
explain plan for create table test (id number);
select CARDINALITY from (select CARDINALITY from PLAN_TABLE t where id = 0 order by t.timestamp desc) where rownum = 1
注意上面的返回是有结果的,一行数据,但是这一行数据值为null。
所以rows[0] 为None。
此时会走到
result["rows"] = rows[0]
会报:
#2168
[2023-05-23 16:44:22,753][Thread-2:139803802728192][task_id:default][oracle.py:1010][WARNING]- Oracle 语句执行报错,第1个SQL:create table test111(id int);,错误信息Traceback (most recent call last):
File "/backup/Archery-1.9.1/sql/engines/oracle.py", line 836, in execute_check
if result_set["rows"] > 1000:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
fix bug 2177:
11.2.0.4版本中,不支持ddl中绑定变量,故修改为
cursor.execute(f' ALTER SESSION SET CURRENT_SCHEMA = "{db_name}" ')