-
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 check not enforce语法无法正常识别 #4082
Milestone
Comments
环境:druid 1.2.4 测试代码: public static void main(String[] args) {
String sql ="CREATE TABLE `t12` (\n" +
" `c1` int DEFAULT NULL,\n" +
" `c2` int DEFAULT NULL,\n" +
" `c3` int DEFAULT NULL,\n" +
" CONSTRAINT `c12_positive` CHECK ((`c2` > 0)) /*!80016 NOT ENFORCED */,\n" +
" CONSTRAINT `c21_nonzero` CHECK ((`c1` <> 0)),\n" +
" CONSTRAINT `t12_chk_1` CHECK ((`c1` <> `c2`)),\n" +
" CONSTRAINT `t12_chk_2` CHECK ((`c1` > 10)),\n" +
" CONSTRAINT `t12_chk_3` CHECK ((`c3` < 100)),\n" +
" CONSTRAINT `t12_chk_4` CHECK ((`c1` > `c3`))\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement createTableStatement = parser.parseStatement();
System.out.println(createTableStatement);
parser = new MySqlStatementParser(createTableStatement.toString());
createTableStatement = parser.parseStatement();
System.out.println(createTableStatement);
} 控制台打印的信息:
现在能识别/*!80016 NOT ENFORCED */ ,解释并格式化出来的SQL: NOT ENFORCED还不能识别了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
环境:mysql 8.0.22 , druid 1.2.3
SQL :
建表语句:
通过MYSQL的show CREATE table t1 得到的建表语句
其中测试代码如下:
解释报错:
The text was updated successfully, but these errors were encountered: