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

工单对oracle 建表不成功 #2262

Closed
tonyhu214 opened this issue Aug 24, 2023 · 8 comments · Fixed by #2266
Closed

工单对oracle 建表不成功 #2262

tonyhu214 opened this issue Aug 24, 2023 · 8 comments · Fixed by #2266

Comments

@tonyhu214
Copy link
Contributor

重现步骤

  1. oracle 建表建表sql如下
    create table TEST (id NUMBER(22)),SQL检测功能不报错。无检测结果。
    sql执行不报错,无表生成

预期外的结果

修复bug

日志文本

archery.log:[2023-08-24 11:28:08,813][MainThread:140489988859712][task_id:default][oracle.py:1068][WARNING]- Oracle 语句执行报错,第1个SQL:create table TEST (id NUMBER(22)),错误信息Traceback (most recent call last):
  File "/opt/archery/sql/engines/oracle.py", line 875, in execute_check
    if result_set["rows"] > 1000:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

版本

1.10.0

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

cx-oracle:7.3.0
goInception: v1.2.5

@tonyhu214 tonyhu214 changed the title 请对问题进行简要的描述 工单对oracle 建表不成功 Aug 24, 2023
tonyhu214 added a commit to tonyhu214/Archery that referenced this issue Aug 24, 2023
@tonyhu214 tonyhu214 mentioned this issue Aug 24, 2023
@SoHuDrgon
Copy link

@tonyhu214 我依照你的修复代码修改了,但是还是建表不成功。
截屏2023-08-25 14 41 56
截屏2023-08-25 14 42 55
截屏2023-08-25 14 43 18
截屏2023-08-25 14 40 43
截屏2023-08-25 14 41 00
截屏2023-08-25 14 41 32

我的oracle版本是11.2.0.4

@SoHuDrgon
Copy link

报错信息如下:
`[2023-08-25 14:40:31,101][MainThread:139725906945856][task_id:default][oracle.py:1010][WARNING]- Oracle 语句执行报错,第1个SQL:create table AGENT_RECON_ADAPTOR (ID VARCHAR2(32) not null,
TRANS_DATE CHAR(8) not null,
MER_ID VARCHAR2(20) not null,
TXN_TYPE VARCHAR2(4) not null,
PAY_TYPE VARCHAR2(8) not null,
DC_TYPE VARCHAR2(8),
TXN_AMT NUMBER(15),
TXN_CNT NUMBER(15),
FEE_AMT NUMBER(15),
CHANNEL_COST NUMBER(15),
SETT_AMT NUMBER(15),
PROFIT NUMBER(15),
INSTALMENT_FEE NUMBER(15),
CLEAR_STAT CHAR(1),
REMARK VARCHAR2(128));,错误信息Traceback (most recent call last):
File "/opt/archery/sql/engines/oracle.py", line 836, in execute_check
if result_set["rows"] > 1000:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

[2023-08-25 14:40:45,652][MainThread:139725906945856][task_id:default][oracle.py:1010][WARNING]- Oracle 语句执行报错,第1个SQL:create table AGENT_RECON_ADAPTOR (ID VARCHAR2(32) not null,
TRANS_DATE CHAR(8) not null,
MER_ID VARCHAR2(20) not null,
TXN_TYPE VARCHAR2(4) not null,
PAY_TYPE VARCHAR2(8) not null,
DC_TYPE VARCHAR2(8),
TXN_AMT NUMBER(15),
TXN_CNT NUMBER(15),
FEE_AMT NUMBER(15),
CHANNEL_COST NUMBER(15),
SETT_AMT NUMBER(15),
PROFIT NUMBER(15),
INSTALMENT_FEE NUMBER(15),
CLEAR_STAT CHAR(1),
REMARK VARCHAR2(128));,错误信息Traceback (most recent call last):
File "/opt/archery/sql/engines/oracle.py", line 836, in execute_check
if result_set["rows"] > 1000:
TypeError: '>' not supported between instances of 'NoneType' and 'int'`

@tonyhu214
Copy link
Contributor Author

@SoHuDrgon 你看你的报错内容
File "/opt/archery/sql/engines/oracle.py", line 836, in execute_check
if result_set["rows"] > 1000: -- 这里不是新的代码哈
TypeError: '>' not supported between instances of 'NoneType' and 'int'`
是不是docker部署的,是的话需要重新启动容器

@SoHuDrgon
Copy link

都重新启动了容器了的!我也纳闷为啥是836行!

@tonyhu214
Copy link
Contributor Author

或许check /opt/archery/sql/engines/oracle.py 下,然后docker container stop archery 等2分钟 docker container start archery

@SoHuDrgon
Copy link

好了,谢谢大佬!

LeoQuote pushed a commit that referenced this issue Aug 28, 2023
* fixed #2252

fix #2252

* Update oracle.py

* Update oracle.py

* Update oracle.py

* Update sql_utils.py

* Update oracle.py

fix #2262

* Update oracle.py

* Update oracle.py

* Update sql_utils.py

* Update sql_utils.py

* Update sql_utils.py

* Update oracle.py

* Update oracle.py

* Update oracle.py

* Update oracle.py
@yangjule126
Copy link

将sql/engines/oracle.py 866行及895号改为:
if result_set["rows"] is not None and result_set["rows"] > 1000:

再重启项目

@LeoQuote
Copy link
Collaborator

将sql/engines/oracle.py 866行及895号改为: if result_set["rows"] is not None and result_set["rows"] > 1000:

再重启项目

如果master 还有此 bug ,还请直接提一个pr, 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants