Skip to content
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

Add not enforced check not compatible with mysql 8.0 #47631

Closed
jiyfhust opened this issue Oct 14, 2023 · 0 comments · Fixed by #47633
Closed

Add not enforced check not compatible with mysql 8.0 #47631

jiyfhust opened this issue Oct 14, 2023 · 0 comments · Fixed by #47633
Labels
affects-7.1 affects-7.2 affects-7.3 affects-7.4 affects-7.5 compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@jiyfhust
Copy link
Contributor

jiyfhust commented 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

@jiyfhust jiyfhust added the type/bug The issue is confirmed as a bug. label Oct 14, 2023
@jebter jebter added compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) component/ddl This issue is related to DDL of TiDB. severity/major labels Oct 17, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Oct 17, 2023
ti-chi-bot bot pushed a commit that referenced this issue Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 affects-7.2 affects-7.3 affects-7.4 affects-7.5 compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants