home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-01-21 | 1.3 KB | 44 lines | [TEXT/ttxt] |
- #
- # test sort,min and max on binary fields
- #
-
- create table t1 (name char(20) not null, primary key (name));
- create table t2 (name char(20) binary not null, primary key (name));
- insert into t1 values ("Â");
- insert into t1 values ("‰");
- insert into t1 values ("ˆ");
- insert into t2 select * from t1;
-
- select * from t1 order by name;
- select concat("*",name,"*") from t1 order by 1;
- select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1;
- select * from t2 order by name;
- select concat("*",name,"*") from t2 order by 1;
- select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2;
- select name from t1 where name between 'ƒ' and '÷';
- select name from t2 where name between '‰' and 'ˆ';
- select name from t2 where name between 'ƒ' and '÷';
-
- drop table t1,t2;
-
- #
- # Test of binary and normal strings
- #
-
- create table t1 (a char(10) not null, b char(10) binary not null,index (a));
- insert into t1 values ("hello ","hello "),("hello2 ","hello2 ");
- select * from t1 where a="hello ";
- select * from t1 where b="hello ";
- select * from t1 where b="hello";
- drop table t1;
-
- #
- # Test of binary and NULL
- #
- create table t1 (b char(8));
- insert into t1 values(NULL);
- select b from t1 where binary b like '';
- select b from t1 group by binary b like '';
- select b from t1 having binary b like '';
- drop table t1;
-