1
by brian
clean slate |
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 |
select 0x31+1,concat(0x31)+1,-0xf; |
|
6 |
0x31+1 concat(0x31)+1 -0xf |
|
7 |
50 2 -15 |
|
8 |
select x'31',X'ffff'+0; |
|
9 |
x'31' X'ffff'+0 |
|
10 |
1 65535 |
|
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) ); |
|
12 |
insert into t1 set UNIQ=0x38afba1d73e6a18a; |
|
13 |
insert into t1 set UNIQ=123; |
|
14 |
explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a; |
|
15 |
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 |
|
17 |
Warnings: |
|
18 |
Note 1003 select '00000001' AS `ID`,'004084688022709641610' AS `UNIQ` from `test`.`t1` where 1 |
|
19 |
drop table t1; |
|
20 |
select x'hello'; |
|
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 |
|
22 |
select 0xfg; |
|
23 |
ERROR 42S22: Unknown column '0xfg' in 'field list' |
|
24 |
create table t1 select 1 as x, 2 as xx; |
|
25 |
select x,xx from t1; |
|
26 |
x xx |
|
27 |
1 2 |
|
28 |
drop table t1; |
|
29 |
show create table t1; |
|
30 |
Table Create Table |
|
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; |
|
36 |
length(a) length(b) |
|
37 |
255 3 |
|
38 |
255 3 |
|
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! |
|
42 |
REPAIR TABLE t1; |
|
43 |
Table Op Msg_type Msg_text |
|
44 |
test.t1 repair status OK |
|
45 |
show create table t1; |
|
46 |
Table Create Table |
|
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; |
|
52 |
length(a) length(b) |
|
53 |
3 3 |
|
54 |
3 3 |
|
55 |
insert into t1 values("ccc", "ddd"); |
|
56 |
select length(a), length(b) from t1; |
|
57 |
length(a) length(b) |
|
58 |
3 3 |
|
59 |
3 3 |
|
60 |
3 3 |
|
61 |
select hex(a), hex(b) from t1; |
|
62 |
hex(a) hex(b) |
|
63 |
616161 636363 |
|
64 |
626262 646464 |
|
65 |
636363 646464 |
|
66 |
select concat("'", a, "'"), concat("'", b, "'") from t1; |
|
67 |
concat("'", a, "'") concat("'", b, "'") |
|
68 |
'aaa' 'ccc' |
|
69 |
'bbb' 'ddd' |
|
70 |
'ccc' 'ddd' |
|
71 |
drop table t1; |
|
72 |
create table t1(a varbinary(255)); |
|
73 |
insert into t1 values("aaa "); |
|
74 |
select length(a) from t1; |
|
75 |
length(a) |
|
76 |
6
|
|
77 |
alter table t1 modify a varchar(255); |
|
78 |
select length(a) from t1; |
|
79 |
length(a) |
|
80 |
6
|
|
81 |
drop table t1; |
|
82 |
drop table if exists table_28127_a; |
|
83 |
drop table if exists table_28127_b; |
|
84 |
create table table_28127_a(0b02 int); |
|
85 |
show create table table_28127_a; |
|
86 |
Table Create Table |
|
87 |
table_28127_a CREATE TABLE `table_28127_a` ( |
|
88 |
`0b02` int(11) DEFAULT NULL |
|
89 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
90 |
create table table_28127_b(0b2 int); |
|
91 |
show create table table_28127_b; |
|
92 |
Table Create Table |
|
93 |
table_28127_b CREATE TABLE `table_28127_b` ( |
|
94 |
`0b2` int(11) DEFAULT NULL |
|
95 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
96 |
drop table table_28127_a; |
|
97 |
drop table table_28127_b; |