tlx777
tlx777
### 为什么会卡死? 解析器将此条 sql 解析为语法树时,pingcap 解析库进入死循环,导致卡死。 sqle 调用解析库代码 https://github.com/actiontech/sqle/blob/ebb8bd1e2effa5c51b3bb34dd90005942ecb5306/sqle/driver/mysql/util/parser_helper.go#L22 解析库陷入死循环代码 https://github.com/sjjian/parser/blob/9bc0b6c501688b319a7e5665e873b72cccc3fd6c/perfect_parser.go#L46
针对规则二:mysql 使用alter语法添加字段,如果想指定位置,只能使用first和after指定字段位置,没有before。因此,将规则二更新为“alter字段禁止使用first,after” [mysql文档链接](https://dev.mysql.com/doc/refman/5.7/en/alter-table.html)
> 规则8已经有了 也在企业版中
@Sharkzeng 规则四主要的应用场景是啥?
你能提供```merchant_info```,```report_info```这两张表的DDL信息吗?
### 修改后的效果 
### 发现 delete 语句也存在类似的问题 ``` DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN (SELECT m.merchant_no FROM report_info m, merchant_info s where m.merchant_no = s.merchant_no) b WHERE t1.id =...
### 修改后的效果 
> 你能提供`merchant_info`,`report_info`这两张表的DDL信息吗? 根据sql反推的建表DDL信息 ``` create table t1 ( id int primary key not null ); create table t2 ( id int primary key not null ); create table report_info (...
### 为什么会出现没有生效的情况? 因为后端针对这个规则写了一个固定的notice审核等级,所以前端无论配置什么审核等级,后端都是固定返回notice级别。 ### 修复方案 1. 在回滚函数内通过数据库查找相应的审核规则等级,添加到result内https://github.com/actiontech/sqle/blob/3145c006cfea5b6906a007857bd7484dcad394d2/sqle/server/audit.go#L199 2. 修改回滚sql的接口```GenRollbackSQL(ctx context.Context, sql string) (string, string, error)```,将第二个返回参数reason修改为```type AuditResult struct { results []*auditResult }```类型。这样可以在回滚接口内部获取规则审核等级和审核message信息,然后以审核结果的方式返回,这样在外部可以方便的将审核结果存到表```execute_sql_detail```中。 ##https://github.com/actiontech/sqle/blob/3145c006cfea5b6906a007857bd7484dcad394d2/sqle/driver/driver_audit.go#L243 ### 评估 方案一实现方式不好,用户定义的审核等级获取应该在回滚接口```GenRollbackSQL(ctx context.Context, sql string) (string, string,...