File: bug33788578_release.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (57 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Scenario 1: Fixes bug 34736760
# 1.1: Redundant
CREATE TABLE t1_redundant (num INT PRIMARY KEY) ROW_FORMAT=REDUNDANT;
# Insert dummy data to increase time taken to complete ALTER rebuild
# Table is inserted with 1, 2, 3, .. , 1000000
SET SESSION cte_max_recursion_depth=10000000;
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;
ALTER TABLE t1_redundant ADD col INT DEFAULT 1, ALGORITHM=INSTANT;
SELECT * FROM t1_redundant LIMIT 15;
num	col
1	1
2	1
3	1
4	1
5	1
6	1
7	1
8	1
9	1
10	1
11	1
12	1
13	1
14	1
15	1
# Prepare the new instant column
ALTER TABLE t1_redundant DROP PRIMARY KEY, ADD PRIMARY KEY (num, col);
# Run the DML in online
DELETE FROM t1_redundant WHERE num=1;
SELECT * FROM t1_redundant LIMIT 15;
num	col
2	1
3	1
4	1
5	1
6	1
7	1
8	1
9	1
10	1
11	1
12	1
13	1
14	1
15	1
16	1
SHOW CREATE TABLE t1_redundant;
Table	Create Table
t1_redundant	CREATE TABLE `t1_redundant` (
  `num` int NOT NULL,
  `col` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`num`,`col`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=REDUNDANT
CHECK TABLE t1_redundant EXTENDED;
Table	Op	Msg_type	Msg_text
test.t1_redundant	check	status	OK
DROP TABLE t1_redundant;