我要执行的SQL如下: ALTER TABLE t_test1 UPDATE name = '张三' WHERE ck_f_id = '1' 在clickHouse上执行 完全正常,如下: 但是,一旦我试图在项目中运行这条SQL,就报错,打断点发现在 WallProvider.class的630行,这条SQL被解析异常,直接被ParserException捕获,最后报错,如下:
Caused by: java.sql.SQLException: sql injection violation, dbType clickhouse, , druid-version 1.2.5, syntax error: Invalid from clause : name = ? : ALTER TABLE t_test1 UPDATE name = ? WHERE ck_f_id = ? at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:849) at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:292) at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568) at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:930) at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:122) 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:351) at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86) at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88) at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.prepareStatement(MybatisSimpleExecutor.java:92) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doUpdate(MybatisSimpleExecutor.java:53) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.update(MybatisCachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ... 89 common frames omitted Caused by: com.alibaba.druid.sql.parser.ParserException: Invalid from clause : name = ? at com.alibaba.druid.sql.parser.SQLSelectParser.parseTableSourceQueryTableExpr(SQLSelectParser.java:1124) at com.alibaba.druid.sql.parser.SQLSelectParser.parseTableSource(SQLSelectParser.java:1098) at com.alibaba.druid.sql.parser.SQLStatementParser.parseUpdateStatement(SQLStatementParser.java:4208) at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:243) at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:124) at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:630) at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:584) at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:826) ... 104 common frames omitted