I run the method below:
SQLEvalVisitorUtils.evalExpr(JdbcConstants.H2, "? = 'druid' and not (? = '5' or ? = '3')", "druid", "5","0")
it throws Exception:
Exception in thread "main" com.alibaba.druid.DruidRuntimeException: eval error : ? = 'druid' AND NOT (? = '5' OR ? = '3') at com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.eval(SQLEvalVisitorUtils.java:154) at com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.eval(SQLEvalVisitorUtils.java:137) at com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.eval(SQLEvalVisitorUtils.java:119) at com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.evalExpr(SQLEvalVisitorUtils.java:110) at com.webank.ims.seckill.SqlParseDemo.main(SqlParseDemo.java:76)
Then, i use ! instead of not. it works :
SQLEvalVisitorUtils.evalExpr(JdbcConstants.H2, "? = 'druid' and ! (? = '5' or ? = '3')", "druid", "5","0")
hope to fix the bug. :-)
1条答案
按热度按时间b09cbbtk1#
good issue