Add not enforced check not compatible with mysql 8.0 #47631
Closed
Description
opened on Oct 14, 2023
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE `t` (`a` int(11) DEFAULT NULL);
insert t values(1);
alter table t ADD CONSTRAINT chk CHECK (a > 1) NOT ENFORCED;
2. What did you expect to see? (Required)
MySQL 8.0:
mysql> alter table t ADD CONSTRAINT chk CHECK (a > 1) NOT ENFORCED;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
3. What did you see instead (Required)
mysql> alter table t ADD CONSTRAINT chk CHECK (a > 1) NOT ENFORCED;
ERROR 3819 (HY000): Check constraint 'chk' is violated.
4. What is your TiDB version? (Required)
master
Activity