5
5
drop table if exists t1,t2;
8
create table t1 (name char(20) not null, primary key (name));
9
create table t2 (name char(20) binary not null, primary key (name));
10
insert into t1 values ("�");
11
insert into t1 values ("�");
12
insert into t1 values ("�");
13
insert into t2 select * from t1;
15
select * from t1 order by name;
16
select concat("*",name,"*") from t1 order by 1;
17
select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1;
18
select * from t2 order by name;
19
select concat("*",name,"*") from t2 order by 1;
20
select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2;
21
select name from t1 where name between '�' and '�';
22
select name from t2 where name between '�' and '�';
23
select name from t2 where name between '�' and '�';
8
# Conflicts between � and �. Bug#308841
9
#create table t1 (name char(20) not null, primary key (name));
10
#create table t2 (name char(20) binary not null, primary key (name));
11
#insert into t1 values ("�");
12
#insert into t1 values ("�");
13
#insert into t1 values ("�");
14
#insert into t2 select * from t1;
16
#select * from t1 order by name;
17
#select concat("*",name,"*") from t1 order by 1;
18
#select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1;
19
#select * from t2 order by name;
20
#select concat("*",name,"*") from t2 order by 1;
21
#select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2;
22
#select name from t1 where name between '�' and '�';
23
#select name from t2 where name between '�' and '�';
24
#select name from t2 where name between '�' and '�';
28
29
# Test of binary and normal strings
57
58
# Test of binary and upper/lower
59
create table t1 (a char(3) binary, b binary(3));
60
create table t1 (a char(3) binary, b varbinary(3));
60
61
insert into t1 values ('aaa','bbb'),('AAA','BBB');
61
62
select upper(a),upper(b) from t1;
62
63
select lower(a),lower(b) from t1;
64
65
select * from t1 where lower(a)='aaa';
65
66
select * from t1 where upper(b)='BBB';
66
67
select * from t1 where lower(b)='bbb';
67
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
68
68
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
85
85
# Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not
87
create table t1 (a binary);
87
create table t1 (a char);
88
88
show create table t1;
91
create table t2 (a varbinary);
96
create table t1 (col1 binary(4));
98
create table t1 (col1 char(4));
97
99
insert into t1 values ('a'),('a ');
98
100
select hex(col1) from t1;
99
alter table t1 modify col1 binary(10);
101
alter table t1 modify col1 char(10);
100
102
select hex(col1) from t1;
101
103
insert into t1 values ('b'),('b ');
102
104
select hex(col1) from t1;