incubator-seata-go
incubator-seata-go copied to clipboard
生成undo log sql失败
当我再测试更新数据的时候
{
sourceQuery: "update t_user set name = ?, age = ? where id = ? or name = 'Jack' and age between ? and ?",
sourceQueryArgs: []driver.Value{"Jack", 1, 100, 18, 28},
expectQuery: "SELECT SQL_NO_CACHE name,age,id FROM t_user WHERE id=? OR name=_UTF8MB4Jack AND age BETWEEN ? AND ? FOR UPDATE",
expectQueryArgs: []driver.Value{100, 18, 28},
},
使用上述测试生成前镜像sql,测试ok 当修改测试条件为where 条件加 '()' 后失败 例如:
{
sourceQuery: "update t_user set name = ?, age = ? where (id = ? or name = 'Jack') and age between ? and ?",
sourceQueryArgs: []driver.Value{"Jack", 1, 100, 18, 28},
expectQuery: "SELECT SQL_NO_CACHE name,age,id FROM t_user WHERE (id=? OR name=_UTF8MB4Jack) AND age BETWEEN ? AND ? FOR UPDATE",
expectQueryArgs: []driver.Value{100, 18, 28},
},
测试结果为:
Not equal:
expected: []driver.Value{100, 18, 28}
actual : []driver.Value{18, 28}
如上,参数解析的不太正确
RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Title: failed to generate undo log sql
@slowmoon 有没有兴趣debug找下原因并修复?😄
RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@slowmoon Are you interested in debugging to find the cause and fix it? 😄