Skip to content

Commit

Permalink
support 'alter online table t1 page_checksum=0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Aug 15, 2023
1 parent 6c57e29 commit a8a22b7
Show file tree
Hide file tree
Showing 36 changed files with 139 additions and 143 deletions.
4 changes: 2 additions & 2 deletions mysql-test/main/alter_table.result
Expand Up @@ -1733,6 +1733,7 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 1
Expand All @@ -1749,8 +1750,7 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
affected rows: 0
ALTER ONLINE TABLE m1 ADD COLUMN c int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
Expand Down
14 changes: 12 additions & 2 deletions mysql-test/main/alter_table.test
Expand Up @@ -1517,6 +1517,13 @@ ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= NONE;
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= INPLACE, LOCK= SHARED;
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
--disable_info
--disable_warnings
--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
# COPY/NONE works now, but still an error in embedded
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
--enable_warnings
--enable_info
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
ALTER TABLE t1 ADD INDEX i6(b), ALGORITHM= COPY, LOCK= EXCLUSIVE;

Expand All @@ -1525,8 +1532,11 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER ONLINE TABLE m1 ADD COLUMN c int;
--disable_info
--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
# COPY/NONE works now, but still an error in embedded
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
--enable_info
# This works because the lock will be SNW for the copy phase.
# It will still require exclusive lock for actually enabling keys.
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
Expand Down
19 changes: 0 additions & 19 deletions mysql-test/main/alter_table_locknone.result
Expand Up @@ -53,30 +53,11 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new comment'
alter online table t1 page_checksum=1;
alter online table t1 page_checksum=0;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
drop table t1;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 modify b bigint;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 modify e enum('c','a','b');
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 modify c varchar(50);
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 modify c varchar(100);
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 add f int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 engine=memory;
alter online table t1 rename to t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
alter online table t1 checksum=1;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter online table t1 add constraint check (b > 0);
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
Expand Down
25 changes: 0 additions & 25 deletions mysql-test/main/alter_table_locknone.test
Expand Up @@ -33,7 +33,6 @@ drop table t1;
#
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);

alter online table t1 modify b int default 5, alter c set default 'X';
alter online table t1 change b new_name int;
alter online table t1 modify e enum('a','b','c');
Expand All @@ -54,37 +53,13 @@ alter online table t1 modify e enum('a','b','c');
alter online table t1 comment "new comment";
show create table t1;
alter online table t1 page_checksum=1;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 page_checksum=0;
drop table t1;

#
# Test of things that is not possible to do online
#

create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);

--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 drop column b, add b int;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify b bigint;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify e enum('c','a','b');
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify c varchar(50);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify c varchar(100);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 add f int;
--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter online table t1 engine=memory;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 rename to t2;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 checksum=1;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 add constraint check (b > 0);

alter table t1 engine=innodb;
alter table t1 add index (b);
Expand Down
25 changes: 25 additions & 0 deletions mysql-test/main/alter_table_locknone_notembedded.result
@@ -0,0 +1,25 @@
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
insert into t1 (a) values (1),(2),(3);
alter online table t1 page_checksum=1;
alter online table t1 page_checksum=0;
alter online table t1 drop column b, add b int;
alter online table t1 modify b bigint;
alter online table t1 modify e enum('c','a','b');
alter online table t1 modify c varchar(50);
alter online table t1 modify c varchar(100);
alter online table t1 add f int;
alter online table t1 engine=memory;
alter online table t1 checksum=1;
alter online table t1 add constraint check (b > 0);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`c` varchar(100) DEFAULT NULL,
`e` enum('c','a','b') DEFAULT NULL,
`b` bigint(20) DEFAULT NULL,
`f` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0)
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci CHECKSUM=1
drop table t1;
22 changes: 22 additions & 0 deletions mysql-test/main/alter_table_locknone_notembedded.test
@@ -0,0 +1,22 @@
source include/not_embedded.inc;
#
# Test of ALTER ONLINE TABLE syntax
# (same as LOCK=NONE)
#

create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
insert into t1 (a) values (1),(2),(3);
alter online table t1 page_checksum=1;
alter online table t1 page_checksum=0;
alter online table t1 drop column b, add b int;
alter online table t1 modify b bigint;
alter online table t1 modify e enum('c','a','b');
alter online table t1 modify c varchar(50);
alter online table t1 modify c varchar(100);
alter online table t1 add f int;
alter online table t1 engine=memory;
alter online table t1 checksum=1;
alter online table t1 add constraint check (b > 0);

show create table t1;
drop table t1;
1 change: 1 addition & 0 deletions mysql-test/suite/gcol/inc/gcol_select.inc
Expand Up @@ -872,6 +872,7 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2147483647);
ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL;
ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY;
# COPY/NONE is not supported in embedded
--error ER_WARN_DATA_OUT_OF_RANGE,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
--error ER_WARN_DATA_OUT_OF_RANGE,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/gcol/r/innodb_virtual_basic.result
Expand Up @@ -957,12 +957,12 @@ CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
INSERT INTO t1 VALUES (11, 3, DEFAULT, 'mm');
INSERT INTO t1 VALUES (18, 1, DEFAULT, 'mm');
INSERT INTO t1 VALUES (28, 1, DEFAULT, 'mm');
ALTER TABLE t1 ADD INDEX idx12 (c) , FORCE, LOCK=NONE;
ALTER TABLE t1 ADD INDEX idx12 (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t1 ADD INDEX idx12 (c), LOCK=NONE;
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c) , FORCE, LOCK=NONE;
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), LOCK=NONE;
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
DROP TABLE t1 ;
CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), d INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/gcol/r/innodb_virtual_debug.result
Expand Up @@ -53,7 +53,7 @@ a b c h
18 1 19 mm
28 1 29 mm
NULL NULL NULL mx
ALTER TABLE t FORCE, LOCK=NONE;
ALTER TABLE t FORCE, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
disconnect con1;
DROP TABLE t;
Expand Down
16 changes: 8 additions & 8 deletions mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
Expand Up @@ -6,30 +6,30 @@ CREATE TABLE t4 (i INT, v INT AS (i) VIRTUAL) ENGINE=InnoDB
ROW_FORMAT=REDUNDANT;
INSERT INTO t4 SET i=1;
ALTER TABLE t4 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t4 ADD COLUMN k INT, LOCK=NONE;
ALTER TABLE t4 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t4 DROP k, LOCK=NONE;
ALTER TABLE t4 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t4 DROP INDEX v, LOCK=NONE;
INSERT INTO t3 SET i=1;
ALTER TABLE t3 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t3 ADD COLUMN k INT, LOCK=NONE;
ALTER TABLE t3 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t3 DROP k, LOCK=NONE;
ALTER TABLE t3 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t3 DROP INDEX v, LOCK=NONE;
INSERT INTO t2 SET i=1;
ALTER TABLE t2 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t2 ADD COLUMN k INT, LOCK=NONE;
ALTER TABLE t2 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t2 DROP k, LOCK=NONE;
ALTER TABLE t2 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t2 DROP INDEX v, LOCK=NONE;
INSERT INTO t1 SET i=1;
ALTER TABLE t1 ADD INDEX(v), LOCK=NONE;
ALTER TABLE t1 ADD COLUMN k INT, LOCK=NONE;
ALTER TABLE t1 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t1 DROP k, LOCK=NONE;
ALTER TABLE t1 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t1 DROP INDEX v, LOCK=NONE;
connect ddl,localhost,root,,test;
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/gcol/t/innodb_virtual_basic.test
Expand Up @@ -886,12 +886,12 @@ INSERT INTO t1 VALUES (18, 1, DEFAULT, 'mm');
INSERT INTO t1 VALUES (28, 1, DEFAULT, 'mm');

--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 ADD INDEX idx12 (c) , FORCE, LOCK=NONE;
ALTER TABLE t1 ADD INDEX idx12 (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
ALTER TABLE t1 ADD INDEX idx12 (c), LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c) , FORCE, LOCK=NONE;
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), LOCK=NONE;
ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), ALGORITHM = INPLACE, LOCK=NONE;

DROP TABLE t1 ;

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/gcol/t/innodb_virtual_debug.test
Expand Up @@ -54,7 +54,7 @@ SHOW CREATE TABLE t;
SELECT * FROM t;

--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t FORCE, LOCK=NONE;
ALTER TABLE t FORCE, ALGORITHM=INPLACE, LOCK=NONE;
if (0) {# MDEV-14341 TODO: re-enable this
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead';
--send ALTER TABLE t FORCE
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
Expand Up @@ -16,9 +16,9 @@ eval INSERT INTO t$n SET i=1;
eval ALTER TABLE t$n ADD INDEX(v), LOCK=NONE;
# MDEV-17468 FIXME: Fix this, and remove the 2 --error below.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
eval ALTER TABLE t$n ADD COLUMN k INT, LOCK=NONE;
eval ALTER TABLE t$n ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
--error ER_CANT_DROP_FIELD_OR_KEY
eval ALTER TABLE t$n DROP k, LOCK=NONE;
eval ALTER TABLE t$n DROP k, ALGORITHM=INPLACE, LOCK=NONE;
eval ALTER TABLE t$n DROP INDEX v, LOCK=NONE;
dec $n;
}
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/innodb/r/autoinc_persist.result
Expand Up @@ -626,7 +626,7 @@ CREATE TABLE mdev6076a (b INT) ENGINE=InnoDB;
INSERT INTO mdev6076a VALUES(2),(1);
CREATE TABLE mdev6076b (b INT) ENGINE=InnoDB;
INSERT INTO mdev6076b VALUES(2),(1);
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, LOCK=NONE;
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Adding an auto-increment column requires a lock. Try LOCK=SHARED
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE;
ALTER TABLE mdev6076b ADD COLUMN a SERIAL FIRST, AUTO_INCREMENT=100,
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/innodb/r/innodb-alter-autoinc.result
Expand Up @@ -5,7 +5,7 @@ SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t1 ADD PRIMARY KEY(a);
SET @@sql_mode = @old_sql_mode;
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
LOCK=NONE;
ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Adding an auto-increment column requires a lock. Try LOCK=SHARED
ALTER TABLE t1 ADD id INT AUTO_INCREMENT;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
Expand Down Expand Up @@ -50,7 +50,7 @@ t1 CREATE TABLE `t1` (
KEY `id` (`id`,`a`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
DROP COLUMN id, AUTO_INCREMENT = 42, LOCK=NONE;
DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Adding an auto-increment column requires a lock. Try LOCK=SHARED
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE;
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/innodb/r/innodb-alter-timestamp.result
Expand Up @@ -86,8 +86,8 @@ ALTER TABLE t1 ADD COLUMN d2 TIMESTAMP DEFAULT '2017-05-08 16:23:45',
LOCK=NONE;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1;
Expand Down
24 changes: 12 additions & 12 deletions mysql-test/suite/innodb/r/innodb-alter.result
Expand Up @@ -438,28 +438,28 @@ tt CREATE TABLE `tt` (
PRIMARY KEY (`pk`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
CREATE TABLE tu (
pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
FULLTEXT INDEX(t)
) ENGINE=InnoDB;
ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
DROP TABLE tu;
CREATE TABLE tv (
pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
UNIQUE INDEX FTS_DOC_ID_INDEX(FTS_DOC_ID),
FULLTEXT INDEX(t)
) ENGINE=InnoDB;
ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
DROP TABLE tv;
ALTER TABLE t1o CHANGE c1 dB_row_Id INT, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'dB_row_Id'
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/innodb/r/innodb-index.result
Expand Up @@ -1598,8 +1598,8 @@ create table t1(f1 int not null, f2 int not null,
primary key (f1), unique key(f1, f2))engine=innodb;
insert into t1 values(1,3), (2,2);
alter table t1 drop primary key, lock=none;
alter table t1 drop index f1, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try LOCK=SHARED
alter table t1 drop index f1, algorithm=inplace, lock=none;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
drop table t1;
#
# BUG#21612714 ALTER TABLE SORTING SKIPPED WHEN CHANGE PK AND DROP
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/innodb/r/innodb-online-alter-gis.result
Expand Up @@ -23,7 +23,7 @@ t1 CREATE TABLE `t1` (
SPATIAL KEY `c` (`b`),
KEY `d` (`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d;
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, ALGORITHM=INPLACE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
show warnings;
Level Code Message
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/innodb/r/innodb-wl5980-alter.result
Expand Up @@ -1383,8 +1383,8 @@ t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try LOCK=SHARED
ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try ALGORITHM=COPY
SELECT sc.pos FROM information_schema.innodb_sys_columns sc
INNER JOIN information_schema.innodb_sys_tables st
ON sc.TABLE_ID=st.TABLE_ID
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/innodb/t/autoinc_persist.test
Expand Up @@ -393,7 +393,7 @@ INSERT INTO mdev6076a VALUES(2),(1);
CREATE TABLE mdev6076b (b INT) ENGINE=InnoDB;
INSERT INTO mdev6076b VALUES(2),(1);
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, LOCK=NONE;
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE, LOCK=NONE;
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE;
ALTER TABLE mdev6076b ADD COLUMN a SERIAL FIRST, AUTO_INCREMENT=100,
ALGORITHM=INPLACE;
Expand Down

0 comments on commit a8a22b7

Please sign in to comment.