mirror of
https://github.com/MariaDB/server.git
synced 2025-05-08 15:01:49 +03:00
- Changed output to be error "error-text" instead of error - error-text extra/perror.c: Move my_handler_errors.h into include include/my_handler_errors.h: Move my_handler_errors.h into include mysql-test/r/errors.result: Updated result mysql-test/r/innodb_mysql_sync.result: Updated result mysql-test/r/myisam-system.result: Updated result mysql-test/r/myisampack.result: Updated result mysql-test/r/partition_innodb_plugin.result: Updated result mysql-test/r/ps_1general.result: Updated result mysql-test/r/trigger.result: Updated result mysql-test/r/type_bit.result: Updated result mysql-test/r/type_bit_innodb.result: Updated result mysql-test/r/type_blob.result: Updated result mysql-test/suite/archive/archive.result: Updated result mysql-test/suite/binlog/r/binlog_index.result: Updated result mysql-test/suite/binlog/r/binlog_ioerr.result: Updated result mysql-test/suite/csv/csv.result: Updated result mysql-test/suite/engines/iuds/r/type_bit_iuds.result: Updated result mysql-test/suite/federated/federated_bug_35333.result: Updated result mysql-test/suite/innodb/r/innodb-create-options.result: Updated result mysql-test/suite/innodb/r/innodb-index.result: Updated result mysql-test/suite/innodb/r/innodb-zip.result: Updated result mysql-test/suite/innodb/r/innodb.result: Updated result mysql-test/suite/innodb/r/innodb_bug13635833.result: Updated result mysql-test/suite/innodb/r/innodb_bug21704.result: Updated result mysql-test/suite/innodb/r/innodb_bug46000.result: Updated result mysql-test/suite/parts/r/partition_bit_innodb.result: Updated result mysql-test/suite/parts/r/partition_bit_myisam.result: Updated result mysql-test/suite/percona/percona_innodb_fake_changes.result: Updated result mysql-test/suite/perfschema/r/misc.result: Updated result mysql-test/suite/perfschema/r/privilege.result: Updated result mysql-test/suite/rpl/r/rpl_EE_err.result: Updated result mysql-test/suite/rpl/r/rpl_binlog_errors.result: Updated result mysql-test/suite/rpl/r/rpl_drop_db.result: Updated result sql/share/errmsg-utf8.txt: Removed 'column' from error text that was used in different context strings/my_vsnprintf.c: Move my_handler_errors.h into include Minor cleanups Changed output of %M to be error "error-text" instead of error - error-text unittest/mysys/my_vsnprintf-t.c: Updated error text
56 lines
1.9 KiB
Plaintext
56 lines
1.9 KiB
Plaintext
#
|
|
# Bug#21704: Renaming column does not update FK definition.
|
|
#
|
|
|
|
# Test that it's not possible to rename columns participating in a
|
|
# foreign key (either in the referencing or referenced table).
|
|
|
|
DROP TABLE IF EXISTS t1;
|
|
DROP TABLE IF EXISTS t2;
|
|
DROP TABLE IF EXISTS t3;
|
|
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ROW_FORMAT=COMPACT ENGINE=INNODB;
|
|
CREATE TABLE t2 (a INT PRIMARY KEY, b INT,
|
|
CONSTRAINT fk1 FOREIGN KEY (a) REFERENCES t1(a))
|
|
ROW_FORMAT=COMPACT ENGINE=INNODB;
|
|
CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY(b), C INT,
|
|
CONSTRAINT fk2 FOREIGN KEY (b) REFERENCES t3 (a))
|
|
ROW_FORMAT=COMPACT ENGINE=INNODB;
|
|
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
|
|
INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
|
|
INSERT INTO t3 VALUES (1,1,1),(2,2,2),(3,3,3);
|
|
|
|
# Test renaming the column in the referenced table.
|
|
|
|
ALTER TABLE t1 CHANGE a c INT;
|
|
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed")
|
|
# Ensure that online column rename works.
|
|
ALTER TABLE t1 CHANGE b c INT;
|
|
affected rows: 3
|
|
info: Records: 3 Duplicates: 0 Warnings: 0
|
|
|
|
# Test renaming the column in the referencing table
|
|
|
|
ALTER TABLE t2 CHANGE a c INT;
|
|
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150 "Foreign key constraint is incorrectly formed")
|
|
# Ensure that online column rename works.
|
|
ALTER TABLE t2 CHANGE b c INT;
|
|
affected rows: 3
|
|
info: Records: 3 Duplicates: 0 Warnings: 0
|
|
|
|
# Test with self-referential constraints
|
|
|
|
ALTER TABLE t3 CHANGE a d INT;
|
|
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150 "Foreign key constraint is incorrectly formed")
|
|
ALTER TABLE t3 CHANGE b d INT;
|
|
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150 "Foreign key constraint is incorrectly formed")
|
|
# Ensure that online column rename works.
|
|
ALTER TABLE t3 CHANGE c d INT;
|
|
affected rows: 3
|
|
info: Records: 3 Duplicates: 0 Warnings: 0
|
|
|
|
# Cleanup.
|
|
|
|
DROP TABLE t3;
|
|
DROP TABLE t2;
|
|
DROP TABLE t1;
|