Skip to content

Commit 574ff87

Browse files
committed
Merge 10.1 into 10.2
2 parents 102bc7b + 516f7c1 commit 574ff87

File tree

2 files changed

+17
-71
lines changed

2 files changed

+17
-71
lines changed

mysql-test/r/sum_distinct-big.result

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
DROP TABLE IF EXISTS t1, t2;
21
set @save_tmp_table_size=@@tmp_table_size;
32
set @save_max_heap_table_size=@@max_heap_table_size;
4-
set @save_storage_engine=@@storage_engine;
53
set storage_engine=MYISAM;
64
CREATE TABLE t1 (id INTEGER);
75
CREATE TABLE t2 (id INTEGER);
@@ -126,35 +124,13 @@ DROP TABLE t1;
126124
DROP TABLE t2;
127125
SET @@tmp_table_size=@save_tmp_table_size;
128126
SET @@max_heap_table_size=@save_max_heap_table_size;
129-
#
130-
# Bug mdev-4311: COUNT(DISTINCT...) requiring a file for Unique
131-
# (bug #68749)
132-
#
133-
set @save_storage_engine=@@storage_engine;
134-
set storage_engine=INNODB;
135-
CREATE TABLE t1 (id INTEGER) ENGINE=InnoDB;
127+
#
128+
# MDEV-4311: COUNT(DISTINCT...) requiring a file for UNIQUE (bug #68749)
129+
#
136130
CREATE TABLE t2 (id INTEGER) ENGINE=InnoDB;
137-
INSERT INTO t1 (id) VALUES (1), (1), (1),(1);
138-
INSERT INTO t1 (id) SELECT id FROM t1;
139-
INSERT INTO t1 (id) SELECT id FROM t1;
140-
INSERT INTO t1 (id) SELECT id FROM t1;
141-
INSERT INTO t1 (id) SELECT id FROM t1;
142-
INSERT INTO t1 (id) SELECT id FROM t1;
143-
INSERT INTO t1 SELECT id+1 FROM t1;
144-
INSERT INTO t1 SELECT id+2 FROM t1;
145-
INSERT INTO t1 SELECT id+4 FROM t1;
146-
INSERT INTO t1 SELECT id+8 FROM t1;
147-
INSERT INTO t1 SELECT id+16 FROM t1;
148-
INSERT INTO t1 SELECT id+32 FROM t1;
149-
INSERT INTO t1 SELECT id+64 FROM t1;
150-
INSERT INTO t1 SELECT id+128 FROM t1;
151-
INSERT INTO t1 SELECT id+256 FROM t1;
152-
INSERT INTO t1 SELECT id+512 FROM t1;
153-
INSERT INTO t1 SELECT id+1024 FROM t1;
154-
INSERT INTO t1 SELECT id+2048 FROM t1;
155-
INSERT INTO t1 SELECT id+4096 FROM t1;
156-
INSERT INTO t1 SELECT id+8192 FROM t1;
157-
INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand();
131+
BEGIN;
132+
INSERT INTO t2 SELECT b.seq FROM seq_1_to_128 a, seq_1_to_16384 b
133+
ORDER BY b.seq*rand();
158134
INSERT INTO t2 VALUE(NULL);
159135
# With default tmp_table_size / max_heap_table_size
160136
SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2;
@@ -176,5 +152,5 @@ SET @@max_heap_table_size=@save_max_heap_table_size;
176152
SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2;
177153
sm
178154
16384
179-
DROP TABLE t1,t2;
180-
set storage_engine=@save_storage_engine;
155+
COMMIT;
156+
DROP TABLE t2;

mysql-test/t/sum_distinct-big.test

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
--source include/big_test.inc
66
--source include/have_innodb.inc
7-
--disable_warnings
8-
DROP TABLE IF EXISTS t1, t2;
9-
--enable_warnings
7+
--source include/have_sequence.inc
108

119
set @save_tmp_table_size=@@tmp_table_size;
1210
set @save_max_heap_table_size=@@max_heap_table_size;
1311

14-
set @save_storage_engine=@@storage_engine;
15-
1612
#
1713
# Test the case when distinct values doesn't fit in memory and
1814
# filesort is used (see uniques.cc:merge_walk)
@@ -94,39 +90,14 @@ DROP TABLE t2;
9490
SET @@tmp_table_size=@save_tmp_table_size;
9591
SET @@max_heap_table_size=@save_max_heap_table_size;
9692

97-
--echo #
98-
--echo # Bug mdev-4311: COUNT(DISTINCT...) requiring a file for Unique
99-
--echo # (bug #68749)
100-
--echo #
101-
102-
set @save_storage_engine=@@storage_engine;
103-
set storage_engine=INNODB;
104-
105-
CREATE TABLE t1 (id INTEGER) ENGINE=InnoDB;
93+
--echo #
94+
--echo # MDEV-4311: COUNT(DISTINCT...) requiring a file for UNIQUE (bug #68749)
95+
--echo #
10696
CREATE TABLE t2 (id INTEGER) ENGINE=InnoDB;
10797

108-
INSERT INTO t1 (id) VALUES (1), (1), (1),(1);
109-
INSERT INTO t1 (id) SELECT id FROM t1;
110-
INSERT INTO t1 (id) SELECT id FROM t1;
111-
INSERT INTO t1 (id) SELECT id FROM t1;
112-
INSERT INTO t1 (id) SELECT id FROM t1;
113-
INSERT INTO t1 (id) SELECT id FROM t1;
114-
INSERT INTO t1 SELECT id+1 FROM t1;
115-
INSERT INTO t1 SELECT id+2 FROM t1;
116-
INSERT INTO t1 SELECT id+4 FROM t1;
117-
INSERT INTO t1 SELECT id+8 FROM t1;
118-
INSERT INTO t1 SELECT id+16 FROM t1;
119-
INSERT INTO t1 SELECT id+32 FROM t1;
120-
INSERT INTO t1 SELECT id+64 FROM t1;
121-
INSERT INTO t1 SELECT id+128 FROM t1;
122-
INSERT INTO t1 SELECT id+256 FROM t1;
123-
INSERT INTO t1 SELECT id+512 FROM t1;
124-
INSERT INTO t1 SELECT id+1024 FROM t1;
125-
INSERT INTO t1 SELECT id+2048 FROM t1;
126-
INSERT INTO t1 SELECT id+4096 FROM t1;
127-
INSERT INTO t1 SELECT id+8192 FROM t1;
128-
129-
INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand();
98+
BEGIN;
99+
INSERT INTO t2 SELECT b.seq FROM seq_1_to_128 a, seq_1_to_16384 b
100+
ORDER BY b.seq*rand();
130101
INSERT INTO t2 VALUE(NULL);
131102

132103
--echo # With default tmp_table_size / max_heap_table_size
@@ -147,7 +118,6 @@ SET @@max_heap_table_size=@save_max_heap_table_size;
147118

148119
--echo # Back to default tmp_table_size / max_heap_table_size
149120
SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2;
121+
COMMIT;
150122

151-
DROP TABLE t1,t2;
152-
153-
set storage_engine=@save_storage_engine;
123+
DROP TABLE t2;

0 commit comments

Comments
 (0)