mirror of
https://github.com/MariaDB/server.git
synced 2025-02-07 06:12:18 +01:00
2464ee758a
Remove alter_algorithm but keep the variable as no-op (with a warning). The reasons for removing alter_algorithm are: - alter_algorithm was introduced as a replacement for the old_alter_table that was used to force the usage of the original alter table algorithm (copy) in the cases where the new alter algorithm did not work. The new option was added as a way to force the usage of a specific algorithm when it should instead have made it possible to disable algorithms that would not work for some reason. - alter_algorithm introduced some cases where ALTER TABLE would not work without specifying the ALGORITHM=XXX option together with ALTER TABLE. - Having different values of alter_algorithm on master and slave could cause slave to stop unexpectedly. - ALTER TABLE FORCE, as used by mariadb-upgrade, would not always work if alter_algorithm was set for the server. - As part of the MDEV-33449 "improving repair of tables" it become clear that alter- algorithm made it harder to provide a better and more consistent ALTER TABLE FORCE and REPAIR TABLE and it would be better to remove it.
30 lines
1.1 KiB
Text
30 lines
1.1 KiB
Text
create table bug53592(a int) engine=innodb row_format=compact;
|
|
alter table bug53592 add column b text charset utf8;
|
|
alter table bug53592 add column c blob not null;
|
|
create index bug53592_b on bug53592(b(81));
|
|
create unique index bug53592_c on bug53592(c(1));
|
|
set statement sql_mode = '' for
|
|
replace into bug53592 values (),();
|
|
Warnings:
|
|
Warning 1364 Field 'c' doesn't have a default value
|
|
check table bug53592;
|
|
Table Op Msg_type Msg_text
|
|
test.bug53592 check status OK
|
|
drop table bug53592;
|
|
CREATE TABLE bug53592_1(
|
|
col1 int, col2 int,
|
|
PRIMARY KEY (col1, col2)
|
|
) ENGINE=InnoDB;
|
|
CREATE TABLE bug53592_2 (
|
|
col int PRIMARY KEY,
|
|
FOREIGN KEY (col) REFERENCES bug53592_1 (col1)
|
|
ON DELETE CASCADE ON UPDATE CASCADE
|
|
) ENGINE=InnoDB;
|
|
INSERT INTO bug53592_1 VALUES (1, 2);
|
|
INSERT INTO bug53592_1 VALUES (3, 4);
|
|
INSERT INTO bug53592_2 VALUES (1);
|
|
INSERT INTO bug53592_2 VALUES (3);
|
|
UPDATE bug53592_1 SET col1 = 3 WHERE col2 = 2;
|
|
ERROR 23000: Foreign key constraint for table 'bug53592_1', record '3-2' would lead to a duplicate entry in table 'bug53592_2', key 'PRIMARY'
|
|
drop table bug53592_2;
|
|
drop table bug53592_1;
|