1
1
drop table if exists t1;
2
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ;
3
0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0
4
A 65 9223372036854775807 18446744073709551615
5
2
select 0x31+1,concat(0x31)+1,-0xf;
6
3
0x31+1 concat(0x31)+1 -0xf
8
5
select x'31',X'ffff'+0;
11
create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) );
8
create table t1 (ID int not null auto_increment,UNIQ bigint not null,primary key (ID),unique (UNIQ) );
12
9
insert into t1 set UNIQ=0x38afba1d73e6a18a;
13
10
insert into t1 set UNIQ=123;
14
11
explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a;
15
12
id select_type table type possible_keys key key_len ref rows filtered Extra
16
1 SIMPLE t1 const UNIQ UNIQ 8 const 1 100.00
13
1 SIMPLE t1 const UNIQ UNIQ 8 const 1 100.00 Using index
18
Note 1003 select '00000001' AS `ID`,'004084688022709641610' AS `UNIQ` from `test`.`t1` where 1
15
Note 1003 select '1' AS `ID`,'4084688022709641610' AS `UNIQ` from `test`.`t1` where 1
21
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 'x'hello'' at line 1
18
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 'x'hello'' at line 1
23
20
ERROR 42S22: Unknown column '0xfg' in 'field list'
24
21
create table t1 select 1 as x, 2 as xx;
29
26
show create table t1;
31
t1 CREATE TABLE `t1` (
32
`a` varbinary(255) DEFAULT NULL,
33
`b` varchar(255) DEFAULT NULL
34
) ENGINE=MyISAM DEFAULT CHARSET=latin1
35
select length(a), length(b) from t1;
39
CHECK TABLE t1 FOR UPGRADE;
40
Table Op Msg_type Msg_text
41
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix it!
43
Table Op Msg_type Msg_text
44
test.t1 repair status OK
47
t1 CREATE TABLE `t1` (
48
`a` varbinary(255) DEFAULT NULL,
49
`b` varchar(255) DEFAULT NULL
50
) ENGINE=MyISAM DEFAULT CHARSET=latin1
51
select length(a), length(b) from t1;
55
insert into t1 values("ccc", "ddd");
56
select length(a), length(b) from t1;
61
select hex(a), hex(b) from t1;
66
select concat("'", a, "'"), concat("'", b, "'") from t1;
67
concat("'", a, "'") concat("'", b, "'")
27
ERROR 42S02: Table 'test.t1' doesn't exist
29
ERROR 42S02: Unknown table 't1'
72
30
create table t1(a varbinary(255));
73
31
insert into t1 values("aaa ");
74
32
select length(a) from t1;
85
43
show create table table_28127_a;
87
45
table_28127_a CREATE TABLE `table_28127_a` (
88
`0b02` int(11) DEFAULT NULL
89
) ENGINE=MyISAM DEFAULT CHARSET=latin1
46
`0b02` int DEFAULT NULL
90
48
create table table_28127_b(0b2 int);
91
49
show create table table_28127_b;
93
51
table_28127_b CREATE TABLE `table_28127_b` (
94
`0b2` int(11) DEFAULT NULL
95
) ENGINE=MyISAM DEFAULT CHARSET=latin1
52
`0b2` int DEFAULT NULL
96
54
drop table table_28127_a;
97
55
drop table table_28127_b;