Debian Codegraph @

mysql-test/suite/innodb/t/end_range_check_2.test

raw
1 --source include/have_innodb_16k.inc
2 --source include/have_debug.inc
3
4 --echo #
5 --echo # Bug #26300119 ASSERTION IN PREBUILT->TRX->ISOLATION_LEVEL == TRX_ISO_READ_UNCOMMITTED
6 --echo #
7
8 connect (con1,localhost,root,,);
9 connect (con2,localhost,root,,);
10
11 DELIMITER |;
12 CREATE PROCEDURE populate_t1(IN BASE INT, IN SIZE INT)
13 BEGIN
14 DECLARE i INT DEFAULT BASE;
15 WHILE (i <= SIZE) DO
16 INSERT INTO t1 VALUES (i, repeat('10101010101010101010',2000));
17 SET i = i + 1;
18 END WHILE;
19 END|
20 DELIMITER ;|
21
22 CREATE TABLE t1 (
23 pk int,
24 col_blob_key blob,
25 primary key (pk)
26 );
27
28 CALL populate_t1(1, 100);
29
30 connection con1;
31 START TRANSACTION;
32 CALL populate_t1(101, 199);
33 SET DEBUG_SYNC='before_insertion_of_blob SIGNAL halted_insert WAIT_FOR proceed';
34 --send INSERT INTO t1 VALUES (200, repeat('10101010101010101010',2000));
35
36 connection con2;
37 SET DEBUG_SYNC='now WAIT_FOR halted_insert';
38 SET DEBUG_SYNC='allow_insert SIGNAL proceed';
39 --disable_result_log
40 SELECT pk, col_blob_key FROM t1 WHERE pk between 99 and 100;
41 --enable_result_log
42
43 connection con1;
44 --reap
45 COMMIT;
46
47 connection default;
48 disconnect con1;
49 disconnect con2;
50
51 SET DEBUG_SYNC='RESET';
52 DROP PROCEDURE populate_t1;
53 DROP TABLE t1;
54
55 --echo #
56 --echo # Bug#32291506 ASSERTION FAILURE: ROW0SEL.CC: MYSQL_COL_LEN == LEN
57 --echo #
58
59 CREATE TABLE t1 (
60 c0 int,
61 c1 char(200) CHARACTER SET utf32,
62 c2 int GENERATED ALWAYS AS (c1) VIRTUAL,
63 c3 int,
64 PRIMARY KEY (c0, c1),
65 KEY i1 (c2, c1(1))
66 );
67
68 INSERT INTO t1(c0,c1,c3) VALUES (1,'1',1);
69
70 START TRANSACTION;
71
72 DELETE FROM t1;
73
74 SET DEBUG = "+d, compare_end_range";
75
76 --echo # No lock Range select with KEY i1 and end range check
77 SELECT * FROM t1 WHERE c2 < 0;
78
79 --echo # X lock Range select with KEY i1 and end range check
80 DELETE FROM t1 WHERE c2 < 0;
81
82 SET DEBUG = "-d, compare_end_range";
83
84 COMMIT;
85
86 DROP TABLE t1;
87
88 --echo #
89 --echo # Bug#33384537 prebuilt->m_end_range should be reset at fetch_cache initializing at row_search_mvcc()
90 --echo #
91
92 create table t10 (i int);
93 insert into t10 values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
94
95 create table t1000 (i int);
96 insert into t1000 select a.i + b.i*10 + c.i*100 from t10 a, t10 b, t10 c;
97
98 create table t (i int, j int, k int, primary key(k, j, i), key(i, j, k));
99
100 insert into t select 1, 1, i from t10;
101 insert into t select 1, 2, i from t10;
102 insert into t select 2, 1, i from t10;
103 insert into t select 2, 2, i from t10;
104 insert into t select 3, 1, i from t10;
105 insert into t select 3, 2, i from t10;
106
107 begin;
108 select * from t where i = 4;
109
110 connect (con1,localhost,root,,);
111 connection con1;
112
113 insert into t select 1, 1, i+10 from t1000 limit 400;
114 insert into t select 1, 2, i+10 from t1000;
115 insert into t select 2, 1, i+10 from t1000;
116 insert into t select 2, 2, i+10 from t1000;
117 insert into t select 3, 1, i+10 from t1000;
118 insert into t select 3, 2, i+10 from t1000;
119
120 connection default;
121
122 select /*+ SKIP_SCAN(t i) */ * from t where k > 2 and k < 8 order by i, j, k;
123
124 drop table t, t10, t1000;
125 disconnect con1;