| 1 |
# Test to check error message printed if both INSTANT and VERSION bits |
| 2 |
# are found set in record. This repro follows bug33788578 which will |
| 3 |
# come to the corresponding code path |
| 4 |
CREATE TABLE t1 (a TEXT) ENGINE=INNODB; |
| 5 |
INSERT INTO t1 (a) VALUES ('foo'); |
| 6 |
ALTER TABLE t1 ADD COLUMN b INT DEFAULT 0, algorithm=instant; |
| 7 |
SELECT * FROM t1; |
| 8 |
a b |
| 9 |
foo 0 |
| 10 |
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL update_now WAIT_FOR update_done'; |
| 11 |
ALTER TABLE t1 ADD PRIMARY KEY (b); |
| 12 |
SET DEBUG_SYNC='now WAIT_FOR update_now'; |
| 13 |
# Metadata from INFORMATION_SCHEMA.TABLES |
| 14 |
NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS |
| 15 |
test/t1 5 0 1 |
| 16 |
# Metadata from INFORMATION_SCHEMA.COLUMNS |
| 17 |
NAME POS MTYPE PRTYPE HAS_DEFAULT |
| 18 |
a 0 5 16711932 0 |
| 19 |
b 1 6 1027 1 |
| 20 |
SELECT * FROM t1; |
| 21 |
a b |
| 22 |
foo 0 |
| 23 |
SHOW CREATE TABLE t1; |
| 24 |
Table Create Table |
| 25 |
t1 CREATE TABLE `t1` ( |
| 26 |
`a` text, |
| 27 |
`b` int DEFAULT '0' |
| 28 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 29 |
CHECK TABLE t1; |
| 30 |
Table Op Msg_type Msg_text |
| 31 |
test.t1 check status OK |
| 32 |
# Simulate both record and instant bits set when reading record |
| 33 |
SET DEBUG = '+d,innodb_rec_instant_version_bit_set'; |
| 34 |
UPDATE t1 SET b = 1; |
| 35 |
SET DEBUG = '-d,ER_IB_REC_INSTANT_VERSION_BIT_SET'; |
| 36 |
# Metadata from INFORMATION_SCHEMA.TABLES |
| 37 |
NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS |
| 38 |
test/t1 5 0 1 |
| 39 |
# Metadata from INFORMATION_SCHEMA.COLUMNS |
| 40 |
NAME POS MTYPE PRTYPE HAS_DEFAULT |
| 41 |
a 0 5 16711932 0 |
| 42 |
b 1 6 1027 1 |
| 43 |
SELECT * FROM t1; |
| 44 |
a b |
| 45 |
foo 1 |
| 46 |
SHOW CREATE TABLE t1; |
| 47 |
Table Create Table |
| 48 |
t1 CREATE TABLE `t1` ( |
| 49 |
`a` text, |
| 50 |
`b` int DEFAULT '0' |
| 51 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 52 |
CHECK TABLE t1; |
| 53 |
Table Op Msg_type Msg_text |
| 54 |
test.t1 check status OK |
| 55 |
SET DEBUG_SYNC='now SIGNAL update_done'; |
| 56 |
# Metadata from INFORMATION_SCHEMA.TABLES |
| 57 |
NAME N_COLS INSTANT_COLS TOTAL_ROW_VERSIONS |
| 58 |
test/t1 5 0 0 |
| 59 |
# Metadata from INFORMATION_SCHEMA.COLUMNS |
| 60 |
NAME POS MTYPE PRTYPE HAS_DEFAULT |
| 61 |
a 0 5 16711932 0 |
| 62 |
b 1 6 1283 0 |
| 63 |
SELECT * FROM t1; |
| 64 |
a b |
| 65 |
foo 1 |
| 66 |
SHOW CREATE TABLE t1; |
| 67 |
Table Create Table |
| 68 |
t1 CREATE TABLE `t1` ( |
| 69 |
`a` text, |
| 70 |
`b` int NOT NULL DEFAULT '0', |
| 71 |
PRIMARY KEY (`b`) |
| 72 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 73 |
CHECK TABLE t1; |
| 74 |
Table Op Msg_type Msg_text |
| 75 |
test.t1 check status OK |
| 76 |
# Expect found |
| 77 |
Pattern "Record has both instant and version bit set in Table" found |
| 78 |
DROP TABLE t1; |