Skip to content

Add not enforced check not compatible with mysql 8.0 #47631

Closed
@jiyfhust

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions