Debian Codegraph @

mysql-test/suite/innodb/r/instant_ddl_import_old_debug.result

raw
1 # ------------------------------------------------------------
2 # Exported table t1 (in older version) having
3 # c1, c2 normal columns
4 # c3 INSTANT ADD column with default def_c3.
5 # c4 INSTANT ADD column with default def_c4.
6 # +------+------+--------+--------+
7 # | c1 | c2 | c3 | c4 |
8 # +------+------+--------+--------+
9 # | r1c1 | r1c2 | c3_def | c4_def |
10 # | r2c1 | r2c2 | r2c3 | c4_def |
11 # | r3c1 | r3c2 | r3c3 | r3c4 |
12 # +------+------+--------+--------+
13 # ------------------------------------------------------------
14 # Copy and unzip the ibd/cfg files.
15 # listing MYSQL_TMP_DIR/old_instant_comp
16 t1.cfg
17 t1.ibd
18 # ------------------------------------------------------------
19 # Scenario 1 : No INSTANT ADD/DROP Columns in target table
20 # ------------------------------------------------------------
21 create table t1 (c1 char(10), c2 char(10), c3 char(10), c4 char(10)) row_format=compact;
22 # Metadata from INFORMATION_SCHEMA.TABLES
23 NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS INITIAL_COLUMN_COUNTS CURRENT_COLUMN_COUNTS TOTAL_COLUMN_COUNTS
24 test/t1 7 0 0 4 4 4
25 # Metadata from INFORMATION_SCHEMA.COLUMNS
26 NAME POS MTYPE PRTYPE HAS_DEFAULT VERSION_ADDED VERSION_DROPPED
27 c1 0 13 16711934 0 0 0
28 c2 1 13 16711934 0 0 0
29 c3 2 13 16711934 0 0 0
30 c4 3 13 16711934 0 0 0
31 # DD Metadata of table
32 NAME SE_PRIVATE_DATA
33 t1 NULL
34 # DD Metadata of columns in table
35 NAME ORDINAL_POSITION TYPE HAS_NO_DEFAULT HIDDEN SE_PRIVATE_DATA
36 c1 1 MYSQL_TYPE_STRING 0 Visible table_id=TABLE_ID;
37 c2 2 MYSQL_TYPE_STRING 0 Visible table_id=TABLE_ID;
38 c3 3 MYSQL_TYPE_STRING 0 Visible table_id=TABLE_ID;
39 c4 4 MYSQL_TYPE_STRING 0 Visible table_id=TABLE_ID;
40 DB_ROW_ID 5 MYSQL_TYPE_INT24 0 SE table_id=TABLE_ID;
41 DB_TRX_ID 6 MYSQL_TYPE_INT24 0 SE table_id=TABLE_ID;
42 DB_ROLL_PTR 7 MYSQL_TYPE_LONGLONG 0 SE table_id=TABLE_ID;
43 # IMPORT
44 ALTER TABLE t1 DISCARD TABLESPACE;
45 # Copy cfg/ibd files from temp location
46 ALTER TABLE t1 IMPORT TABLESPACE;
47 SELECT * FROM t1 ORDER BY c1;
48 c1 c2 c3 c4
49 r1c1 r1c2 c3_def c4_def
50 r2c1 r2c2 r2c3 c4_def
51 r3c1 r3c2 r3c3 r3c4
52 # Metadata from INFORMATION_SCHEMA.TABLES
53 NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS INITIAL_COLUMN_COUNTS CURRENT_COLUMN_COUNTS TOTAL_COLUMN_COUNTS
54 test/t1 7 2 0 4 4 4
55 # Metadata from INFORMATION_SCHEMA.COLUMNS
56 NAME POS MTYPE PRTYPE HAS_DEFAULT VERSION_ADDED VERSION_DROPPED
57 c1 0 13 16711934 0 0 0
58 c2 1 13 16711934 0 0 0
59 c3 2 13 16711934 1 0 0
60 c4 3 13 16711934 1 0 0
61 # DD Metadata of table
62 NAME SE_PRIVATE_DATA
63 t1 discard=0;instant_col=2;
64 # DD Metadata of columns in table
65 NAME ORDINAL_POSITION TYPE HAS_NO_DEFAULT HIDDEN SE_PRIVATE_DATA
66 c1 1 MYSQL_TYPE_STRING 0 Visible table_id=TABLE_ID;
67 c2 2 MYSQL_TYPE_STRING 0 Visible table_id=TABLE_ID;
68 c3 3 MYSQL_TYPE_STRING 0 Visible default=63335f64656620202020;table_id=TABLE_ID;
69 c4 4 MYSQL_TYPE_STRING 0 Visible default=63345f64656620202020;table_id=TABLE_ID;
70 DB_ROW_ID 5 MYSQL_TYPE_INT24 0 SE table_id=TABLE_ID;
71 DB_TRX_ID 6 MYSQL_TYPE_INT24 0 SE table_id=TABLE_ID;
72 DB_ROLL_PTR 7 MYSQL_TYPE_LONGLONG 0 SE table_id=TABLE_ID;
73 # Cleanup
74 DROP TABLE t1;
75 # ------------------------------------------------------------
76 # Scenario 2 : No INSTANT ADD/DROP. Column mismatch
77 # ------------------------------------------------------------
78 create table t1 (c1 char(10), c2 char(20), c3 char(10), c4 char(10)) row_format=compact;
79 # IMPORT
80 ALTER TABLE t1 DISCARD TABLESPACE;
81 # Copy cfg/ibd files from temp location
82 ALTER TABLE t1 IMPORT TABLESPACE;
83 ERROR HY000: Schema mismatch (Column c2 length mismatch.)
84 # Cleanup
85 DROP TABLE t1;
86 # ------------------------------------------------------------
87 # Scenario 3 : INSTANT ADD/DROP Columns in target table
88 # ------------------------------------------------------------
89 create table t1 (c1 char(10), c2 char(10)) row_format=compact;
90 ALTER TABLE t1 ADD COLUMN c3 char(10) DEFAULT "c3_def", ADD COLUMN c4 char(10) DEFAULT "c4_def", ALGORITHM=INSTANT;
91 # Metadata from INFORMATION_SCHEMA.TABLES
92 NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS INITIAL_COLUMN_COUNTS CURRENT_COLUMN_COUNTS TOTAL_COLUMN_COUNTS
93 test/t1 7 0 1 2 4 4
94 # Metadata from INFORMATION_SCHEMA.COLUMNS
95 NAME POS MTYPE PRTYPE HAS_DEFAULT VERSION_ADDED VERSION_DROPPED
96 c1 0 13 16711934 0 0 0
97 c2 1 13 16711934 0 0 0
98 c3 2 13 16711934 1 1 0
99 c4 3 13 16711934 1 1 0
100 # DD Metadata of table
101 NAME SE_PRIVATE_DATA
102 t1 NULL
103 # DD Metadata of columns in table
104 NAME ORDINAL_POSITION TYPE HAS_NO_DEFAULT HIDDEN SE_PRIVATE_DATA
105 c1 1 MYSQL_TYPE_STRING 0 Visible physical_pos=3;table_id=TABLE_ID;
106 c2 2 MYSQL_TYPE_STRING 0 Visible physical_pos=4;table_id=TABLE_ID;
107 c3 3 MYSQL_TYPE_STRING 0 Visible default=63335f64656620202020;physical_pos=5;table_id=TABLE_ID;version_added=1;
108 c4 4 MYSQL_TYPE_STRING 0 Visible default=63345f64656620202020;physical_pos=6;table_id=TABLE_ID;version_added=1;
109 DB_ROW_ID 5 MYSQL_TYPE_INT24 0 SE physical_pos=0;table_id=TABLE_ID;
110 DB_TRX_ID 6 MYSQL_TYPE_INT24 0 SE physical_pos=1;table_id=TABLE_ID;
111 DB_ROLL_PTR 7 MYSQL_TYPE_LONGLONG 0 SE physical_pos=2;table_id=TABLE_ID;
112 # IMPORT
113 ALTER TABLE t1 DISCARD TABLESPACE;
114 # Copy cfg/ibd files from temp location
115 ALTER TABLE t1 IMPORT TABLESPACE;
116 ERROR HY000: Schema mismatch (Target table has INSTANT columns but the .cfg file is from earlier release with INSTANT column in the source table. Instant metadata can't match. Please create target table with no INSTANT column and try IMPORT.)
117 # Cleanup
118 DROP TABLE t1;
119 # ------------------------------------------------------------
120 # Scenario 4 : INSTANT ADD/DROP. Column mismatch
121 # ------------------------------------------------------------
122 create table t1 (c1 char(10), c2 char(10)) row_format=compact;
123 ALTER TABLE t1 ADD COLUMN c3 char(20) DEFAULT "c3_def", ADD COLUMN c4 char(10) DEFAULT "c4_def", ALGORITHM=INSTANT;
124 # Metadata from INFORMATION_SCHEMA.TABLES
125 NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS INITIAL_COLUMN_COUNTS CURRENT_COLUMN_COUNTS TOTAL_COLUMN_COUNTS
126 test/t1 7 0 1 2 4 4
127 # Metadata from INFORMATION_SCHEMA.COLUMNS
128 NAME POS MTYPE PRTYPE HAS_DEFAULT VERSION_ADDED VERSION_DROPPED
129 c1 0 13 16711934 0 0 0
130 c2 1 13 16711934 0 0 0
131 c3 2 13 16711934 1 1 0
132 c4 3 13 16711934 1 1 0
133 # DD Metadata of table
134 NAME SE_PRIVATE_DATA
135 t1 NULL
136 # DD Metadata of columns in table
137 NAME ORDINAL_POSITION TYPE HAS_NO_DEFAULT HIDDEN SE_PRIVATE_DATA
138 c1 1 MYSQL_TYPE_STRING 0 Visible physical_pos=3;table_id=TABLE_ID;
139 c2 2 MYSQL_TYPE_STRING 0 Visible physical_pos=4;table_id=TABLE_ID;
140 c3 3 MYSQL_TYPE_STRING 0 Visible default=63335f6465662020202020202020202020202020;physical_pos=5;table_id=TABLE_ID;version_added=1;
141 c4 4 MYSQL_TYPE_STRING 0 Visible default=63345f64656620202020;physical_pos=6;table_id=TABLE_ID;version_added=1;
142 DB_ROW_ID 5 MYSQL_TYPE_INT24 0 SE physical_pos=0;table_id=TABLE_ID;
143 DB_TRX_ID 6 MYSQL_TYPE_INT24 0 SE physical_pos=1;table_id=TABLE_ID;
144 DB_ROLL_PTR 7 MYSQL_TYPE_LONGLONG 0 SE physical_pos=2;table_id=TABLE_ID;
145 # IMPORT
146 ALTER TABLE t1 DISCARD TABLESPACE;
147 # Copy cfg/ibd files from temp location
148 ALTER TABLE t1 IMPORT TABLESPACE;
149 ERROR HY000: Schema mismatch (Column c3 length mismatch.)
150 # Cleanup
151 DROP TABLE t1;
152 # ------------------------------------------------------------
153 # Scenario 5 : INSTANT ADD/DROP. Default value mismatch
154 # ------------------------------------------------------------
155 create table t1 (c1 char(10), c2 char(10)) row_format=compact;
156 ALTER TABLE t1 ADD COLUMN c3 char(10) DEFAULT "def_c3", ADD COLUMN c4 char(10) DEFAULT "c4_def", ALGORITHM=INSTANT;
157 # Metadata from INFORMATION_SCHEMA.TABLES
158 NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS INITIAL_COLUMN_COUNTS CURRENT_COLUMN_COUNTS TOTAL_COLUMN_COUNTS
159 test/t1 7 0 1 2 4 4
160 # Metadata from INFORMATION_SCHEMA.COLUMNS
161 NAME POS MTYPE PRTYPE HAS_DEFAULT VERSION_ADDED VERSION_DROPPED
162 c1 0 13 16711934 0 0 0
163 c2 1 13 16711934 0 0 0
164 c3 2 13 16711934 1 1 0
165 c4 3 13 16711934 1 1 0
166 # DD Metadata of table
167 NAME SE_PRIVATE_DATA
168 t1 NULL
169 # DD Metadata of columns in table
170 NAME ORDINAL_POSITION TYPE HAS_NO_DEFAULT HIDDEN SE_PRIVATE_DATA
171 c1 1 MYSQL_TYPE_STRING 0 Visible physical_pos=3;table_id=TABLE_ID;
172 c2 2 MYSQL_TYPE_STRING 0 Visible physical_pos=4;table_id=TABLE_ID;
173 c3 3 MYSQL_TYPE_STRING 0 Visible default=6465665f633320202020;physical_pos=5;table_id=TABLE_ID;version_added=1;
174 c4 4 MYSQL_TYPE_STRING 0 Visible default=63345f64656620202020;physical_pos=6;table_id=TABLE_ID;version_added=1;
175 DB_ROW_ID 5 MYSQL_TYPE_INT24 0 SE physical_pos=0;table_id=TABLE_ID;
176 DB_TRX_ID 6 MYSQL_TYPE_INT24 0 SE physical_pos=1;table_id=TABLE_ID;
177 DB_ROLL_PTR 7 MYSQL_TYPE_LONGLONG 0 SE physical_pos=2;table_id=TABLE_ID;
178 # IMPORT
179 ALTER TABLE t1 DISCARD TABLESPACE;
180 # Copy cfg/ibd files from temp location
181 ALTER TABLE t1 IMPORT TABLESPACE;
182 ERROR HY000: Schema mismatch (Target table has INSTANT columns but the .cfg file is from earlier release with INSTANT column in the source table. Instant metadata can't match. Please create target table with no INSTANT column and try IMPORT.)
183 # Cleanup
184 DROP TABLE t1;
185 ###########
186 # CLEANUP #
187 ###########