开发者社区> 问答> 正文

[ERROR] [com.alibaba.druid.filter.stat.S?报错

[ERROR] [com.alibaba.druid.filter.stat.StatFilter] - merge sql error? 400 报错

@wenshao 你好,请问下这个问题有计划在新版本里面修复吗:

1) druid版本号:0.2.12

2) 产生错误的SQL:

select COUNT(id) from log where 
ctime>ADDDATE(NOW(),INTERVAL -? HOUR) and
result='yes' and 
notify_result='n' and 
notify_count>?

3)错误日志:

[ERROR] [com.alibaba.druid.filter.stat.StatFilter] - merge sql error, dbType mysql, sql : 
select COUNT(id) from log where 
ctime>ADDDATE(NOW(),INTERVAL -? HOUR) and
result='yes' and 
notify_result='n' and 
notify_count>?


com.alibaba.druid.sql.parser.ParserException: TODO
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:339)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.primary(MySqlExprParser.java:170)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:87)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.parseInterval(MySqlExprParser.java:480)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:400)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.primary(MySqlExprParser.java:170)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:87)
at com.alibaba.druid.sql.parser.SQLExprParser.exprList(SQLExprParser.java:621)
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:531)
at com.alibaba.druid.sql.parser.SQLExprParser.primaryRest(SQLExprParser.java:499)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.primaryRest(MySqlExprParser.java:458)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:460)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.primary(MySqlExprParser.java:170)
at com.alibaba.druid.sql.parser.SQLExprParser.multiplicative(SQLExprParser.java:129)
at com.alibaba.druid.sql.parser.SQLExprParser.additive(SQLExprParser.java:867)
at com.alibaba.druid.sql.parser.SQLExprParser.shift(SQLExprParser.java:895)
at com.alibaba.druid.sql.parser.SQLExprParser.bitAnd(SQLExprParser.java:777)
at com.alibaba.druid.sql.parser.SQLExprParser.bitOr(SQLExprParser.java:791)
at com.alibaba.druid.sql.parser.SQLExprParser.relationalRest(SQLExprParser.java:1006)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlExprParser.relationalRest(MySqlExprParser.java:83)
at com.alibaba.druid.sql.parser.SQLExprParser.exprRest(SQLExprParser.java:104)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:93)
at com.alibaba.druid.sql.parser.SQLSelectParser.expr(SQLSelectParser.java:398)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseWhere(SQLSelectParser.java:213)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlSelectParser.query(MySqlSelectParser.java:184)
at com.alibaba.druid.sql.parser.SQLSelectParser.select(SQLSelectParser.java:59)
at com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseSelect(MySqlStatementParser.java:184)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:86)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:70)
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:41)
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:145)
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:627)
at com.alibaba.druid.filter.stat.StatFilter.statementPrepareAfter(StatFilter.java:305)
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:124)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:446)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:342)
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:319)

展开
收起
优选2 2020-06-04 18:05:57 4708 0
1 条回答
写回答
取消 提交回答
  • 我在0.2.23版本中发现这个问题已经修复了。######

    0.2.23版本问题还存在么?

    http://repo1.maven.org/maven2/com/alibaba/druid/0.2.23/

    ######试过了,可以了,多谢!
    2020-06-05 13:37:20
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
DATA SECURITY IS NOW MORE IMPO 立即下载
Apache Wicket User Guide - Ref 立即下载
Sketching Data With T-Digest in Apache Spark 立即下载