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

SQL工单中提交索引删除后重新创建语句执行报错 #2734

Open
ghostclearsky opened this issue Jul 19, 2024 · 0 comments
Open

SQL工单中提交索引删除后重新创建语句执行报错 #2734

ghostclearsky opened this issue Jul 19, 2024 · 0 comments

Comments

@ghostclearsky
Copy link

ghostclearsky commented Jul 19, 2024

重现步骤

数据库类型oracle,假设有一张表 test1,该表存在一个名为 TEST_20170719 的索引,现在计划删除并重新创建这个索引。
1、系统管理-配置项管理-系统设置-AUTO_REVIEW_WRONG 设置为3,意思是不自动驳回。
1、提交SQL工单,工单SQL语句如下:
drop index test_20240719;
create index TEST_20240719 on TEST1 (name);

image

2、审核通过
3、执行SQL,报错且两行SQL变为1行。
image

预期外的结果

SQL未按预期执行

日志文本

[2024-07-19 14:43:48,653][MainThread:140066255718208][task_id:django-q][cluster.py:395][ERROR]- Failed [sqlreview-execute-306] - 'stmt_type' : Traceback (most recent call last):
  File "/opt/venv4archery/lib/python3.11/site-packages/django_q/cluster.py", line 432, in worker
    res = f(*task["args"], **task["kwargs"])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/utils/execute_sql.py", line 44, in execute
    return execute_engine.execute_workflow(workflow=workflow_detail)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/engines/oracle.py", line 1108, in execute_workflow
    sqlitemList = get_exec_sqlitem_list(review_result, workflow.db_name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archery/sql/utils/sql_utils.py", line 376, in get_exec_sqlitem_list
    stmt_type=item["stmt_type"],
              ~~~~^^^^^^^^^^^^^
KeyError: 'stmt_type'

版本

1.11.1

部署方式

Docker

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

No response

@ghostclearsky ghostclearsky changed the title 请对问题进行简要的描述 SQL工单中提交索引重建语句执行报错 Jul 19, 2024
@ghostclearsky ghostclearsky changed the title SQL工单中提交索引重建语句执行报错 SQL工单中提交索引删除后重新添加语句执行报错 Jul 19, 2024
@ghostclearsky ghostclearsky changed the title SQL工单中提交索引删除后重新添加语句执行报错 SQL工单中提交索引删除后重新创建语句执行报错 Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants