| 1 |
ALTER DATABASE test CHARACTER SET latin1 COLLATE latin1_swedish_ci; |
| 2 |
call mtr.add_suppression("Index for table 'tab' is corrupt; try to repair it"); |
| 3 |
SET @row_format = @@GLOBAL.innodb_default_row_format; |
| 4 |
# ########################################################### |
| 5 |
# Check with Import/Export tablespace with Default_row_format |
| 6 |
SET GLOBAL innodb_default_row_format=Compact; |
| 7 |
SELECT @@innodb_default_row_format; |
| 8 |
@@innodb_default_row_format |
| 9 |
compact |
| 10 |
SELECT @@innodb_file_per_table; |
| 11 |
@@innodb_file_per_table |
| 12 |
1 |
| 13 |
CREATE TABLE tab(a INT) ENGINE=InnoDB; |
| 14 |
SHOW TABLE STATUS LIKE 'tab'; |
| 15 |
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 |
| 16 |
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N |
| 17 |
INSERT INTO tab VALUES(1); |
| 18 |
INSERT INTO tab VALUES(2); |
| 19 |
SELECT * FROM tab; |
| 20 |
a |
| 21 |
1 |
| 22 |
2 |
| 23 |
FLUSH TABLE tab FOR EXPORT; |
| 24 |
UNLOCK TABLES; |
| 25 |
DROP TABLE tab; |
| 26 |
SET GLOBAL innodb_default_row_format=Dynamic; |
| 27 |
CREATE TABLE tab(a INT) ENGINE=InnoDB; |
| 28 |
ALTER TABLE tab DISCARD TABLESPACE; |
| 29 |
ALTER TABLE tab IMPORT TABLESPACE; |
| 30 |
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT) |
| 31 |
DROP TABLE tab; |
| 32 |
SET GLOBAL innodb_default_row_format=Compact; |
| 33 |
SELECT @@innodb_default_row_format; |
| 34 |
@@innodb_default_row_format |
| 35 |
compact |
| 36 |
CREATE TABLE tab(a INT) ENGINE=InnoDB; |
| 37 |
SHOW TABLE STATUS LIKE 'tab'; |
| 38 |
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 |
| 39 |
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N |
| 40 |
ALTER TABLE tab DISCARD TABLESPACE; |
| 41 |
call mtr.add_suppression("InnoDB: Tried to read .* bytes at offset 0"); |
| 42 |
ALTER TABLE tab IMPORT TABLESPACE; |
| 43 |
ERROR HY000: Index for table 'tab' is corrupt; try to repair it |
| 44 |
ALTER TABLE tab IMPORT TABLESPACE; |
| 45 |
SELECT * FROM tab; |
| 46 |
a |
| 47 |
1 |
| 48 |
2 |
| 49 |
DROP TABLE tab; |
| 50 |
# ########################################################### |
| 51 |
SET GLOBAL innodb_default_row_format=Dynamic; |
| 52 |
SELECT @@innodb_default_row_format; |
| 53 |
@@innodb_default_row_format |
| 54 |
dynamic |
| 55 |
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(3070))) ENGINE= InnoDB; |
| 56 |
SHOW TABLE STATUS LIKE 'tab'; |
| 57 |
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 |
| 58 |
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N |
| 59 |
INSERT INTO tab(a,b) VALUES(1,'Check with max column size'); |
| 60 |
SELECT * FROM tab; |
| 61 |
a b |
| 62 |
1 Check with max column size |
| 63 |
SET GLOBAL innodb_default_row_format=COMPACT; |
| 64 |
ALTER TABLE tab ROW_FORMAT=COMPACT; |
| 65 |
ERROR HY000: Index column size too large. The maximum column size is 767 bytes |
| 66 |
DROP TABLE tab; |
| 67 |
SET GLOBAL innodb_default_row_format=Default; |
| 68 |
SELECT @@innodb_default_row_format; |
| 69 |
@@innodb_default_row_format |
| 70 |
dynamic |
| 71 |
SET GLOBAL innodb_default_row_format=Dynamic; |
| 72 |
SELECT @@innodb_default_row_format; |
| 73 |
@@innodb_default_row_format |
| 74 |
dynamic |
| 75 |
CREATE TABLE tab(a INT PRIMARY KEY, b VARCHAR(5000), KEY idx1(b(767))) ENGINE= InnoDB; |
| 76 |
SHOW TABLE STATUS LIKE 'tab'; |
| 77 |
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 |
| 78 |
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N |
| 79 |
INSERT INTO tab(a,b) VALUES(1,'Check with max column size'); |
| 80 |
SELECT * FROM tab; |
| 81 |
a b |
| 82 |
1 Check with max column size |
| 83 |
ALTER TABLE tab ROW_FORMAT=COMPACT; |
| 84 |
SHOW TABLE STATUS LIKE 'tab'; |
| 85 |
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 |
| 86 |
tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=COMPACT 0 N |
| 87 |
SELECT * FROM tab; |
| 88 |
a b |
| 89 |
1 Check with max column size |
| 90 |
SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed; |
| 91 |
SET GLOBAL innodb_read_only_compressed=ON; |
| 92 |
ALTER TABLE tab ROW_FORMAT=COMPRESSED; |
| 93 |
ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE. |
| 94 |
SET GLOBAL innodb_read_only_compressed=OFF; |
| 95 |
ALTER TABLE tab ROW_FORMAT=COMPRESSED; |
| 96 |
SET GLOBAL innodb_read_only_compressed=ON; |
| 97 |
SELECT * FROM tab; |
| 98 |
a b |
| 99 |
1 Check with max column size |
| 100 |
ALTER TABLE tab ROW_FORMAT=Dynamic; |
| 101 |
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed; |
| 102 |
SHOW TABLE STATUS LIKE 'tab'; |
| 103 |
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 |
| 104 |
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N |
| 105 |
DROP TABLE tab; |
| 106 |
SET GLOBAL innodb_default_row_format = @row_format; |
| 107 |
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci; |