com.alibaba.druid.sql.parser.ParserException: ERROR. token : DELETE, pos : 105

记一次上线错误:

 Resolving eureka endpoints via configuration
2018-08-24 19:49:17,290 [http-nio-1911-exec-7] ERROR [com.alibaba.druid.filter.stat.StatFilter com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:147)] - merge sql error, dbType postgres
ql, sql : 
SELECT id,template,template_name,template_type from rc_cp_sms_template where template_type = ? and delete = 0 ORDER BY template_id
com.alibaba.druid.sql.parser.ParserException: ERROR. token : DELETE, pos : 105
        at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:587)
        at com.alibaba.druid.sql.dialect.postgresql.parser.PGExprParser.primary(PGExprParser.java:98)
        at com.alibaba.druid.sql.parser.SQLExprParser.bitXor(SQLExprParser.java:120)
        at com.alibaba.druid.sql.parser.SQLExprParser.multiplicative(SQLExprParser.java:157)
        at com.alibaba.druid.sql.parser.SQLExprParser.additive(SQLExprParser.java:1246)

最后druid报这个错误,最终排查发现是druid配置写了 useGlobalDataSourceStat: true(因为配置druid监控页面把这个打开),数据源全局设置导致,去掉即可

 

你可能感兴趣的:(开发中遇到的问题)