Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL)
-
None
Description
I am setting it to minor, because setting foreign_key_checks=off rarely ends well with or without replication. However, since the value is stored in the binlog, it could be expected that it works the same way on the master and slave (even if it's not a good way).
--source include/have_innodb.inc
|
--source include/master-slave.inc
|
|
CREATE TABLE t1 (id INT, KEY(id)) ENGINE=InnoDB; |
CREATE TABLE t2 (id INT) ENGINE=InnoDB; |
SET foreign_key_checks = OFF; |
ALTER TABLE t2 ADD FOREIGN KEY (id) REFERENCES t1 (id); |
ALTER TABLE t1 MODIFY id BIGINT; |
SET foreign_key_checks = ON; |
--error ER_ERROR_ON_RENAME
|
ALTER TABLE t2 FORCE, ALGORITHM=COPY; |
ALTER TABLE t2 MODIFY id BIGINT; |
|
--sync_slave_with_master
|
|
# Cleanup
|
--connection master
|
DROP TABLE t2, t1; |
--source include/rpl_end.inc |
10.5 1a5c4c2d |
Last_Error Error 'Cannot change column 'id': used in a foreign key constraint 't2_ibfk_1'' on query. Default database: 'test'. Query: 'ALTER TABLE t2 MODIFY id BIGINT'
|
Reproducible on 10.5+.
The test case is not applicable to 10.4, it behaves differently under foreign_key_checks=off.