sqle icon indicating copy to clipboard operation
sqle copied to clipboard

库表元数据任务收集的SQL不完整,导致审核分数为0

Open alextinng opened this issue 2 years ago • 5 comments

SQLe Version 所有版本

Describe the bug SQLE使用show create table来获取表的DDL,但是show create table获取到的DDL不会包含option "IF NOT EXISTS",因而在启用了“新建表必须加入if not exists create,保证重复执行不报错”规则时,所有的表都会提示有错误信息,导致审核分数为0。

MySQL [test]> create table if not exists xxx (id int);
Query OK, 0 rows affected (0.01 sec)

MySQL [test]> show create table xxx;
+-------+---------------------------------------------------------------------------------------+
| Table | Create Table                                                                          |
+-------+---------------------------------------------------------------------------------------+
| xxx   | CREATE TABLE `xxx` (
  `id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+---------------------------------------------------------------------------------------+

To Reproduce

  1. 启用“新建表必须加入if not exists create,保证重复执行不报错”规则
  2. 新增库表元数据审核任务
  3. 点击审核

alextinng avatar May 26 '22 07:05 alextinng

@sjjian

alextinng avatar May 28 '22 03:05 alextinng

把对应的规则关掉就好了

sjjian avatar May 30 '22 01:05 sjjian

把对应的规则关掉就好了

不是这样啊~对我们来说,这个规则是必须的啊,这样的处理方式是不是太暴力了,没有从根本上解决问题......

alextinng avatar May 30 '22 01:05 alextinng

类似问题:https://github.com/actiontech/sqle/issues/466

sjjian avatar May 30 '22 01:05 sjjian

类似问题:#466

great

alextinng avatar May 30 '22 02:05 alextinng