~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/binary.test

pandora-build v0.71. Added check for avahi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
drop table if exists t1,t2;
6
6
--enable_warnings
7
7
 
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;
14
 
 
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 '�';
24
 
 
25
 
drop table t1,t2;
 
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;
 
15
#
 
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 '�';
 
25
#
 
26
#drop table t1,t2;
26
27
 
27
28
#
28
29
# Test of binary and normal strings
29
30
#
30
31
 
31
 
create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b));
 
32
create table t1 (a char(10) not null, b char(10) not null,key (a), key(b));
32
33
insert into t1 values ("hello ","hello "),("hello2 ","hello2 ");
33
34
select concat("-",a,"-",b,"-") from t1 where a="hello";
34
35
select concat("-",a,"-",b,"-") from t1 where a="hello ";
56
57
#
57
58
# Test of binary and upper/lower
58
59
#
59
 
create table t1 (a char(3) binary, b binary(3));
 
60
create table t1 (a char(3), 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;
69
69
drop table t1;
70
70
 
84
84
#
85
85
# Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not
86
86
#
87
 
create table t1 (a binary);
 
87
create table t1 (a char);
 
88
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
88
89
show create table t1;
89
90
drop table t1;
 
91
--error 1064
 
92
create table t2 (a varbinary);
90
93
 
91
94
# End of 4.1 tests
92
95
 
93
96
#
94
97
# Bug#16857
95
98
#
96
 
create table t1 (col1 binary(4));
 
99
create table t1 (col1 char(4));
97
100
insert into t1 values ('a'),('a ');
98
101
select hex(col1) from t1;
99
 
alter table t1 modify col1 binary(10);
 
102
alter table t1 modify col1 char(10);
100
103
select hex(col1) from t1;
101
104
insert into t1 values ('b'),('b ');
102
105
select hex(col1) from t1;
108
111
#
109
112
 
110
113
CREATE TABLE t1 (
111
 
  a binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', 
 
114
  a varbinary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', 
112
115
  index idx(a)
113
116
);
114
117
INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029087575');