-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mysql 8 check DDL语法无法正常识别 #4089
Comments
check 相关的还有其他语句: # 新增check 约束
ALTER TABLE t1 ADD CONSTRAINT chk1 CHECK((a>1));
ALTER TABLE t1 ADD CONSTRAINT chk1 CHECK((a>1)) NOT ENFORCED;
# 删除check 约束
ALTER TABLE t1 DROP CONSTRAINT t1_check ;
# 让check约束不生效
alter table t1 ALTER CHECK t1_check ENFORCED;
alter table t1 ALTER CHECK t1_check NOT ENFORCED; 其中除了删check约束是能正常识别,新增和修改check约束是不能正常识别的 测试代码1: {
String sql = "ALTER TABLE t1 ADD CONSTRAINT chk1 CHECK((a>1));";
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
assertEquals(1, statementList.size());
} 报错信息:
测试代码2 {
String sql = "alter table t1 ALTER CHECK t1_check NOT ENFORCED;";
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
assertEquals(1, statementList.size());
} 报错信息:
|
WillsonYip
added a commit
to WillsonYip/druid
that referenced
this issue
Dec 25, 2020
WillsonYip
added a commit
to WillsonYip/druid
that referenced
this issue
Dec 25, 2020
WillsonYip
added a commit
to WillsonYip/druid
that referenced
this issue
Dec 25, 2020
…t recognize the "NOT" token alibaba#4089
wenshao
added a commit
that referenced
this issue
Dec 25, 2020
support parsing mysql 8 check related DDL statement #4089
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
续#4082
环境:mysql 8.0.22 , druid 1.2.4
经过#4082修复之后,现在能识别/*!80016 NOT ENFORCED */ ,druid解释并格式化出来的SQL:
这条SQL mysql能正常识别,但用druid 1.2.4 去解释,依然有问题:
测试代码:
控制台打印的信息:
The text was updated successfully, but these errors were encountered: