当前使用版本(必填,否则不予处理)
3.4.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
分页插件,优化count查询时,sql里面有xxx is not null这种时会转换异常
重现步骤(如果有就写完整)
报错信息
`2020-11-26 11:17:58.996 [http-nio-8080-exec-10] WARN c.b.m.e.plugins.inner.PaginationInnerInterceptor:329 - optimize this sql to a count sql has exception, sql:"select a.id,a.tid,a.seller_nick,a.buyer_nick,a.receiver_name,a.receiver_mobile,a.created,a.seller_flag,a.status,a.payment,a.buyer_message,a.seller_memo,a.receiver_state,a.receiver_city,a.modified,a.buyer_rate,(b.mobile is not null) as is_friend from sf_taobao_order a left join sf_customer_friend b on a.receiver_mobile = b.mobile where a.del_flag='0' order by created desc", exception: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "is" "IS" at line 1, column 220.
Was expecting one of:
"&"
")"
"::"
"<<"
">>"
"COLLATE"
"["
"^"
"|"`
Comment From: miemieYaho
jsqlparser 无法解析
Comment From: ye17186
这个是jsqlParser的bug,可以避免写(b.mobile is not null) as is_friend这种语句,改由业务代码完成。或者升级jsqlParser 3.2 -> 4.0
Comment From: huayanYu
3.4.2已升级jsqlParser版本,建议升级