mysql的load data infile语法加上druid的监控后报错

lokaqttq  于 4个月前  发布在  Druid
关注(0)|答案(4)|浏览(64)

最近又测试了一下mysql的load data infile函数在用druid的连接池配上监控后报错测试1.1.8和1.1.10版本都一样的错。
我的sql语句如下:
load data infile 'd:/01.txt' into TABLE test_code fields terminated by '\t' LINES TERMINATED by '\r\n'
druid监控配置加上如下就报错:
spring.datasource.filters=config,stat,wall,log4j
错误信息如下:
java.sql.SQLException: sql injection violation, class com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlLoadDataInFileStatement not allow : load data infile 'd:/01.txt' into TABLE test_code fields terminated by '\t' LINES TERMINATED by '\r\n'
at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:800) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:251) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:929) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:122) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:929) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:342) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:349) ~[druid-1.1.10.jar:1.1.10]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:87) ~[mybatis-3.4.4.jar:3.4.4]
at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88) ~[mybatis-3.4.4.jar:3.4.4]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59) ~[mybatis-3.4.4.jar:3.4.4]
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85) ~[mybatis-3.4.4.jar:3.4.4]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[mybatis-3.4.4.jar:3.4.4]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.4.jar:3.4.4]

相关问题