improved mysql 8.16 support, sql parser support check not enforced option, fix #4082

This commit is contained in:
高铁
2020-12-11 10:49:03 +08:00
parent b1e8264b3a
commit b04ff9b889
5 changed files with 63 additions and 0 deletions
@@ -58,6 +58,9 @@ public class MySqlResourceTest extends TestCase {
public void test_16() throws Exception {
exec_test("bvt/parser/mysql-16.txt");
}
public void test_17() throws Exception {
exec_test("bvt/parser/mysql-17.txt");
}
public void exec_test(String resource) throws Exception {
// System.out.println(resource);
@@ -0,0 +1,23 @@
CREATE TABLE `t12` (
`c1` int DEFAULT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
CONSTRAINT `c12_positive` CHECK ((`c2` > 0)) /*!80016 NOT ENFORCED */,
CONSTRAINT `c21_nonzero` CHECK ((`c1` <> 0)),
CONSTRAINT `t12_chk_1` CHECK ((`c1` <> `c2`)),
CONSTRAINT `t12_chk_2` CHECK ((`c1` > 10)),
CONSTRAINT `t12_chk_3` CHECK ((`c3` < 100)),
CONSTRAINT `t12_chk_4` CHECK ((`c1` > `c3`))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
---------------------------
CREATE TABLE `t12` (
`c1` int DEFAULT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
CONSTRAINT `c12_positive` CHECK (`c2` > 0) NOT ENFORCED,
CONSTRAINT `c21_nonzero` CHECK (`c1` <> 0),
CONSTRAINT `t12_chk_1` CHECK (`c1` <> `c2`),
CONSTRAINT `t12_chk_2` CHECK (`c1` > 10),
CONSTRAINT `t12_chk_3` CHECK (`c3` < 100),
CONSTRAINT `t12_chk_4` CHECK (`c1` > `c3`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci