mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
515c747dcf
BitKeeper/etc/ignore: auto-union acinclude.m4: Auto merged Docs/manual.texi: Auto merged include/my_sys.h: Auto merged include/mysql.h: Auto merged libmysqld/libmysqld.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/t/count_distinct2.test: Auto merged mysql-test/t/flush.test: Auto merged mysql-test/t/rpl000017.test: Auto merged libmysql/libmysql.c: Auto merged mysys/Makefile.am: Auto merged sql/Makefile.am: Auto merged sql/handler.cc: Auto merged sql/item_func.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged libmysqld/Makefile.am: Added back md5.c
79 lines
1.8 KiB
Text
79 lines
1.8 KiB
Text
drop table if exists t1;
|
|
|
|
create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text);
|
|
insert into t1 values (1,11, 'one','eleven', 'eleven'),
|
|
(1,11, 'one','eleven', 'eleven'),
|
|
(2,11, 'two','eleven', 'eleven'),
|
|
(2,12, 'two','twevle', 'twelve'),
|
|
(2,13, 'two','thirteen', 'foo'),
|
|
(2,13, 'two','thirteen', 'foo'),
|
|
(2,13, 'two','thirteen', 'bar'),
|
|
(NULL,13, 'two','thirteen', 'bar'),
|
|
(2,NULL, 'two','thirteen', 'bar'),
|
|
(2,13, NULL,'thirteen', 'bar'),
|
|
(2,13, 'two',NULL, 'bar'),
|
|
(2,13, 'two','thirteen', NULL);
|
|
|
|
select distinct n1 from t1;
|
|
select count(distinct n1) from t1;
|
|
|
|
select distinct n2 from t1;
|
|
select count(distinct n2) from t1;
|
|
|
|
select distinct s from t1;
|
|
select count(distinct s) from t1;
|
|
|
|
select distinct vs from t1;
|
|
select count(distinct vs) from t1;
|
|
|
|
select distinct t from t1;
|
|
select count(distinct t) from t1;
|
|
|
|
select distinct n1,n2 from t1;
|
|
select count(distinct n1,n2) from t1;
|
|
|
|
select distinct n1,s from t1;
|
|
select count(distinct n1,s) from t1;
|
|
|
|
select distinct s,n1,vs from t1;
|
|
select count(distinct s,n1,vs) from t1;
|
|
|
|
select distinct s,t from t1;
|
|
select count(distinct s,t) from t1;
|
|
|
|
select count(distinct n1), count(distinct n2) from t1;
|
|
|
|
select count(distinct n2), n1 from t1 group by n1;
|
|
drop table t1;
|
|
|
|
# test the conversion from tree to MyISAM
|
|
create table t1 (n int default NULL);
|
|
let $1=5000;
|
|
disable_query_log;
|
|
while ($1)
|
|
{
|
|
eval insert into t1 values($1);
|
|
dec $1;
|
|
}
|
|
enable_query_log;
|
|
|
|
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;
|
|
disable_query_log;
|
|
while ($1)
|
|
{
|
|
eval insert into t1 values('$1');
|
|
dec $1;
|
|
}
|
|
enable_query_log;
|
|
flush status;
|
|
select count(distinct s) from t1;
|
|
show status like 'Created_tmp_disk_tables';
|
|
drop table t1;
|
|
|