1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

handle tree overflow in count(distinct)

test heap table/tree overflow in count(distinct)


mysql-test/r/count_distinct2.result:
  added test for tree/heap table overflow
mysql-test/t/count_distinct2.test:
  test tree/heap table overflow
sql/item_sum.cc:
  handle tree overflow in count(distinct)
sql/item_sum.h:
  t
This commit is contained in:
unknown
2001-05-24 17:06:53 -06:00
parent a895b7b447
commit b7b409b76e
5 changed files with 94 additions and 4 deletions

View File

@ -74,3 +74,11 @@ count(distinct n2) n1
1 NULL
1 1
3 2
count(distinct n)
5000
Variable_name Value
Created_tmp_disk_tables 1
count(distinct s)
5000
Variable_name Value
Created_tmp_disk_tables 1

View File

@ -0,0 +1 @@
-O max_heap_table_size=16384

View File

@ -43,3 +43,32 @@ select count(distinct n1), count(distinct n2) from t1;
select count(distinct n2), n1 from t1 group by n1;
drop table t1;
# test the converstion from tree to MyISAM
create table t1 (n int);
let $1=5000;
while ($1)
{
eval insert into t1 values($1);
dec $1;
}
flush status;
select count(distinct n) from t1;
show status like 'Created_tmp_disk_tables';
drop table t1;
#test conversion from heap to MyISAM
create table t1 (s text);
let $1=5000;
while ($1)
{
eval insert into t1 values('$1');
dec $1;
}
flush status;
select count(distinct s) from t1;
show status like 'Created_tmp_disk_tables';
drop table t1;