druid 解析postgresql10.3 create table 分区名 partition of 表名 for values in('值') 问题

svmlkihl  于 2022-10-27  发布在  Druid
关注(0)|答案(1)|浏览(584)

测试脚本如下:
create table g_account (
fAcctNum NUMERIC(10) not null default 0,
fCaseYear INTEGER not null default '0'
)
partition by list (fAcctNum);

create table p_g_account_1 partition of g_account for values in('1')

java 测试代码
String sql="create table p_g_account_1 partition of g_account for values in('1')";
jdbcTemplate.execute(sql);

druid 解析 create table p_g_account_1 partition of g_account for values in('1') 报错
Caused by: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'ct_1 partition of g_account for val', expect IDENTIFIER, actual IDENTIFIER pos 36, line 1, column 27, token IDENTIFIER partition : create table p_g_account_1 partition of g_account for values in('1')
at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:798)
at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:780)
at com.alibaba.druid.wall.WallFilter.statement_execute(WallFilter.java:413)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2598)
at com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2473)
at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2598)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:147)
at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:558)
at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:406)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376)
... 32 more

使用版本

com.alibaba
druid-spring-boot-starter
1.1.10

p1tboqfb

p1tboqfb1#

原来这样配置的,spring.datasource.filters=stat,wall,log4j
改成 spring.datasource.filters=stat,log4j 就可以了,不知道为什么拦截了
create table partition_name partition of table_name for values

相关问题