码迷,mamicode.com
首页 > 数据库 > 详细

merge sql error, dbType postgresql

时间:2020-03-03 10:31:47      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:inter   ken   hub   column   issues   lis   ntp   partition   block   

2020-03-02 15:39:08.501 ERROR 267704 --- [ main] c.alibaba.druid.filter.stat.StatFilter : merge sql error, dbType postgresql, druid-1.1.10, sql : create table if not exists ip_count_20200302 partition of ip_count for values from (20200302) to (20200303);
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :‘0302 partition of ip_count ‘, expect IDENTIFIER, actual IDENTIFIER pos 72, line 1, column 63, token IDENTIFIER partition
at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:284) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:426) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:72) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:94) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:77) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:50) ~[druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:147) [druid-1.1.10.jar:1.1.10]
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:648) [druid-1.1.10.jar:1.1.10]

SQL

#postgre分区
create table if not exists ip_count_20200302 partition of ip_count for values from (20200302) to (20200303);

可能问题:

从druid的issue来看,druid的merge不支持postgresql的 partition字段

解决办法

1.关闭mergeSQL功能

#springboot
spring.datasource.druid.filter.stat.merge-sql=false

2.忽略该error虽然报error.但是语句是可以执行成功的,请自行校验

druid-issue

merge sql error, dbType postgresql

标签:inter   ken   hub   column   issues   lis   ntp   partition   block   

原文地址:https://www.cnblogs.com/bigorang/p/12400615.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!