Comment 1 for bug 1889732

Revision history for this message
Itsuro Oda (oda-g) wrote :

It is just an information. I found it depends on mysql version.

For example;
--- bionic mysql 5.7.29 ---
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.29-0ubuntu0.18.04.1 |
+-------------------------+
1 row in set (0.00 sec)

mysql> use neutron
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table x1 ( a int, constraint ct1 check (a in (1, 2)) );
Query OK, 0 rows affected (0.47 sec)

mysql> create table x2 ( b int, constraint ct1 check (b in (3, 4)) );
Query OK, 0 rows affected (1.65 sec)
---

--- focal mysql 8.0.21 ---
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 8.0.21-0ubuntu0.20.04.4 |
+-------------------------+
1 row in set (0.00 sec)

mysql> use neutron
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table x1 ( a int, constraint ct1 check (a in (1, 2)) );
Query OK, 0 rows affected (2.05 sec)

mysql> create table x2 ( b int, constraint ct1 check (b in (3, 4)) );
ERROR 3822 (HY000): Duplicate check constraint name 'ct1'.
mysql>
---