Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
47 changed files
with
1,015 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| SET @row_format = @@GLOBAL.innodb_default_row_format; | ||
| #################################### | ||
| # Check if table rebuilding alter isn't affect if table is created | ||
| # with explicit row_format | ||
| CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=INNODB; | ||
| INSERT INTO t1 VALUES (1, 'abc'); | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT 0 N | ||
| SET GLOBAL innodb_default_row_format=DYNAMIC; | ||
| ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY; | ||
| # Here we expect COMPACT because it was explicitly specified at CREATE | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT 0 N | ||
| DROP TABLE t1; | ||
| #################################### | ||
| # Check if table rebuilding alter is affected when there is no | ||
| # row_format specified at CREATE TABLE. | ||
| SET GLOBAL innodb_default_row_format = COMPACT; | ||
| CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB; | ||
| INSERT INTO t1 VALUES (1, 'abc'); | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N | ||
| SET GLOBAL innodb_default_row_format = DYNAMIC; | ||
| ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY; | ||
| # Here we expect DYNAMIC because there is no explicit ROW_FORMAT and the | ||
| # default_row_format is changed to DYNAMIC just before ALTER | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Dynamic # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N | ||
| DROP TABLE t1; | ||
| #################################### | ||
| # Check the row_format effect on ALTER, ALGORITHM=COPY | ||
| SET GLOBAL innodb_default_row_format = REDUNDANT; | ||
| CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB; | ||
| INSERT INTO t1 VALUES (1, REPEAT('abc',1000)); | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N | ||
| SET GLOBAL innoDB_default_row_format = COMPACT; | ||
| ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY; | ||
| # Because of ALGORITHM=COPY, there is TABLE REBUILD and the table isn't | ||
| # created with explicit row_format, so we expect ROW_FORMAT=COMPACT | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N | ||
| DROP TABLE t1; | ||
|
|
||
| ################################### | ||
| # Check the row_format effect on ALTER, ALGORITH=COPY on | ||
| # create table with explicit row_format | ||
| CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB; | ||
| INSERT INTO t1 VALUES (1, REPEAT('abc',1000)); | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N | ||
| SET GLOBAL innoDB_default_row_format = COMPACT; | ||
| ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY; | ||
| # Because of ALGORITHM=COPY, there is TABLE REBUILD and the table is | ||
| # created with explicit row_format, so we expect original | ||
| # ROW_FORMAT=REDUNDANT | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT 0 N | ||
| DROP TABLE t1; | ||
|
|
||
| ################################## | ||
| # Check row_format on ALTER ALGORITHM=INPLACE | ||
| SET GLOBAL innodb_default_row_format=COMPACT; | ||
| CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT, KEY k1(b(10))) ENGINE=INNODB; | ||
| INSERT INTO t1 VALUES (1, REPEAT('abc',1000)); | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N | ||
| SET GLOBAL innodb_default_row_format=DYNAMIC; | ||
| ALTER TABLE t1 DROP INDEX k1; | ||
| # Because it is in-place operation, there is no rebuild, so the | ||
| # original format has to be retained. | ||
| SHOW TABLE STATUS LIKE 't1'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N | ||
| DROP TABLE t1; | ||
| SET GLOBAL innodb_default_row_format = @row_format; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| SET @row_format = @@GLOBAL.innodb_default_row_format; | ||
| # ########################################################### | ||
| # Check with Import/Export tablespace with Default_row_format | ||
| SET GLOBAL innodb_default_row_format=Compact; | ||
| SELECT @@innodb_default_row_format; | ||
| @@innodb_default_row_format | ||
| compact | ||
| SELECT @@innodb_file_per_table; | ||
| @@innodb_file_per_table | ||
| 1 | ||
| CREATE TABLE tab(a INT) ENGINE=InnoDB; | ||
| SHOW TABLE STATUS LIKE 'tab'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N | ||
| INSERT INTO tab VALUES(1); | ||
| INSERT INTO tab VALUES(2); | ||
| SELECT * FROM tab; | ||
| a | ||
| 1 | ||
| 2 | ||
| FLUSH TABLE tab FOR EXPORT; | ||
| UNLOCK TABLES; | ||
| DROP TABLE tab; | ||
| SET GLOBAL innodb_default_row_format=Dynamic; | ||
| CREATE TABLE tab(a INT) ENGINE=InnoDB; | ||
| ALTER TABLE tab DISCARD TABLESPACE; | ||
| ALTER TABLE tab IMPORT TABLESPACE; | ||
| ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1) | ||
| DROP TABLE tab; | ||
| SET GLOBAL innodb_default_row_format=Compact; | ||
| SELECT @@innodb_default_row_format; | ||
| @@innodb_default_row_format | ||
| compact | ||
| CREATE TABLE tab(a INT) ENGINE=InnoDB; | ||
| SHOW TABLE STATUS LIKE 'tab'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N | ||
| ALTER TABLE tab DISCARD TABLESPACE; | ||
| ALTER TABLE tab IMPORT TABLESPACE; | ||
| SELECT * FROM tab; | ||
| a | ||
| 1 | ||
| 2 | ||
| DROP TABLE tab; | ||
| # ########################################################### | ||
| SET GLOBAL innodb_default_row_format=Dynamic; | ||
| SELECT @@innodb_default_row_format; | ||
| @@innodb_default_row_format | ||
| dynamic | ||
| CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(3070))) ENGINE= InnoDB; | ||
| SHOW TABLE STATUS LIKE 'tab'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N | ||
| INSERT INTO tab(a,b) VALUES(1,'Check with max column size'); | ||
| SELECT * FROM tab; | ||
| a b | ||
| 1 Check with max column size | ||
| SET GLOBAL innodb_default_row_format=COMPACT; | ||
| ALTER TABLE tab ROW_FORMAT=COMPACT; | ||
| ERROR HY000: Index column size too large. The maximum column size is 767 bytes | ||
| DROP TABLE tab; | ||
| SET GLOBAL innodb_default_row_format=Default; | ||
| SELECT @@innodb_default_row_format; | ||
| @@innodb_default_row_format | ||
| dynamic | ||
| SET GLOBAL innodb_default_row_format=Dynamic; | ||
| SELECT @@innodb_default_row_format; | ||
| @@innodb_default_row_format | ||
| dynamic | ||
| CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(767))) ENGINE= InnoDB; | ||
| SHOW TABLE STATUS LIKE 'tab'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N | ||
| INSERT INTO tab(a,b) VALUES(1,'Check with max column size'); | ||
| SELECT * FROM tab; | ||
| a b | ||
| 1 Check with max column size | ||
| ALTER TABLE tab ROW_FORMAT=COMPACT; | ||
| SHOW TABLE STATUS LIKE 'tab'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT 0 N | ||
| SELECT * FROM tab; | ||
| a b | ||
| 1 Check with max column size | ||
| ALTER TABLE tab ROW_FORMAT=COMPRESSED; | ||
| SELECT * FROM tab; | ||
| a b | ||
| 1 Check with max column size | ||
| ALTER TABLE tab ROW_FORMAT=Dynamic; | ||
| SHOW TABLE STATUS LIKE 'tab'; | ||
| Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary | ||
| tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N | ||
| DROP TABLE tab; | ||
| SET GLOBAL innodb_default_row_format = @row_format; |
Oops, something went wrong.