You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug#30191523 : FLUSH TABLE T FOR EXPORT OR ALTER TABLE T2 IMPORT TABLESPACE
BROKEN IN 8.0.17
Issue:
The metadata required for INSTANT columns (like default values etc.) was
being written in CFG file and was being passed to destination. And there,
metadata (related to INSTANT columns) of destination table is updated with
the CFG information. But one piece of metadata was missing with respect to
INSTANT columns which is n_instant_nullable. This is the number of nullable
fields before the first INSTANT column was added in the table.
This information plays role in record size calculation on page. And it was
different in source and target table. Because of which record size on page
of target table Btree wasn't matching with the record size on page in IBD
files. Thus the index corruption was reported during page/record validation.
Fix:
During EXPORT, write this n_instant_nullable also in CFG file and during
IMPORT, read this information and while updating INSTANT information at
target, update this information as well.
RB : 23517
Reviewed by : Kevin Lewis <[email protected]>
CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, v1 VARCHAR(255));
597
+
ALTER TABLE t2 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT;
598
+
ALTER TABLE t2 DISCARD TABLESPACE;
599
+
# Copy CFG/IBD file from temp
600
+
# IMPORT should fail.
601
+
ALTER TABLE t2 IMPORT TABLESPACE;
602
+
ERROR HY000: Schema mismatch (The .cfg file indicates no INSTANT column in the source table whereas the metadata in data dictionary says there are instant columns in the target table)
603
+
DROP TABLE t2;
604
+
# Create table t2 with 2 INSTANTly added columns
605
+
CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY);
606
+
ALTER TABLE t2 ADD COLUMN v1 VARCHAR(255), ALGORITHM=INSTANT;
607
+
ALTER TABLE t2 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT;
608
+
ALTER TABLE t2 DISCARD TABLESPACE;
609
+
# Copy CFG/IBD file from temp
610
+
# IMPORT should fail.
611
+
ALTER TABLE t2 IMPORT TABLESPACE;
612
+
ERROR HY000: Schema mismatch (The .cfg file indicates no INSTANT column in the source table whereas the metadata in data dictionary says there are instant columns in the target table)
0 commit comments