Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.28a, 5.3.11, 5.2.13, 5.1.67
-
None
Description
CREATE TABLE t1 (id INTEGER); |
CREATE TABLE t2 (id INTEGER); |
INSERT INTO t1 VALUES (1), (1), (1),(1); |
INSERT INTO t1 SELECT id FROM t1; |
INSERT INTO t1 SELECT id FROM t1; |
INSERT INTO t1 SELECT id FROM t1; |
INSERT INTO t1 SELECT id FROM t1; |
INSERT INTO t1 SELECT id FROM t1; |
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 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(); |
SELECT SUM(DISTINCT id) sm FROM t2; |
SET max_heap_table_size=16384; |
SHOW variables LIKE 'max_heap_table_size'; |
SELECT SUM(DISTINCT id) sm FROM t2; |
DROP TABLE t1; |
DROP TABLE t2; |
second SUM(DISTINCT) returns NULL
Attachments
Issue Links
- relates to
-
MDEV-4311 Wrong result of COUNT(distinct) with low tmp_table_size / max_heap_table_size, part #2
- Closed
- links to