~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1;
2
set names latin1;
3
select hex(weight_string(0x010203));
4
hex(weight_string(0x010203))
5
010203
6
select hex(weight_string('aa' as char(3)));
7
hex(weight_string('aa' as char(3)))
8
414120
9
select hex(weight_string('a' as char(-1)));
10
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1)))' at line 1
11
select hex(weight_string('a' as char(0)));
12
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0)))' at line 1
13
select hex(weight_string('a' as char(1)));
14
hex(weight_string('a' as char(1)))
15
41
16
select hex(weight_string('ab' as char(1)));
17
hex(weight_string('ab' as char(1)))
18
41
19
select hex(weight_string('ab'));
20
hex(weight_string('ab'))
21
4142
22
select hex(weight_string('aa' as binary(3)));
23
hex(weight_string('aa' as binary(3)))
24
616100
25
select hex(weight_string(cast('aa' as binary(3))));
26
hex(weight_string(cast('aa' as binary(3))))
27
616100
28
select hex(weight_string('ab' level 1-1 ASC));
29
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC))' at line 1
30
select hex(weight_string('ab' level 1-1 DESC));
31
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC))' at line 1
32
select hex(weight_string('ab' level 1-1 REVERSE));
33
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REVERSE))' at line 1
34
select hex(weight_string('ab' level 1 ASC));
35
hex(weight_string('ab' level 1 ASC))
36
4142
37
select hex(weight_string('ab' level 1 DESC));
38
hex(weight_string('ab' level 1 DESC))
39
BEBD
40
select hex(weight_string('ab' level 1 REVERSE));
41
hex(weight_string('ab' level 1 REVERSE))
42
4241
43
select hex(weight_string('ab' level 1 DESC REVERSE));
44
hex(weight_string('ab' level 1 DESC REVERSE))
45
BDBE
46
create table t1 select weight_string('test') as w;
47
show create table t1;
48
Table	Create Table
49
t1	CREATE TABLE "t1" (
50
  "w" varbinary(4)
51
) ENGINE=MyISAM DEFAULT CHARSET=latin1
52
drop table t1;
53
create table t1 select weight_string(repeat('t',66000)) as w;
54
show create table t1;
55
Table	Create Table
56
t1	CREATE TABLE "t1" (
57
  "w" longblob
58
) ENGINE=MyISAM DEFAULT CHARSET=latin1
59
drop table t1;
60
select weight_string(NULL);
61
weight_string(NULL)
62
NULL
63
select 1 as weight_string, 2 as reverse;
64
weight_string	reverse
65
1	2
66
select coercibility(weight_string('test'));
67
coercibility(weight_string('test'))
68
4
69
select coercibility(weight_string('test' collate latin1_swedish_ci));
70
coercibility(weight_string('test' collate latin1_swedish_ci))
71
0
72
create table t1 (s1 varchar(5));
73
insert into t1 values ('a'),(null);
74
select hex(weight_string(s1)) from t1 order by s1;
75
hex(weight_string(s1))
76
NULL
77
41
78
drop table t1;