seata 表结构列名本身包含了转移字符`,在AT模式构建sql会发生歧义

jckbn6z7  于 2022-12-31  发布在  其他
关注(0)|答案(1)|浏览(191)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

在Seata的AT模式中,通过SQLInsertRecognizer#getInsertColumns得到用户填写的sql,如果用户填写的sql的列中有转移字符 ,那么有两种情况,第一是表列名本身没有该转移字符 ,第二是表列名本身包含了转移字符`,在MySQLInsertOrUpdateExecutor构建sql中,给字段加上了转移字符会发生下面的报错

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Just paste your stack trace here!

Ⅲ. Describe what you expected to happen

如果不处理表结构有的转移字符,上述的歧义忽视,那么可以简单的在MySQLInsertOrUpdateExecutor构建sql时,用ColumnUtils将转移字符去除

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version : 1.8
  • Seata version: 1.5.0
  • OS : windows
  • Others:
gcxthw6b

gcxthw6b1#

@luometeor Looking forward to submit a PR to fix this issue.

相关问题