4
4
5
5
--source include/big_test.inc
6
6
--source include/have_innodb.inc
7
- --disable_warnings
8
- DROP TABLE IF EXISTS t1, t2;
9
- --enable_warnings
7
+ --source include/have_sequence.inc
10
8
11
9
set @save_tmp_table_size=@@tmp_table_size;
12
10
set @save_max_heap_table_size=@@max_heap_table_size;
13
11
14
- set @save_storage_engine=@@storage_engine;
15
-
16
12
#
17
13
# Test the case when distinct values doesn't fit in memory and
18
14
# filesort is used (see uniques.cc:merge_walk)
@@ -94,39 +90,14 @@ DROP TABLE t2;
94
90
SET @@tmp_table_size=@save_tmp_table_size;
95
91
SET @@max_heap_table_size=@save_max_heap_table_size;
96
92
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 #
106
96
CREATE TABLE t2 (id INTEGER) ENGINE=InnoDB;
107
97
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();
130
101
INSERT INTO t2 VALUE(NULL);
131
102
132
103
--echo # With default tmp_table_size / max_heap_table_size
@@ -147,7 +118,6 @@ SET @@max_heap_table_size=@save_max_heap_table_size;
147
118
148
119
--echo # Back to default tmp_table_size / max_heap_table_size
149
120
SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2;
121
+ COMMIT;
150
122
151
- DROP TABLE t1,t2;
152
-
153
- set storage_engine=@save_storage_engine;
123
+ DROP TABLE t2;
0 commit comments