zoukankan      html  css  js  c++  java
  • merge sql error, dbType postgresql

    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

  • 相关阅读:
    WPF 柱状图显示数据
    WPF 寻找控件模板中的元素
    WPF 寻找数据模板中的元素
    WPF VisualTreeHelper的使用
    WPF依赖项属性不需要包装属性也可以工作
    WPF依赖属性对内存的使用方式
    WPF Binding Path妙用
    WPF Binding Path妙用代码实现
    WPF Binding妙处-既无Path也无Source
    WPF ListView的使用
  • 原文地址:https://www.cnblogs.com/bigorang/p/12400615.html
Copyright © 2011-2022 走看看