Skip to content

Commit 55c75b6

Browse files
committed
Merge 10.3 into 10.4
2 parents 36824d2 + 8e3d85e commit 55c75b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+757
-640
lines changed

mysql-test/include/index_merge1.inc

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#
33
# Index merge tests
44
#
5-
# The variables
6-
# $engine_type -- storage engine to be tested
5+
# The variable
76
# $merge_table_support -- 1 storage engine supports merge tables
87
# -- 0 storage engine does not support merge tables
9-
# have to be set before sourcing this script.
8+
# has to be set before sourcing this script.
109
#
1110
# Note: The comments/expectations refer to MyISAM.
1211
# They might be not valid for other storage engines.
@@ -16,36 +15,18 @@
1615
# old name was t/index_merge.test
1716
# main code went into include/index_merge1.inc
1817
#
18+
--source include/have_sequence.inc
1919

2020
--echo #---------------- Index merge test 1 -------------------------------------------
2121

22-
eval SET SESSION STORAGE_ENGINE = $engine_type;
23-
24-
--disable_warnings
25-
drop table if exists t0, t1, t2, t3, t4;
26-
--enable_warnings
27-
2822
# Create and fill a table with simple keys
2923
create table t0
3024
(
3125
key1 int not null,
3226
INDEX i1(key1)
3327
);
3428

35-
--disable_query_log
36-
insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
37-
38-
let $1=7;
39-
set @d=8;
40-
begin;
41-
while ($1)
42-
{
43-
eval insert into t0 select key1+@d from t0;
44-
eval set @d=@d*2;
45-
dec $1;
46-
}
47-
commit;
48-
--enable_query_log
29+
insert into t0(key1) select seq from seq_1_to_1024;
4930

5031
alter table t0 add key2 int not null, add index i2(key2);
5132
alter table t0 add key3 int not null, add index i3(key3);
@@ -220,7 +201,7 @@ create table t4 (
220201
index i2_2(key2, key2_1)
221202
);
222203

223-
insert into t4 select key1,key1,key1 div 10, key1 % 10, key1 % 10, key1 from t0;
204+
insert into t4 select seq,seq,seq div 10, seq % 10, seq % 10, seq from seq_1_to_1024;
224205

225206
# the following will be handled by index_merge:
226207
select * from t4 where key1a = 3 or key1b = 4;
@@ -395,14 +376,13 @@ if ($merge_table_support)
395376
#
396377
# BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables
397378
#
398-
create table t0 (a int);
399-
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
400379
create table t1 (
401380
a int, b int,
402381
filler1 char(200), filler2 char(200),
403382
key(a),key(b)
404383
);
405-
insert into t1 select @v:= A.a, @v, 't1', 'filler2' from t0 A, t0 B, t0 C;
384+
insert into t1 select @v:= seq % 10, @v, 't1', 'filler2' from seq_1_to_1000;
385+
406386
create table t2 like t1;
407387

408388
create table t3 (
@@ -416,8 +396,7 @@ explain select * from t1 where a=1 and b=1;
416396
--replace_column 9 #
417397
explain select * from t3 where a=1 and b=1;
418398

419-
drop table t3;
420-
drop table t0, t1, t2;
399+
drop table t1, t2, t3;
421400
}
422401

423402
#
@@ -517,16 +496,13 @@ DROP TABLE t1;
517496
--echo #
518497
--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
519498
--echo #
520-
create table t0 (a int);
521-
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
522-
523499
create table t1 (a int);
524500
insert into t1 values (1),(2);
525501
create table t2(a int, b int);
526502
insert into t2 values (1,1), (2, 1000);
527503
create table t3 (a int, b int, filler char(100), key(a), key(b));
528504

529-
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
505+
insert into t3 select 1000, 1000,'filler' from seq_1_to_1000;
530506
insert into t3 values (1,1,'data');
531507
insert into t3 values (1,1,'data');
532508
-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
@@ -538,20 +514,14 @@ select * from t1
538514
where exists (select 1 from t2, t3
539515
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
540516

541-
drop table t0, t1, t2, t3;
517+
drop table t1, t2, t3;
542518

543519
--echo #
544520
--echo # BUG#44810: index merge and order by with low sort_buffer_size
545521
--echo # crashes server!
546522
--echo #
547523
CREATE TABLE t1(a VARCHAR(128),b VARCHAR(128),KEY(A),KEY(B));
548-
INSERT INTO t1 VALUES (REPEAT('a',128),REPEAT('b',128));
549-
INSERT INTO t1 SELECT * FROM t1;
550-
INSERT INTO t1 SELECT * FROM t1;
551-
INSERT INTO t1 SELECT * FROM t1;
552-
INSERT INTO t1 SELECT * FROM t1;
553-
INSERT INTO t1 SELECT * FROM t1;
554-
INSERT INTO t1 SELECT * FROM t1;
524+
INSERT INTO t1 SELECT REPEAT('a',128),REPEAT('b',128) FROM seq_1_to_64;
555525
SET SESSION sort_buffer_size=1024*8;
556526
EXPLAIN
557527
SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%'

mysql-test/include/index_merge2.inc

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
#
33
# Index merge tests
44
#
5-
# The variable
6-
# $engine_type -- storage engine to be tested
7-
# has to be set before sourcing this script.
8-
#
95
# Note: The comments/expectations refer to InnoDB.
106
# They might be not valid for other storage engines.
117
#
@@ -14,15 +10,10 @@
1410
# old name was t/index_merge_innodb.test
1511
# main code went into include/index_merge2.inc
1612
#
13+
--source include/have_sequence.inc
1714

1815
--echo #---------------- Index merge test 2 -------------------------------------------
1916

20-
eval SET SESSION STORAGE_ENGINE = $engine_type;
21-
22-
--disable_warnings
23-
drop table if exists t1,t2;
24-
--enable_warnings
25-
2617
create table t1
2718
(
2819
key1 int not null,
@@ -32,16 +23,7 @@ create table t1
3223
INDEX i2(key2)
3324
);
3425

35-
--disable_query_log
36-
let $1=200;
37-
begin;
38-
while ($1)
39-
{
40-
eval insert into t1 values (200-$1, $1);
41-
dec $1;
42-
}
43-
commit;
44-
--enable_query_log
26+
INSERT INTO t1 SELECT seq,200-seq FROM seq_0_to_200;
4527

4628
# No primary key
4729
explain select * from t1 where key1 < 5 or key2 > 197;
@@ -80,16 +62,8 @@ create table t1 (
8062
index (key2)
8163
);
8264
show warnings;
83-
--disable_query_log
84-
let $1=30;
85-
begin;
86-
while ($1)
87-
{
88-
eval insert into t1 (key1, key2, filler) values ($1/4, $1/8, 'filler-data');
89-
dec $1;
90-
}
91-
commit;
92-
--enable_query_log
65+
INSERT INTO t1 (key1, key2, filler)
66+
SELECT seq/4, seq/8, 'filler-data' FROM seq_30_to_0;
9367
explain select pk from t1 where key1 = 1 and key2 = 1;
9468
select pk from t1 where key2 = 1 and key1 = 1;
9569
select pk from t1 ignore index(key1,key2) where key2 = 1 and key1 = 1;
@@ -331,19 +305,7 @@ create table t1
331305
key3 int not null default 0
332306
);
333307

334-
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
335-
336-
let $1=7;
337-
set @d=8;
338-
begin;
339-
while ($1)
340-
{
341-
eval insert into t1 (key1) select key1+@d from t1;
342-
eval set @d=@d*2;
343-
dec $1;
344-
}
345-
commit;
346-
308+
insert into t1(key1) select seq from seq_1_to_1024;
347309
alter table t1 add index i2(key2);
348310
alter table t1 add index i3(key3);
349311
update t1 set key2=key1,key3=key1;

mysql-test/include/index_merge_2sweeps.inc

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,15 @@
22
#
33
# 2-sweeps read Index_merge test
44
#
5-
# The variable
6-
# $engine_type -- storage engine to be tested
7-
# has to be set before sourcing this script.
8-
#
95
# Last update:
106
# 2006-08-02 ML test refactored
117
# old name was index_merge_innodb2.test
128
# main code went into include/index_merge_2sweeps.inc
139
#
10+
--source include/have_sequence.inc
1411

1512
--echo #---------------- 2-sweeps read Index merge test 2 -------------------------------
1613

17-
eval SET SESSION STORAGE_ENGINE = $engine_type;
18-
19-
--disable_warnings
20-
drop table if exists t1;
21-
--enable_warnings
22-
2314
create table t1 (
2415
pk int primary key,
2516
key1 int,
@@ -30,17 +21,8 @@ create table t1 (
3021
index(key2)
3122
);
3223

33-
34-
--disable_query_log
35-
begin;
36-
let $1=1000;
37-
while ($1)
38-
{
39-
eval insert into t1 values($1, $1, $1, 'filler-data','filler-data-2');
40-
dec $1;
41-
}
42-
commit;
43-
--enable_query_log
24+
insert into t1 select seq, seq, seq, 'filler-data', 'filler-data-2'
25+
from seq_1000_to_1;
4426

4527
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
4628

mysql-test/include/index_merge_ror.inc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
--echo #---------------- ROR-index_merge tests -----------------------
1919

20-
eval SET SESSION STORAGE_ENGINE = $engine_type;
21-
22-
--disable_warnings
23-
drop table if exists t0,t1,t2;
24-
--enable_warnings
2520
create table t1
2621
(
2722
/* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */

mysql-test/include/index_merge_ror_cpk.inc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
#
33
# Clustered PK ROR-index_merge tests
44
#
5-
# The variable
6-
# $engine_type -- storage engine to be tested
7-
# has to be set before sourcing this script.
8-
#
95
# Note: The comments/expectations refer to InnoDB.
106
# They might be not valid for other storage engines.
117
#
@@ -15,13 +11,9 @@
1511
# main code went into include/index_merge_ror_cpk.inc
1612
#
1713

18-
--echo #---------------- Clustered PK ROR-index_merge tests -----------------------------
19-
20-
eval SET SESSION STORAGE_ENGINE = $engine_type;
14+
--source include/have_sequence.inc
2115

22-
--disable_warnings
23-
drop table if exists t1;
24-
--enable_warnings
16+
--echo #---------------- Clustered PK ROR-index_merge tests -----------------------------
2517

2618
create table t1
2719
(

mysql-test/main/drop_bad_db_type.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SET @save_dbug = @@debug_dbug;
12
set debug_dbug='+d,unstable_db_type';
23
install soname 'ha_archive';
34
create table t1 (a int) engine=archive;
@@ -32,4 +33,4 @@ t1.frm
3233
drop table t1;
3334
db.opt
3435
uninstall soname 'ha_archive';
35-
set debug_dbug='-d,unstable_db_type';
36+
set debug_dbug=@save_dbug;

mysql-test/main/drop_bad_db_type.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if (!$HA_ARCHIVE_SO) {
77

88
let $mysqld_datadir= `select @@datadir`;
99

10+
SET @save_dbug = @@debug_dbug;
1011
set debug_dbug='+d,unstable_db_type';
1112

1213
install soname 'ha_archive';
@@ -27,5 +28,4 @@ drop table t1;
2728
--list_files $mysqld_datadir/test
2829
uninstall soname 'ha_archive';
2930

30-
set debug_dbug='-d,unstable_db_type';
31-
31+
set debug_dbug=@save_dbug;

0 commit comments

Comments
 (0)