Bug #111421 Unexpected error when `CHECK` a predicate that is always true
Submitted: 14 Jun 2023 15:34 Modified: 15 Jun 2023 5:33
Reporter: chi zhang Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:last commit version in github, 8.0.33 OS:Any
Assigned to: CPU Architecture:Any

[14 Jun 2023 15:34] chi zhang
Description:
The following query triggers an error:

```
CREATE TABLE t0(c1 NUMERIC CHECK (true));
```

This is the error message:

```
Column check constraint 't0_chk_1' references other column.
```

A `true` predicate means no value will violate this constraint, and this constraint does not violate any rules regarding checks shown in https://dev.mysql.com/doc/refman/8.0/en/create-table-check-constraints.html.

How to repeat:
I can reproduce with the latest commit version in github https://github.com/mysql/mysql-server/commit/ea7087d885006918ad54458e7aad215b1650312c
[15 Jun 2023 5:33] MySQL Verification Team
Hello chi zhang,

Thank you for the report and test case.
Verified as described.

regards,
Umesh