mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
4b5a9d8e0f
Problem: ======= Inplace alter algorithm determines the table to be rebuild if the table undergoes row format change, key block size if handler flag contains only change table create option. If alter with inplace ignore flag operations and change table create options then it leads to table rebuild operation. Solution: ======== During the check for rebuild, ignore the inplace ignore flag and check for table create options. Reviewed-by: Jimmy Yang <jimmy.yang@oracle.com> Reviewed-by: Marko Makela <marko.makela@oracle.com> RB: 13172
26 lines
945 B
Text
26 lines
945 B
Text
# INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION
|
|
# CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE)
|
|
# AND TABLE CHARSET(CHANGE CREATE)
|
|
CREATE TABLE t1(
|
|
id INT PRIMARY KEY,
|
|
f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB;
|
|
INSERT INTO t1 VALUES(1, 2);
|
|
SET SQL_MODE='STRICT_ALL_TABLES';
|
|
ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0,
|
|
DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
|
|
DROP TABLE t1;
|
|
# CHANGE THE COMMENT OF COLUMN(INPLACE IGNORE)
|
|
# AND TABLE CHARSET(CHANGE CREATE)
|
|
CREATE TABLE t1(id INT COMMENT 'independence day')ENGINE=INNODB;
|
|
INSERT INTO t1 values(1);
|
|
ALTER TABLE t1 MODIFY COLUMN id INT COMMENT 'identifier',
|
|
DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
|
|
DROP TABLE t1;
|
|
# RENAME THE TABLE(INPLACE IGNORE)
|
|
# AND CHANGE TABLE CHARSET(CHANGE CREATE)
|
|
CREATE TABLE t1(
|
|
f1 INT NOT NULL,
|
|
f2 INT NOT NULL)ENGINE=INNODB;
|
|
INSERT INTO t1 VALUES(1, 2);
|
|
ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
|
|
DROP TABLE t2;
|