[MDEV-13458] Wrong result for aggregate function with distinct clause when the value for tmp_table_size is small Created: 2017-08-05  Updated: 2017-08-10  Resolved: 2017-08-10

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Procedure
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 5.5.58

Type: Bug Priority: Major
Reporter: Varun Gupta (Inactive) Assignee: Varun Gupta (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

create table t1 (
a VARCHAR(900),
b int
);
insert into t1 values
( 0 , 1 ),
( 1 , 2 ),
( 2 , 3 ),
( 3 , 4 ),
( 4 , 5 ),
( 5 , 6 ),
( 6 , 7 ),
( 7 , 8 ),
( 8 , 9 ),
( 9 , 10 ),
( 10 , 11 ),
( 11 , 12 ),
( 12 , 13 ),
( 13 , 14 ),
( 14 , 15 ),
( 15 , 16 ),
( 16 , 17 ),
( 17 , 18 ),
( 18 , 19 ),
( 25 , 26 ),
( 26 , 27 ),
( 9 , 120 ),
( 10 , 121 ),
( 11 , 122 ),
( 12 , 123 ),
( 13 , 124 ),
( 14 , 125 ),
( 15 , 126 ),
( 16 , 127 );
select count(distinct a) from t1;
count(distinct a)
21
set tmp_table_size=1024;
select count(distinct a) from t1;
count(distinct a)
19

So when we set the value of tmp_table_size=1024, then the result for the select query is incorrect



 Comments   
Comment by Varun Gupta (Inactive) [ 2017-08-10 ]

Pushed to 5.5
https://github.com/MariaDB/server/commit/0739179857699d68758ff2e56e9414735546ded6

Generated at Thu Feb 08 08:05:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.