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