diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-22 17:08:49 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-22 17:08:49 +0300 |
commit | 1657b7a583c62deb72267d485bfe201f43909e11 (patch) | |
tree | a750e2a44fdd296837b566623331e8a9a707d290 /mysql-test/main/sum_distinct-big.test | |
parent | cca75c95bc3c5d0d4a2efb920d3942da3e658654 (diff) | |
parent | 9868253b32877554a2707634dc6a6fd79c491053 (diff) | |
download | mariadb-git-1657b7a583c62deb72267d485bfe201f43909e11.tar.gz |
Merge 10.4 to 10.5
Diffstat (limited to 'mysql-test/main/sum_distinct-big.test')
-rw-r--r-- | mysql-test/main/sum_distinct-big.test | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/mysql-test/main/sum_distinct-big.test b/mysql-test/main/sum_distinct-big.test index 42eeae743b1..41aa5a44c19 100644 --- a/mysql-test/main/sum_distinct-big.test +++ b/mysql-test/main/sum_distinct-big.test @@ -21,32 +21,15 @@ set default_storage_engine=MYISAM; CREATE TABLE t1 (id INTEGER); CREATE TABLE t2 (id INTEGER); -INSERT INTO t1 (id) VALUES (1), (1), (1),(1); -INSERT INTO t1 (id) SELECT id FROM t1; /* 8 */ -INSERT INTO t1 (id) SELECT id FROM t1; /* 12 */ -INSERT INTO t1 (id) SELECT id FROM t1; /* 16 */ -INSERT INTO t1 (id) SELECT id FROM t1; /* 20 */ -INSERT INTO t1 (id) SELECT id FROM t1; /* 24 */ -INSERT INTO t1 SELECT id+1 FROM t1; -INSERT INTO t1 SELECT id+2 FROM t1; -INSERT INTO t1 SELECT id+4 FROM t1; -INSERT INTO t1 SELECT id+8 FROM t1; -INSERT INTO t1 SELECT id+16 FROM t1; -INSERT INTO t1 SELECT id+32 FROM t1; -INSERT INTO t1 SELECT id+64 FROM t1; -INSERT INTO t1 SELECT id+128 FROM t1; -INSERT INTO t1 SELECT id+256 FROM t1; -INSERT INTO t1 SELECT id+512 FROM t1; +INSERT INTO t1 SELECT b.seq FROM seq_1_to_128,seq_1_to_1024 b; # Just test that AVG(DISTINCT) is there SELECT AVG(DISTINCT id) FROM t1 GROUP BY id % 13; SELECT SUM(DISTINCT id)/COUNT(DISTINCT id) FROM t1 GROUP BY id % 13; -INSERT INTO t1 SELECT id+1024 FROM t1; -INSERT INTO t1 SELECT id+2048 FROM t1; -INSERT INTO t1 SELECT id+4096 FROM t1; -INSERT INTO t1 SELECT id+8192 FROM t1; -INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand(); +INSERT INTO t1 SELECT b.seq FROM seq_1_to_128,seq_1025_to_16384 b; +INSERT INTO t2 SELECT b.seq FROM seq_1_to_128 a,seq_1_to_16384 b +ORDER by (a.seq*0+b.seq)*rand(); # SELECT '++++++++++++++++++++++++++++++++++++++++++++++++++'; @@ -76,9 +59,10 @@ SELECT SUM(DISTINCT id) sm FROM t1 GROUP BY id % 13; SET max_heap_table_size=default; -INSERT INTO t1 SELECT id+16384 FROM t1; -DELETE FROM t2; -INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand(); +INSERT INTO t1 SELECT b.seq FROM seq_1_to_128,seq_16385_to_32768 b; +TRUNCATE t2; +INSERT INTO t2 SELECT b.seq FROM seq_1_to_128 a,seq_1_to_32768 b +ORDER BY (a.seq*0+b.seq)*rand(); SELECT SUM(DISTINCT id) sm FROM t2; |