We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3 86cd961
使用pg数据源对xml进行文件审核,发生报错
页面表现: sqled.log日志: time="2024-04-15T18:25:51+08:00" level=error msg="fail to call plugin interface [Parse], error: rpc error: code = Unknown desc = syntax error at or near "`"" plugin=PostgreSQL plugin_version=2 session_id=GEeoeRpbQOqVB9L8K6t2 thread_id=GPO
后端进行xml解析时,会将sql中的字段名和表名加上反引号 将解析之后的sql,放入pg中执行,同样出现该问题
xml解析流程为: 从xml中提取sql内容 -> 解析为ast语法树 -> 从语法树中还原为字符串 在第三步还原字符串的过程中,会使用反引号将列名,表名或者库民使用反引号包裹起来 具体代码:
反引号在mysql中用于引用标识符,但是在PostgreSQL中,反引号(``)并没有特殊的作用,也不是用于引用标识符的合法符号。相反,PostgreSQL使用双引号("")来引用标识符,如表名、列名、数据库名等。
当前的XML解析器在将AST语法树还原为SQL字符串时,固定使用反引号包裹标识符,缺乏灵活性。为了解决该问题,计划对XML解析器进行以下改进:
新增调用参数之后,调用方可能会额外传递参数
The text was updated successfully, but these errors were encountered:
sqle-ee:55917e1f1c5485f612f189dca241885e6e599846
选择pg数据源进行xml文件审核 没有出现报错,正常审核
Sorry, something went wrong.
hasa1K
No branches or pull requests
版本信息(Version)
v3 86cd961
问题描述(Describe)
使用pg数据源对xml进行文件审核,发生报错
截图或日志(Log)
页面表现:
sqled.log日志:
time="2024-04-15T18:25:51+08:00" level=error msg="fail to call plugin interface [Parse], error: rpc error: code = Unknown desc = syntax error at or near "`"" plugin=PostgreSQL plugin_version=2 session_id=GEeoeRpbQOqVB9L8K6t2 thread_id=GPO
排查过程
后端进行xml解析时,会将sql中的字段名和表名加上反引号
将解析之后的sql,放入pg中执行,同样出现该问题
如何复现(To Reproduce)
实现方案
为什么xml解析之后,sql会带反引号?
xml解析流程为:
从xml中提取sql内容 -> 解析为ast语法树 -> 从语法树中还原为字符串
在第三步还原字符串的过程中,会使用反引号将列名,表名或者库民使用反引号包裹起来
具体代码:
报错原因
反引号在mysql中用于引用标识符,但是在PostgreSQL中,反引号(``)并没有特殊的作用,也不是用于引用标识符的合法符号。相反,PostgreSQL使用双引号("")来引用标识符,如表名、列名、数据库名等。
解决方案
当前的XML解析器在将AST语法树还原为SQL字符串时,固定使用反引号包裹标识符,缺乏灵活性。为了解决该问题,计划对XML解析器进行以下改进:
变更影响面
新增调用参数之后,调用方可能会额外传递参数
The text was updated successfully, but these errors were encountered: