alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.99k stars 8.59k forks source link

[BUG] 用ast 的SQLUtils解析postgresql修改字段类型的ddl有问题 #6206

Open liusen259 opened 3 weeks ago

liusen259 commented 3 weeks ago

Database Type

postgresql

Database Version

postgresql

Druid Version

1.2.8

JDK Version

jdk8

Error SQL

ALTER TABLE t_test_user1 ALTER COLUMN a1 TYPE bpchar(20);

Testcase Code

List statementList = SQLUtils.parseStatements(sql, dbType, true);

Stacktrace Info

No response

Error Info

原本sql语句是ALTER TABLE t_test_user1 ALTER COLUMN a1 TYPE bpchar(20); 转换完成之后ALTER TABLE t_test_user1 ALTER COLUMN a1 bpchar(20); 少了一个TYPE,导致代码修改表字段失败。