1
drop table if exists t1, t2;
2
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
3
0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296
4
0 256 65536 2147483647 -2147483648 2147483648 4294967296
5
select 9223372036854775807,-009223372036854775808;
6
9223372036854775807 -009223372036854775808
7
9223372036854775807 -9223372036854775808
8
select +9999999999999999999,-9999999999999999999;
9
9999999999999999999 -9999999999999999999
10
9999999999999999999 -9999999999999999999
11
select 9223372036854775808 +1;
12
9223372036854775808 +1
14
select 9223372036854775808+1;
17
select -(0-3),round(-(0-3)), round(9999999999999999999);
18
-(0-3) round(-(0-3)) round(9999999999999999999)
19
3 3 9999999999999999999
20
select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001;
21
1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001
22
1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001
23
select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
24
-1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000001
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));
27
insert into t1 values (9223372036854775808);
28
insert into t1 values (0x7000000000000000);
33
select * from t1 where a=18446744073709551615;
35
delete from t1 where a=18446744073709551615;
41
create table t1 ( a int not null default 1, big bigint );
42
insert into t1 (big) values (-1),(9223372036854775808),(9223372036854775807),(9223372036854775808);
46
1 -9223372036854775808
48
1 -9223372036854775808
49
select min(big),max(big),max(big)-1 from t1;
50
min(big) max(big) max(big)-1
51
-9223372036854775808 9223372036854775807 9223372036854775806
52
select min(big),max(big),max(big)-1 from t1 group by a;
53
min(big) max(big) max(big)-1
54
-9223372036854775808 9223372036854775807 9223372036854775806
55
alter table t1 modify big bigint not null;
56
select min(big),max(big),max(big)-1 from t1;
57
min(big) max(big) max(big)-1
58
-9223372036854775808 9223372036854775807 9223372036854775806
59
select min(big),max(big),max(big)-1 from t1 group by a;
60
min(big) max(big) max(big)-1
61
-9223372036854775808 9223372036854775807 9223372036854775806
62
insert into t1 (big) values (9223372036854775808);
66
1 -9223372036854775808
68
1 -9223372036854775808
69
1 -9223372036854775808
70
select min(big),max(big),max(big)-1 from t1;
71
min(big) max(big) max(big)-1
72
-9223372036854775808 9223372036854775807 9223372036854775806
73
select min(big),max(big),max(big)-1 from t1 group by a;
74
min(big) max(big) max(big)-1
75
-9223372036854775808 9223372036854775807 9223372036854775806
76
alter table t1 add key (big);
77
select min(big),max(big),max(big)-1 from t1;
78
min(big) max(big) max(big)-1
79
-9223372036854775808 9223372036854775807 9223372036854775806
80
select min(big),max(big),max(big)-1 from t1 group by a;
81
min(big) max(big) max(big)-1
82
-9223372036854775808 9223372036854775807 9223372036854775806
83
alter table t1 modify big bigint not null;
87
1 -9223372036854775808
89
1 -9223372036854775808
90
1 -9223372036854775808
91
select min(big),max(big),max(big)-1 from t1;
92
min(big) max(big) max(big)-1
93
-9223372036854775808 9223372036854775807 9223372036854775806
94
select min(big),max(big),max(big)-1 from t1 group by a;
95
min(big) max(big) max(big)-1
96
-9223372036854775808 9223372036854775807 9223372036854775806
98
create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999;
99
insert into t1 values (null,1);
103
select * from t1 limit 9999999999;
107
CREATE TABLE t1 ( quantity decimal(60,0));
108
insert into t1 values (10000000000000000000);
109
insert into t1 values (10000000000000000000.0);
110
insert into t1 values ('10000000000000000000');
117
SELECT '0x8000000000000001'+0;
118
'0x8000000000000001'+0
121
Warning 1292 Truncated incorrect DOUBLE value: '0x8000000000000001'
123
value64 bigint not null,
124
value32 integer not null,
125
primary key(value64, value32)
128
value64 bigint not null,
129
value32 integer not null,
130
primary key(value64, value32)
132
insert into t1 values(17156792991891826145, 1);
133
insert into t1 values( 9223372036854775807, 2);
134
insert into t2 values(17156792991891826145, 3);
135
insert into t2 values( 9223372036854775807, 4);
138
-1289951081817725471 1
139
9223372036854775807 2
142
-1289951081817725471 3
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;
154
value64 value32 value64 value32
155
9223372036854775807 2 9223372036854775807 4
156
select * from t1, t2 where t1.value64= 9223372036854775807 and
157
t2.value64=t1.value64;
158
value64 value32 value64 value32
159
9223372036854775807 2 9223372036854775807 4
161
create table t1 (sint64 bigint not null);
162
insert into t1 values (-9223372036854775808);
167
create table t1 select 1 as 'a';
168
show create table t1;
170
t1 CREATE TABLE `t1` (
174
create table t1 select 9223372036854775809 as 'a';
175
show create table t1;
177
t1 CREATE TABLE `t1` (
184
DROP DATABASE IF EXISTS `scott`;
186
Note 1008 Can't drop database 'scott'; database doesn't exist
187
create table t1 (a char(100), b varchar(100), c text, d blob);
188
insert into t1 values(
189
18446744073709551615,18446744073709551615,
190
18446744073709551615, 18446744073709551615
192
insert into t1 values (-1,-1,-1,-1);
195
18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
198
create table t1 ( quantity decimal(2));
199
insert into t1 values (50), (-50), (0), (-1);
226
`col19` DECIMAL(19, 0) NULL,
227
`col20` DECIMAL(20, 0) NULL,
228
`col21` DECIMAL(21, 0) NULL,
229
`col22` DECIMAL(22, 0) NULL,
230
`col23` DECIMAL(23, 0) NULL,
231
`col24` DECIMAL(24, 0) NULL,
232
`col25` DECIMAL(25, 0) NULL,
233
`col26` DECIMAL(26, 0) NULL,
234
`col27` DECIMAL(27, 0) NULL,
235
`col28` DECIMAL(28, 0) NULL,
236
`col29` DECIMAL(29, 0) NULL,
237
`col30` DECIMAL(30, 0) NULL,
238
`col31` DECIMAL(31, 0) NULL,
239
`col32` DECIMAL(32, 0) NULL,
240
`col33` DECIMAL(33, 0) NULL,
241
`col34` DECIMAL(34, 0) NULL,
242
`col35` DECIMAL(35, 0) NULL,
243
`col36` DECIMAL(36, 0) NULL,
244
`col37` DECIMAL(37, 0) NULL,
245
`col38` DECIMAL(38, 0) NULL,
246
`fix1` DECIMAL(38, 1) NULL,
247
`fix2` DECIMAL(38, 2) NULL,
248
`fix3` DECIMAL(38, 3) NULL,
249
`fix4` DECIMAL(38, 4) NULL,
250
`fix5` DECIMAL(38, 5) NULL,
251
`fix6` DECIMAL(38, 6) NULL,
252
`fix7` DECIMAL(38, 7) NULL,
253
`fix8` DECIMAL(38, 8) NULL,
254
`fix9` DECIMAL(38, 9) NULL,
255
`fix10` DECIMAL(38, 10) NULL,
256
`fix11` DECIMAL(38, 11) NULL,
257
`fix12` DECIMAL(38, 12) NULL,
258
`fix13` DECIMAL(38, 13) NULL,
259
`fix14` DECIMAL(38, 14) NULL,
260
`fix15` DECIMAL(38, 15) NULL,
261
`fix16` DECIMAL(38, 16) NULL,
262
`fix17` DECIMAL(38, 17) NULL,
263
`fix18` DECIMAL(38, 18) NULL,
264
`fix19` DECIMAL(38, 19) NULL,
265
`fix20` DECIMAL(38, 20) NULL,
266
`fix21` DECIMAL(38, 21) NULL,
267
`fix22` DECIMAL(38, 22) NULL,
268
`fix23` DECIMAL(38, 23) NULL,
269
`fix24` DECIMAL(38, 24) NULL,
270
`fix25` DECIMAL(38, 25) NULL,
271
`fix26` DECIMAL(38, 26) NULL,
272
`fix27` DECIMAL(38, 27) NULL,
273
`fix28` DECIMAL(38, 28) NULL,
274
`fix29` DECIMAL(38, 29) NULL,
275
`fix30` DECIMAL(38, 30) NULL
277
INSERT INTO t1(`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`)
278
VALUES (9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999,
279
9999999999, 99999999999, 999999999999, 9999999999999, 99999999999999,
280
999999999999999, 9999999999999999, 99999999999999999, 999999999999999999,
281
9999999999999999999, 99999999999999999999, 999999999999999999999,
282
9999999999999999999999, 99999999999999999999999, 999999999999999999999999,
283
9999999999999999999999999, 99999999999999999999999999,
284
999999999999999999999999999, 9999999999999999999999999999,
285
99999999999999999999999999999, 999999999999999999999999999999,
286
9999999999999999999999999999999, 99999999999999999999999999999999,
287
999999999999999999999999999999999, 9999999999999999999999999999999999,
288
99999999999999999999999999999999999, 999999999999999999999999999999999999,
289
9999999999999999999999999999999999999, 99999999999999999999999999999999999999,
290
9999999999999999999999999999999999999.9,
291
999999999999999999999999999999999999.99,
292
99999999999999999999999999999999999.999,
293
9999999999999999999999999999999999.9999,
294
999999999999999999999999999999999.99999,
295
99999999999999999999999999999999.999999,
296
9999999999999999999999999999999.9999999,
297
999999999999999999999999999999.99999999,
298
99999999999999999999999999999.999999999,
299
9999999999999999999999999999.9999999999,
300
999999999999999999999999999.99999999999,
301
99999999999999999999999999.999999999999,
302
9999999999999999999999999.9999999999999,
303
999999999999999999999999.99999999999999,
304
99999999999999999999999.999999999999999,
305
9999999999999999999999.9999999999999999,
306
999999999999999999999.99999999999999999,
307
99999999999999999999.999999999999999999,
308
9999999999999999999.9999999999999999999,
309
999999999999999999.99999999999999999999,
310
99999999999999999.999999999999999999999,
311
9999999999999999.9999999999999999999999,
312
999999999999999.99999999999999999999999,
313
99999999999999.999999999999999999999999,
314
9999999999999.9999999999999999999999999,
315
999999999999.99999999999999999999999999,
316
99999999999.999999999999999999999999999,
317
9999999999.9999999999999999999999999999,
318
999999999.99999999999999999999999999999,
319
99999999.999999999999999999999999999999);
321
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
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);
325
insert into t1 values (17666000000000000000);
326
select * from t1 where bigint_col=17666000000000000000;
329
select * from t1 where bigint_col='17666000000000000000';
333
bug 19955 -- mod is signed with bigint
334
select 10000002383263201056 mod 50 as result;
337
create table t1 (c1 bigint);
338
insert into t1 values (10000002383263201056);
339
select c1 mod 50 as result from t1;
343
select -9223372036854775808;
344
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
345
def -9223372036854775808 5 20 20 N 32897 0 63
348
select -(9223372036854775808);
349
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
350
def -(9223372036854775808) 5 20 20 N 32897 0 63
351
-(9223372036854775808)
353
select -((9223372036854775808));
354
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
355
def -((9223372036854775808)) 5 20 20 N 32897 0 63
356
-((9223372036854775808))
358
select -(-(9223372036854775808));
359
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
360
def -(-(9223372036854775808)) 11 21 19 N 129 0 63
361
-(-(9223372036854775808))
363
select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
364
--9223372036854775808 ---9223372036854775808 ----9223372036854775808
365
9223372036854775808 -9223372036854775808 9223372036854775808
366
select -(-9223372036854775808), -(-(-9223372036854775808));
367
-(-9223372036854775808) -(-(-9223372036854775808))
368
9223372036854775808 -9223372036854775808
369
create table t1 select -9223372036854775808 bi;
371
Field Type Null Key Default Extra
374
create table t1 select -9223372036854775809 bi;
376
Field Type Null Key Default Extra
377
bi decimal(19,0) NO NULL