Debian Codegraph @

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

raw
1 # Scenario 1: Fixes bug 34736760
2 # 1.1: Redundant
3 CREATE TABLE t1_redundant (num INT PRIMARY KEY) ROW_FORMAT=REDUNDANT;
4 # Insert dummy data to increase time taken to complete ALTER rebuild
5 # Table is inserted with 1, 2, 3, .. , 1000000
6 SET SESSION cte_max_recursion_depth=10000000;
7 INSERT INTO t1_redundant WITH RECURSIVE v AS (SELECT 1 AS n UNION ALL SELECT n + 1 FROM v WHERE n <= 1000000) SELECT n FROM v;
8 ALTER TABLE t1_redundant ADD col INT DEFAULT 1, ALGORITHM=INSTANT;
9 SELECT * FROM t1_redundant LIMIT 15;
10 num col
11 1 1
12 2 1
13 3 1
14 4 1
15 5 1
16 6 1
17 7 1
18 8 1
19 9 1
20 10 1
21 11 1
22 12 1
23 13 1
24 14 1
25 15 1
26 # Prepare the new instant column
27 ALTER TABLE t1_redundant DROP PRIMARY KEY, ADD PRIMARY KEY (num, col);
28 # Run the DML in online
29 DELETE FROM t1_redundant WHERE num=1;
30 SELECT * FROM t1_redundant LIMIT 15;
31 num col
32 2 1
33 3 1
34 4 1
35 5 1
36 6 1
37 7 1
38 8 1
39 9 1
40 10 1
41 11 1
42 12 1
43 13 1
44 14 1
45 15 1
46 16 1
47 SHOW CREATE TABLE t1_redundant;
48 Table Create Table
49 t1_redundant CREATE TABLE `t1_redundant` (
50 `num` int NOT NULL,
51 `col` int NOT NULL DEFAULT '1',
52 PRIMARY KEY (`num`,`col`)
53 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=REDUNDANT
54 CHECK TABLE t1_redundant EXTENDED;
55 Table Op Msg_type Msg_text
56 test.t1_redundant check status OK
57 DROP TABLE t1_redundant;