2003-01-06 01:48:59 +02:00
|
|
|
#
|
|
|
|
# Test of count(distinct ..)
|
|
|
|
#
|
|
|
|
|
|
|
|
--disable_warnings
|
2001-04-09 18:25:06 -06:00
|
|
|
drop table if exists t1;
|
2003-01-06 01:48:59 +02:00
|
|
|
--enable_warnings
|
2001-04-09 18:31:00 -06:00
|
|
|
create table t1(n int not null, key(n)) delay_key_write = 1;
|
2001-04-12 13:46:19 -06:00
|
|
|
let $1=100;
|
2001-09-27 23:05:54 -06:00
|
|
|
disable_query_log;
|
2001-04-09 18:25:06 -06:00
|
|
|
while ($1)
|
|
|
|
{
|
|
|
|
eval insert into t1 values($1);
|
|
|
|
eval insert into t1 values($1);
|
|
|
|
dec $1;
|
|
|
|
}
|
2001-09-27 23:05:54 -06:00
|
|
|
enable_query_log;
|
2001-04-09 18:25:06 -06:00
|
|
|
select count(distinct n) from t1;
|
2003-10-30 12:57:26 +02:00
|
|
|
explain extended select count(distinct n) from t1;
|
2001-04-09 18:25:06 -06:00
|
|
|
drop table t1;
|