alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.97k stars 8.58k forks source link

postgresql :: round(xx::NUMERIC, 2)报错 #3280

Open shiyifanChris opened 5 years ago

shiyifanChris commented 5 years ago

java.sql.SQLException: sql injection violation, syntax error: syntax error, expect RPAREN, actual COLONCOLON pos 70, line 1, column 69, token COLONCOLON : SELECTcas ems_first_time_exam_pass_rate from t_ems_result r inner join t_ems_info i on r.exam_id = i.exam_id where r.submit_time is not null and r.exam_count = 1 and i.refer_id is null and r.judge_flag = 'FINISH' and r.corp_code = ? and r.show_result = 't' and r.user_id = ? and ( r.create_time >= ? or r.judge_time >= ? ) and ( r.judge_time <= ? or r.create_time<= ? ) at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:806)

at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:806)
at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:259)   at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:259)

at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568)

at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:341)

at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:349)

at com.tbc.paas.mdl.ds.MdlConnection.prepareStatement(MdlConnection.java:68)

at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1530)

at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633)

... 73 more

Caused by: com.alibaba.druid.sql.parser.ParserException: syntax error, expect RPAREN, actual COLONCOLON pos 70, line 1, column 69, token COLONCOLON

at com.alibaba.druid.sql.parser.SQLExprParser.accept(SQLExprParser.java:2742)

at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:1192)

at com.alibaba.druid.sql.parser.SQLExprParser.parseSelectItem(SQLExprParser.java:3339)

at com.alibaba.druid.sql.parser.SQLSelectParser.parseSelectList(SQLSelectParser.java:675)

at com.alibaba.druid.sql.dialect.postgresql.parser.PGSelectParser.query(PGSelectParser.java:112)
at com.alibaba.druid.sql.parser.SQLSelectParser.select(SQLSelectParser.java:88)

at com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser.parseSelect(PGSQLStatementParser.java:348)
at com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser.parseSelect(PGSQLStatementParser.java:57)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:248)  at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:248)

at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:182)

at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:624)

at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:578)

at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:793)

我去掉监控的filter就好了 后期想使用filter的功能

shiyifanChris commented 5 years ago

版本是最新的1.1.17