mariadb/mysql-test/r/binary.result

56 lines
1.3 KiB
Text
Raw Normal View History

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 ("<22>");
insert into t1 values ("<22>");
insert into t1 values ("<22>");
insert into t2 select * from t1;
select * from t1 order by name;
name
<EFBFBD>
<EFBFBD>
<EFBFBD>
select concat("*",name,"*") from t1 order by 1;
concat("*",name,"*")
*<2A>*
*<2A>*
*<2A>*
select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1;
min(name) min(concat("*",name,"*")) max(name) max(concat("*",name,"*"))
<EFBFBD> *<2A>* <09> *<2A>*
select * from t2 order by name;
name
<EFBFBD>
<EFBFBD>
<EFBFBD>
select concat("*",name,"*") from t2 order by 1;
concat("*",name,"*")
*<2A>*
*<2A>*
*<2A>*
select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2;
min(name) min(concat("*",name,"*")) max(name) max(concat("*",name,"*"))
<EFBFBD> *<2A>* <09> *<2A>*
select name from t1 where name between '<27>' and '<27>';
name
<EFBFBD>
<EFBFBD>
select name from t2 where name between '<27>' and '<27>';
name
<EFBFBD>
<EFBFBD>
<EFBFBD>
select name from t2 where name between '<27>' and '<27>';
name
drop table t1,t2;
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 ";
a b
hello hello
select * from t1 where b="hello ";
a b
select * from t1 where b="hello";
a b
hello hello
drop table t1;