Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
11.1.2
-
Docker containers with mariadb-galera-cluster
Mariadb version: 11.1.2
Description
table1:
CREATE TABLE users (
|
id INT PRIMARY KEY,
|
name VARCHAR(50) |
);
|
table2
CREATE TABLE orders (
|
id INT PRIMARY KEY,
|
user_id INT,
|
order_date DATE,
|
FOREIGN KEY (user_id) REFERENCES users(id)
|
);
|
Update:
ALTER TABLE users MODIFY COLUMN `id` tinyint(11) unsigned NOT NULL auto_increment; |
ERROR 1833 (HY000): Cannot change column 'id': used in a foreign key constraint 'orders_ibfk_1' of table 'runzi.orders' |
|
|
MariaDB [runzi]> SET FOREIGN_KEY_CHECKS=0; |
Query OK, 0 rows affected (0.001 sec) |
|
MariaDB [runzi]> ALTER TABLE users MODIFY COLUMN `id` tinyint(11) unsigned NOT NULL auto_increment; |
ERROR 1833 (HY000): Cannot change column 'id': used in a foreign key constraint 'orders_ibfk_1' of table 'runzi.orders' |
MariaDB [runzi]>
|
Attachments
Issue Links
- relates to
-
MDEV-16356 Allow ALGORITHM=NOCOPY for ADD CONSTRAINT
- Open
-
MDEV-31086 MODIFY COLUMN can break FK constraints, and lead to unrestorable dumps
- Closed
-
MDEV-31987 Cannot disable FOREIGN_KEY_CHECKS anymore for converting character set
- Closed