hanchuanchuan / goInception

一个集审核、执行、备份及生成回滚语句于一身的MySQL运维工具
https://hanchuanchuan.github.io/goInception/
GNU General Public License v3.0
1.59k stars 545 forks source link

SQL检测 扫描/影响行数 SQL存在转义符时与实际不符 #638

Closed BearGuardian closed 2 months ago

BearGuardian commented 3 months ago

描述 我这边配置有加上--real_row_count=true 同样的where条件 查询和 update预估的值还是不一样。 通过抓包发现当语句存在转义符时被忽略了

重现

# 更新语句
update tb_1 set column_a=1 where column_b like '%\_123';
# 还原的查询语句
select count(*) from tb_1 where column_b like '%_123';

环境

zmix999 commented 3 months ago

应该是sqlparser问题,可以使用ESCAPE指定转义符号处理

zmix999 commented 3 months ago

可以看下我fork的分支https://gitee.com/zhoujin826/goInception,升级了相关依赖包,解决了这个问题

BearGuardian commented 3 months ago

可以看下我fork的分支https://gitee.com/zhoujin826/goInception,升级了相关依赖包,解决了这个问题

get 👍 我试一下

hanchuanchuan commented 2 months ago

@zmix999 👍👍 感谢贡献! 稍后我将合并到goinception.