-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '10.2' into bb-10.2-MDEV-14019
- Loading branch information
Showing
43 changed files
with
1,135 additions
and
263 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
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 | ||
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT | ||
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 | ||
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=COMPACT | ||
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 | ||
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL | ||
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 | ||
t1 InnoDB # Dynamic # # # # # # NULL # # NULL latin1_swedish_ci NULL | ||
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 | ||
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL | ||
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 | ||
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL | ||
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 | ||
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT | ||
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 | ||
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL row_format=REDUNDANT | ||
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 | ||
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL | ||
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 | ||
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL | ||
DROP TABLE t1; | ||
SET GLOBAL innodb_default_row_format = @row_format; |
108 changes: 108 additions & 0 deletions
108
mysql-test/suite/innodb/r/default_row_format_compatibility.result
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,108 @@ | ||
SET @row_format = @@GLOBAL.innodb_default_row_format; | ||
SET @large_prefix = @@GLOBAL.innodb_large_prefix; | ||
SET @file_format = @@GLOBAL.innodb_file_format; | ||
SET GLOBAL innodb_file_format = barracuda; | ||
Warnings: | ||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-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 | ||
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
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 | ||
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
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; | ||
SET GLOBAL innodb_large_prefix=ON; | ||
Warnings: | ||
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ | ||
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 | ||
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
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 | ||
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
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 | ||
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT | ||
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 | ||
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC | ||
DROP TABLE tab; | ||
SET GLOBAL innodb_default_row_format = @row_format; | ||
SET GLOBAL innodb_large_prefix = @large_prefix; | ||
Warnings: | ||
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ | ||
SET GLOBAL innodb_file_format = @file_format; | ||
Warnings: | ||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ |
11 changes: 11 additions & 0 deletions
11
mysql-test/suite/innodb/r/default_row_format_create,dynamic.rdiff
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,11 @@ | ||
--- default_row_format_create.result | ||
+++ default_row_format_create,dynamic.result | ||
@@ -1,7 +1,7 @@ | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB; | ||
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 | ||
-t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
+t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
DROP TABLE t1; | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; | ||
SHOW TABLE STATUS LIKE 't1'; |
11 changes: 11 additions & 0 deletions
11
mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
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,11 @@ | ||
--- default_row_format_create.result | ||
+++ default_row_format_create,redundant.result | ||
@@ -1,7 +1,7 @@ | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB; | ||
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 | ||
-t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
+t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
DROP TABLE t1; | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; | ||
SHOW TABLE STATUS LIKE 't1'; |
26 changes: 26 additions & 0 deletions
26
mysql-test/suite/innodb/r/default_row_format_create.result
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,26 @@ | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB; | ||
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 | ||
t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL | ||
DROP TABLE t1; | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; | ||
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 | ||
t1 InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC | ||
DROP TABLE t1; | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB 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 | ||
t1 InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT | ||
DROP TABLE t1; | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB 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 | ||
t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=REDUNDANT | ||
DROP TABLE t1; | ||
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB | ||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; | ||
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 | ||
t1 InnoDB # Compressed # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPRESSED key_block_size=1 | ||
DROP TABLE t1; |
Oops, something went wrong.