druid 解析mysql ALTER TABLE动态增加表分区报错

niwlg2el  于 2021-11-27  发布在  Java
关注(0)|答案(0)|浏览(360)

输入

ALTER TABLE XXXX  PARTITION BY HASH(X_ID)
 (
        partition P1,
        partition P2,
        partition P3,
        partition P4,
        partition P5,
        partition P6,
        partition P7,
        partition P8,
        partition P9,
        partition P10,
        partition P11,
        partition P12,
        partition P13,
        partition P14,
        partition P15,
        partition P16,
        partition P17,
        partition P18,
        partition P19,
        partition P20,
        partition P21,
        partition P22,
        partition P23,
        partition P24,
        partition P25,
        partition P26,
        partition P27,
        partition P28,
        partition P29,
        partition P30,
        partition P31,
        partition P32
    );

报错

syntax error, error in :'XXX PARTITION BY HASH(X_ID) ( ', expect PARTITION, actual PARTITION pos 27, line 1, column 17, token PARTITION

分析

是没有支持的功能,com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser#parseAlterTable并没有对应分支,所以ALTER TABLE XXXX;被解析成第一条sql,后面PARTITION BY 的部分报错。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题