File: end_range_check_2.test

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 (125 lines) | stat: -rw-r--r-- 3,019 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
--source include/have_innodb_16k.inc
--source include/have_debug.inc

--echo #
--echo # Bug #26300119	ASSERTION IN PREBUILT->TRX->ISOLATION_LEVEL == TRX_ISO_READ_UNCOMMITTED
--echo #

connect (con1,localhost,root,,);
connect (con2,localhost,root,,);

DELIMITER |;
CREATE PROCEDURE populate_t1(IN BASE INT, IN SIZE INT)
BEGIN
        DECLARE i INT DEFAULT BASE;
        WHILE (i <= SIZE) DO
                INSERT INTO t1 VALUES  (i, repeat('10101010101010101010',2000));
                SET i = i + 1;
        END WHILE;
END|
DELIMITER ;|

CREATE TABLE t1 (
        pk int,
        col_blob_key blob,
        primary key (pk)
);

CALL populate_t1(1, 100);

connection con1;
START TRANSACTION;
CALL populate_t1(101, 199);
SET DEBUG_SYNC='before_insertion_of_blob SIGNAL halted_insert WAIT_FOR proceed';
--send INSERT INTO t1 VALUES (200, repeat('10101010101010101010',2000));

connection con2;
SET DEBUG_SYNC='now WAIT_FOR halted_insert';
SET DEBUG_SYNC='allow_insert SIGNAL proceed';
--disable_result_log
SELECT pk, col_blob_key FROM t1 WHERE pk between 99 and 100;
--enable_result_log

connection con1;
--reap
COMMIT;

connection default;
disconnect con1;
disconnect con2;

SET DEBUG_SYNC='RESET';
DROP PROCEDURE populate_t1;
DROP TABLE t1;

--echo #
--echo # Bug#32291506 ASSERTION FAILURE: ROW0SEL.CC: MYSQL_COL_LEN == LEN
--echo #

CREATE TABLE t1 (
  c0 int,
  c1 char(200) CHARACTER SET utf32,
  c2 int GENERATED ALWAYS AS (c1) VIRTUAL,
  c3 int,
  PRIMARY KEY (c0, c1),
  KEY i1 (c2, c1(1))
);

INSERT  INTO t1(c0,c1,c3) VALUES (1,'1',1);

START TRANSACTION;

DELETE FROM t1;

SET DEBUG = "+d, compare_end_range";

--echo # No lock Range select with KEY i1 and end range check
SELECT * FROM t1  WHERE c2 < 0;

--echo # X lock Range select with KEY i1 and end range check
DELETE FROM t1  WHERE c2 < 0;

SET DEBUG = "-d, compare_end_range";

COMMIT;

DROP TABLE t1;

--echo #
--echo # Bug#33384537 prebuilt->m_end_range should be reset at fetch_cache initializing at row_search_mvcc()
--echo #

create table t10 (i int);
insert into t10 values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);

create table t1000 (i int);
insert into t1000 select a.i + b.i*10 + c.i*100 from t10 a, t10 b, t10 c;

create table t (i int, j int, k int, primary key(k, j, i), key(i, j, k));

insert into t select 1, 1, i from t10;
insert into t select 1, 2, i from t10;
insert into t select 2, 1, i from t10;
insert into t select 2, 2, i from t10;
insert into t select 3, 1, i from t10;
insert into t select 3, 2, i from t10;

begin;
select * from t where i = 4;

connect (con1,localhost,root,,);
connection con1;

insert into t select 1, 1, i+10 from t1000 limit 400;
insert into t select 1, 2, i+10 from t1000;
insert into t select 2, 1, i+10 from t1000;
insert into t select 2, 2, i+10 from t1000;
insert into t select 3, 1, i+10 from t1000;
insert into t select 3, 2, i+10 from t1000;

connection default;

select /*+ SKIP_SCAN(t i) */ * from t where k > 2 and k < 8 order by i, j, k;

drop table t, t10, t1000;
disconnect con1;