当前使用版本(必填,否则不予处理)
3.5.3.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
使用clickhouse数据源,array函数, hasAny不支持
重现步骤(如果有就写完整)
自定义sql:
查询条件为
报错信息
Caused by: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, Error SQL: select
tr
.
id
,
tr.req_time,
tr.event_type,
tr.protocol,
tr.`method`,
tr.hostname,
tr.src_ip,
tr.src_port,
tr.src_mac,
tr.dest_ip,
tr.dest_port,
tr.dest_mac,
tr.url,
tr.original_uri,
tr.sensitive_tag,
tr.`schema_name`,
tr.schema_id,
tr.`table_name`,
tr.table_id,
tr.uri,
tr.flow_tag,
tr.api_tag,
tr.req_params,
tr.req_body,
tr.req_headers,
tr.resp_headers,
tr.resp_body,
tr.file_location_info,
tr.asset_name,
tr.asset_type,
tr.asset_id,
tr.business_name,
tr.business_id,
tr.department_name,
tr.department_id,
tr.account_name,
tr.business_user_name,
tr.business_user_id,
tr.flow_tag,
tr.api_tag,
tr.email_from,
tr.email_to,
tr.sensitive_data_inventory
from titan_record tr
WHERE hasAny(tr.sensitive_tag, array?)
and
(
(
(tr.src_ip like concat('%', ?, '%'))
or
(tr.hostname like concat('%', ?, '%'))
or
(tr.http_refer like concat('%', ?, '%'))
or
(tr.original_uri like concat('%', ?, '%'))
or
(tr.uri like concat('%', ?, '%'))
or
(tr.business_name like concat('%', ?, '%'))
or
(tr.department_name like concat('%', ?, '%'))
or
(tr.business_user_name like concat('%', ?, '%'))
or
(tr.account_name like concat('%', ?, '%'))
or
(tr.ua like concat('%', ?, '%'))
or
positionCaseInsensitiveUTF8(tr.sensitive_data_inventory, ?) > 0
or
positionCaseInsensitiveUTF8(tr.req_body, ?) > 0
or
positionCaseInsensitiveUTF8(tr.req_headers, ?) > 0
or
positionCaseInsensitiveUTF8(tr.req_cookie, ?) > 0
or
positionCaseInsensitiveUTF8(tr.resp_body, ?) > 0
or
positionCaseInsensitiveUTF8(tr.resp_headers, ?) > 0
or
positionCaseInsensitiveUTF8(tr.resp_cookie, ?) > 0
)
)
and tr.req_time >=
toDateTime64(?/1000, 3)
and tr.req_time <=
toDateTime64(?/1000,3)
and tr.tenant_id = ?
order by tr.req_time desc,tr.id desc
limit (? - 1)*?, ?
at com.baomidou.mybatisplus.core.toolkit.ExceptionUtils.mpe(ExceptionUtils.java:39) ~[mybatis-plus-core-3.5.3.1.jar:3.5.3.1] at com.baomidou.mybatisplus.extension.parser.JsqlParserSupport.parserSingle(JsqlParserSupport.java:52) ~[mybatis-plus-extension-3.5.3.1.jar:3.5.3.1] at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:78) ~[mybatis-plus-extension-3.5.3.1.jar:3.5.3.1] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) ~[mybatis-3.5.9.jar:3.5.9] at com.sun.proxy.$Proxy334.query(Unknown Source) ~[na:na] at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:151) ~[pagehelper-5.3.2.jar:na] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) ~[mybatis-3.5.9.jar:3.5.9] at com.sun.proxy.$Proxy334.query(Unknown Source) ~[na:na] at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) ~[mybatis-3.5.9.jar:3.5.9] ... 87 common frames omitted Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "(" at line 52, column 23.
Was expecting one of:
"&"
"::"
";"
"<<"
">>"
"COLLATE"
"CONNECT"
"EMIT"
"GROUP"
"HAVING"
"START"
"["
"^"
"|"
<EOF>
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:31468) ~[jsqlparser-4.4.jar:na] at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:31301) ~[jsqlparser-4.4.jar:na] at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:163) ~[jsqlparser-4.4.jar:na] at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:188) ~[jsqlparser-4.4.jar:na] at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63) ~[jsqlparser-4.4.jar:na] at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38) ~[jsqlparser-4.4.jar:na] at com.baomidou.mybatisplus.extension.parser.JsqlParserSupport.parserSingle(JsqlParserSupport.java:49) ~[mybatis-plus-extension-3.5.3.1.jar:3.5.3.1] ... 95 common frames omitted
Comment From: qmdx
关闭 JsqlParser SQL 优化解析
Comment From: EllisGit
如何关闭JsqlParser SQL 优化解析, 目前使用了@InterceptorIgnore(tenantLine = "true")跳过租户插件, 有其他方式即使用租户插件,又不报错的方法不
Comment From: qmdx
如何关闭JsqlParser SQL 优化解析, 目前使用了@InterceptorIgnore(tenantLine = "true")跳过租户插件, 有其他方式即使用租户插件,又不报错的方法不
暂无