~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/r/binary.result

  • Committer: Brian Aker
  • Date: 2008-07-02 21:16:23 UTC
  • Revision ID: brian@tangent.org-20080702211623-lix7xclpnm217nov
Remaining major pieces of PS removed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1,t2;
2
 
create table t1 (a char(10) not null, b char(10) not null,key (a), key(b));
 
2
create table t1 (name char(20) not null, primary key (name));
 
3
create table t2 (name char(20) binary not null, primary key (name));
 
4
insert into t1 values ("�");
 
5
insert into t1 values ("�");
 
6
insert into t1 values ("�");
 
7
insert into t2 select * from t1;
 
8
select * from t1 order by name;
 
9
name
 
10
 
11
 
12
 
13
select concat("*",name,"*") from t1 order by 1;
 
14
concat("*",name,"*")
 
15
*�*
 
16
*�*
 
17
*�*
 
18
select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1;
 
19
min(name)       min(concat("*",name,"*"))       max(name)       max(concat("*",name,"*"))
 
20
�       *�*     �       *�*
 
21
select * from t2 order by name;
 
22
name
 
23
 
24
 
25
 
26
select concat("*",name,"*") from t2 order by 1;
 
27
concat("*",name,"*")
 
28
*�*
 
29
*�*
 
30
*�*
 
31
select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2;
 
32
min(name)       min(concat("*",name,"*"))       max(name)       max(concat("*",name,"*"))
 
33
�       *�*     �       *�*
 
34
select name from t1 where name between '�' and '�';
 
35
name
 
36
 
37
 
38
select name from t2 where name between '�' and '�';
 
39
name
 
40
 
41
 
42
 
43
select name from t2 where name between '�' and '�';
 
44
name
 
45
drop table t1,t2;
 
46
create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b));
3
47
insert into t1 values ("hello ","hello "),("hello2 ","hello2 ");
4
48
select concat("-",a,"-",b,"-") from t1 where a="hello";
5
49
concat("-",a,"-",b,"-")
6
 
-hello -hello -
 
50
-hello-hello-
7
51
select concat("-",a,"-",b,"-") from t1 where a="hello ";
8
52
concat("-",a,"-",b,"-")
9
 
-hello -hello -
 
53
-hello-hello-
10
54
select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello ";
11
55
concat("-",a,"-",b,"-")
12
 
-hello -hello -
 
56
-hello-hello-
13
57
select concat("-",a,"-",b,"-") from t1 where b="hello";
14
58
concat("-",a,"-",b,"-")
15
 
-hello -hello -
 
59
-hello-hello-
16
60
select concat("-",a,"-",b,"-") from t1 where b="hello ";
17
61
concat("-",a,"-",b,"-")
18
 
-hello -hello -
 
62
-hello-hello-
19
63
select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
20
64
concat("-",a,"-",b,"-")
21
 
-hello -hello -
 
65
-hello-hello-
22
66
alter table t1 modify b tinytext not null, drop key b, add key (b(100));
23
67
select concat("-",a,"-",b,"-") from t1;
24
68
concat("-",a,"-",b,"-")
25
 
-hello -hello -
26
 
-hello2 -hello2 -
 
69
-hello-hello-
 
70
-hello2-hello2-
27
71
select concat("-",a,"-",b,"-") from t1 where b="hello ";
28
72
concat("-",a,"-",b,"-")
29
 
-hello -hello -
 
73
-hello-hello-
30
74
select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
31
75
concat("-",a,"-",b,"-")
32
 
-hello -hello -
 
76
-hello-hello-
33
77
drop table t1;
34
78
create table t1 (b char(8));
35
79
insert into t1 values(NULL);
41
85
select b from t1 having binary b like '';
42
86
b
43
87
drop table t1;
44
 
create table t1 (a char(3), b varbinary(3));
 
88
create table t1 (a char(3) binary, b binary(3));
45
89
insert into t1 values ('aaa','bbb'),('AAA','BBB');
46
90
select upper(a),upper(b) from t1;
47
91
upper(a)        upper(b)
65
109
select * from t1 where lower(b)='bbb';
66
110
a       b
67
111
aaa     bbb
 
112
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
 
113
charset(a)      charset(b)      charset(binary 'ccc')
 
114
latin1  binary  binary
68
115
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
69
116
collation(a)    collation(b)    collation(binary 'ccc')
70
 
utf8_general_ci binary  binary
 
117
latin1_bin      binary  binary
71
118
drop table t1;
72
119
create table t1( firstname char(20), lastname char(20));
73
120
insert into t1 values ("john","doe"),("John","Doe");
87
134
firstname       lastname
88
135
John    Doe
89
136
drop table t1;
90
 
create table t1 (a char);
 
137
create table t1 (a binary);
91
138
show create table t1;
92
139
Table   Create Table
93
 
t1      CREATE TABLE `t1` (
94
 
  `a` VARCHAR(1) COLLATE utf8_general_ci DEFAULT NULL
95
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
140
t1      CREATE TABLE "t1" (
 
141
  "a" binary(1)
 
142
) ENGINE=MyISAM DEFAULT CHARSET=latin1
96
143
drop table t1;
97
 
create table t2 (a varbinary);
98
 
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
99
 
create table t1 (col1 char(4));
 
144
create table t1 (col1 binary(4));
100
145
insert into t1 values ('a'),('a ');
101
146
select hex(col1) from t1;
102
147
hex(col1)
103
 
61
104
 
6120
105
 
alter table t1 modify col1 char(10);
 
148
61000000
 
149
61200000
 
150
alter table t1 modify col1 binary(10);
106
151
select hex(col1) from t1;
107
152
hex(col1)
108
 
61
109
 
6120
 
153
61000000000000000000
 
154
61200000000000000000
110
155
insert into t1 values ('b'),('b ');
111
156
select hex(col1) from t1;
112
157
hex(col1)
113
 
61
114
 
6120
115
 
62
116
 
6220
 
158
61000000000000000000
 
159
61200000000000000000
 
160
62000000000000000000
 
161
62200000000000000000
117
162
drop table t1;
118
163
CREATE TABLE t1 (
119
 
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', 
 
164
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', 
120
165
index idx(a)
121
166
);
122
167
INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029087575');
129
174
1F9480179366F2BF567E1C4B964C1EF029087575
130
175
EXPLAIN SELECT hex(a) FROM t1 order by a;
131
176
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
132
 
1       SIMPLE  t1      index   NULL    idx     22      NULL    3       Using index
 
177
1       SIMPLE  t1      index   NULL    idx     20      NULL    3       Using index
133
178
SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
134
179
hex(a)
135
180
1F9480179366F2BF567E1C4B964C1EF029082020
136
181
EXPLAIN
137
182
SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
138
183
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
139
 
1       SIMPLE  t1      ref     idx     idx     22      const   1       Using where; Using index
 
184
1       SIMPLE  t1      ref     idx     idx     20      const   1       Using where; Using index
140
185
SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF02908');
141
186
hex(a)
142
187
DROP TABLE t1;