当前使用版本(必须填写清楚,否则不予处理)
最新版
该问题是怎么引起的?(最新版上已修复的会直接close掉)
postgresql 数据库中对json字段的操作符,例如 ? 操作符,查询资料显示用两个问号进行处理,但仍然报错
https://jdbc.postgresql.org/documentation/head/statement.html
重现步骤
原始sql
<![CDATA[
select * from t_aaa where welfare :: jsonb ?? #{str}
]]>
报错信息
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, please exclude the tableName or statementId.
Error SQL: select *from t_aaa where welfare :: jsonb ?? ?
The error may exist in file [XXX.xml]
The error may involve XXX.XXXMapper.selectJson
The error occurred while executing a query
Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, please exclude the tableName or statementId.
Error SQL: select * from t_aaa where welfare :: jsonb ?? ? Caused by: net.sf.jsqlparser.JSQLParserException at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:154) at com.baomidou.mybatisplus.core.parser.AbstractJsqlParser.parser(AbstractJsqlParser.java:60) ... 71 more Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "?" "?" at line 1, column 57.
Was expecting one of:
"&"
"("
"::"
";"
"<<"
">>"
"AND"
"CONNECT"
"EXCEPT"
"FOR"
"GROUP"
"HAVING"
"INTERSECT"
"MINUS"
"ORDER"
"START"
"UNION"
"^"
"|"
<EOF>
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:18047)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:17900)
at net.sf.jsqlparser.parser.CCJSqlParser.Statements(CCJSqlParser.java:293)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:152)
... 72 more
Comment From: miemieYaho
jsqlparser 不支持解析,用注解过滤掉这个 method的解析(多租户)
Comment From: printff
请问一下具体是哪个注解呢?