23
23
select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
24
24
-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000001
25
25
-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000001
26
create table t1 (a bigint not null, primary key(a));
26
create table t1 (a bigint unsigned not null, primary key(a));
27
27
insert into t1 values (9223372036854775808);
28
28
insert into t1 values (0x7000000000000000);
31
32
-9223372036854775808
33
33
select * from t1 where a=18446744073709551615;
35
35
delete from t1 where a=18446744073709551615;
38
39
-9223372036854775808
41
create table t1 ( a int not null default 1, big bigint );
41
create table t1 ( a int not null default 1, big bigint unsigned);
42
42
insert into t1 (big) values (-1),(9223372036854775808),(9223372036854775807),(9223372036854775808);
43
ERROR 22003: Out of range value for column 'big' at row 1
44
insert into t1 (big) values (-1);
45
ERROR 22003: Out of range value for column 'big' at row 1
46
insert into t1 (big) values (9223372036854775808),(9223372036854775807),(9223372036854775808);
46
49
1 -9223372036854775808
47
50
1 9223372036854775807
48
51
1 -9223372036854775808
49
52
select min(big),max(big),max(big)-1 from t1;
50
53
min(big) max(big) max(big)-1
51
-9223372036854775808 9223372036854775807 9223372036854775806
54
9223372036854775807 9223372036854775808 9223372036854775807
52
55
select min(big),max(big),max(big)-1 from t1 group by a;
53
56
min(big) max(big) max(big)-1
54
-9223372036854775808 9223372036854775807 9223372036854775806
57
9223372036854775807 -9223372036854775808 9223372036854775807
55
58
alter table t1 modify big bigint not null;
56
59
select min(big),max(big),max(big)-1 from t1;
57
60
min(big) max(big) max(big)-1
60
63
min(big) max(big) max(big)-1
61
64
-9223372036854775808 9223372036854775807 9223372036854775806
62
65
insert into t1 (big) values (9223372036854775808);
66
ERROR 22003: Out of range value for column 'big' at row 1
66
69
1 -9223372036854775808
67
70
1 9223372036854775807
68
71
1 -9223372036854775808
69
1 -9223372036854775808
70
72
select min(big),max(big),max(big)-1 from t1;
71
73
min(big) max(big) max(big)-1
72
74
-9223372036854775808 9223372036854775807 9223372036854775806
121
121
Warning 1292 Truncated incorrect DOUBLE value: '0x8000000000000001'
122
122
create table t1 (
123
value64 bigint not null,
123
value64 bigint unsigned not null,
124
124
value32 integer not null,
125
125
primary key(value64, value32)
127
127
create table t2 (
128
value64 bigint not null,
128
value64 bigint unsigned not null,
129
129
value32 integer not null,
130
130
primary key(value64, value32)
133
133
insert into t1 values( 9223372036854775807, 2);
134
134
insert into t2 values(17156792991891826145, 3);
135
135
insert into t2 values( 9223372036854775807, 4);
136
select * from t1 ORDER BY value32;
138
138
-1289951081817725471 1
139
139
9223372036854775807 2
140
select * from t2 ORDER BY value32;
142
142
-1289951081817725471 3
143
143
9223372036854775807 4
144
select * from t1, t2 where t1.value64=17156792991891826145 and
145
t2.value64=17156792991891826145;
146
value64 value32 value64 value32
147
-1289951081817725471 1 -1289951081817725471 3
148
select * from t1, t2 where t1.value64=17156792991891826145 and
149
t2.value64=t1.value64;
150
value64 value32 value64 value32
151
-1289951081817725471 1 -1289951081817725471 3
152
select * from t1, t2 where t1.value64= 9223372036854775807 and
153
t2.value64=9223372036854775807;
144
select * from t1, t2 where t1.value64=17156792991891826145 and t2.value64=17156792991891826145;
145
value64 value32 value64 value32
146
-1289951081817725471 1 -1289951081817725471 3
147
select * from t1, t2 where t1.value64=17156792991891826145 and t2.value64=t1.value64;
148
value64 value32 value64 value32
149
-1289951081817725471 1 -1289951081817725471 3
150
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=9223372036854775807;
154
151
value64 value32 value64 value32
155
152
9223372036854775807 2 9223372036854775807 4
156
select * from t1, t2 where t1.value64= 9223372036854775807 and
157
t2.value64=t1.value64;
153
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=t1.value64;
158
154
value64 value32 value64 value32
159
155
9223372036854775807 2 9223372036854775807 4
160
156
drop table t1, t2;
192
195
insert into t1 values (-1,-1,-1,-1);
193
196
select * from t1;
195
199
18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
198
201
create table t1 ( quantity decimal(2));
199
202
insert into t1 values (50), (-50), (0), (-1);
200
203
select * from t1;
207
210
CREATE TABLE t1 (
321
324
col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 fix1 fix2 fix3 fix4 fix5 fix6 fix7 fix8 fix9 fix10 fix11 fix12 fix13 fix14 fix15 fix16 fix17 fix18 fix19 fix20 fix21 fix22 fix23 fix24 fix25 fix26 fix27 fix28 fix29 fix30
322
325
9 99 999 9999 99999 999999 9999999 99999999 999999999 9999999999 99999999999 999999999999 9999999999999 99999999999999 999999999999999 9999999999999999 99999999999999999 999999999999999999 9999999999999999999 99999999999999999999 999999999999999999999 9999999999999999999999 99999999999999999999999 999999999999999999999999 9999999999999999999999999 99999999999999999999999999 999999999999999999999999999 9999999999999999999999999999 99999999999999999999999999999 999999999999999999999999999999 9999999999999999999999999999999 99999999999999999999999999999999 999999999999999999999999999999999 9999999999999999999999999999999999 99999999999999999999999999999999999 999999999999999999999999999999999999 9999999999999999999999999999999999999 99999999999999999999999999999999999999 9999999999999999999999999999999999999.9 999999999999999999999999999999999999.99 99999999999999999999999999999999999.999 9999999999999999999999999999999999.9999 999999999999999999999999999999999.99999 99999999999999999999999999999999.999999 9999999999999999999999999999999.9999999 999999999999999999999999999999.99999999 99999999999999999999999999999.999999999 9999999999999999999999999999.9999999999 999999999999999999999999999.99999999999 99999999999999999999999999.999999999999 9999999999999999999999999.9999999999999 999999999999999999999999.99999999999999 99999999999999999999999.999999999999999 9999999999999999999999.9999999999999999 999999999999999999999.99999999999999999 99999999999999999999.999999999999999999 9999999999999999999.9999999999999999999 999999999999999999.99999999999999999999 99999999999999999.999999999999999999999 9999999999999999.9999999999999999999999 999999999999999.99999999999999999999999 99999999999999.999999999999999999999999 9999999999999.9999999999999999999999999 999999999999.99999999999999999999999999 99999999999.999999999999999999999999999 9999999999.9999999999999999999999999999 999999999.99999999999999999999999999999 99999999.999999999999999999999999999999
324
create table t1 (bigint_col bigint);
327
create table t1 (bigint_col bigint unsigned);
325
328
insert into t1 values (17666000000000000000);
326
329
select * from t1 where bigint_col=17666000000000000000;
334
337
select 10000002383263201056 mod 50 as result;
337
create table t1 (c1 bigint);
340
create table t1 (c1 bigint unsigned);
338
341
insert into t1 values (10000002383263201056);
339
342
select c1 mod 50 as result from t1;
343
346
select -9223372036854775808;
344
347
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr