46
46
drop table t1;
47
47
create table t1 ( a int not null default 1, big bigint );
48
48
insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
49
+ Warnings:
50
+ Warning 1264 Out of range value adjusted for column 'big' at row 4
51
+ select * from t1;
52
+ a big
53
+ 1 -1
54
+ 1 12345678901234567
55
+ 1 9223372036854775807
56
+ 1 9223372036854775807
49
57
select min(big),max(big),max(big)-1 from t1;
50
58
min(big) max(big) max(big)-1
51
59
-1 9223372036854775807 9223372036854775806
52
60
select min(big),max(big),max(big)-1 from t1 group by a;
53
61
min(big) max(big) max(big)-1
54
62
-1 9223372036854775807 9223372036854775806
55
63
alter table t1 modify big bigint unsigned not null;
64
+ Warnings:
65
+ Warning 1264 Out of range value adjusted for column 'big' at row 1
66
+ select min(big),max(big),max(big)-1 from t1;
67
+ min(big) max(big) max(big)-1
68
+ 0 9223372036854775807 9223372036854775806
69
+ select min(big),max(big),max(big)-1 from t1 group by a;
70
+ min(big) max(big) max(big)-1
71
+ 0 9223372036854775807 9223372036854775806
72
+ insert into t1 (big) values (18446744073709551615);
73
+ select * from t1;
74
+ a big
75
+ 1 0
76
+ 1 12345678901234567
77
+ 1 9223372036854775807
78
+ 1 9223372036854775807
79
+ 1 18446744073709551615
56
80
select min(big),max(big),max(big)-1 from t1;
57
81
min(big) max(big) max(big)-1
58
- 12345678901234567 18446744073709551615 18446744073709551614
82
+ 0 18446744073709551615 18446744073709551614
59
83
select min(big),max(big),max(big)-1 from t1 group by a;
60
84
min(big) max(big) max(big)-1
61
- 12345678901234567 18446744073709551615 18446744073709551614
85
+ 0 18446744073709551615 18446744073709551614
62
86
alter table t1 add key (big);
63
87
select min(big),max(big),max(big)-1 from t1;
64
88
min(big) max(big) max(big)-1
65
- 12345678901234567 18446744073709551615 18446744073709551614
89
+ 0 18446744073709551615 18446744073709551614
66
90
select min(big),max(big),max(big)-1 from t1 group by a;
67
91
min(big) max(big) max(big)-1
68
- 12345678901234567 18446744073709551615 18446744073709551614
92
+ 0 18446744073709551615 18446744073709551614
69
93
alter table t1 modify big bigint not null;
94
+ Warnings:
95
+ Warning 1264 Out of range value adjusted for column 'big' at row 5
96
+ select * from t1;
97
+ a big
98
+ 1 0
99
+ 1 12345678901234567
100
+ 1 9223372036854775807
101
+ 1 9223372036854775807
102
+ 1 9223372036854775807
70
103
select min(big),max(big),max(big)-1 from t1;
71
104
min(big) max(big) max(big)-1
72
- -1 9223372036854775807 9223372036854775806
105
+ 0 9223372036854775807 9223372036854775806
73
106
select min(big),max(big),max(big)-1 from t1 group by a;
74
107
min(big) max(big) max(big)-1
75
- -1 9223372036854775807 9223372036854775806
108
+ 0 9223372036854775807 9223372036854775806
76
109
drop table t1;
77
110
create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999;
78
111
insert into t1 values (null,1);
@@ -89,7 +122,7 @@ insert into t1 values (10000000000000000000.0);
89
122
insert into t1 values ('10000000000000000000');
90
123
select * from t1;
91
124
quantity
92
- -8446744073709551616
125
+ 10000000000000000000
93
126
10000000000000000000
94
127
10000000000000000000
95
128
drop table t1;
@@ -154,3 +187,148 @@ select * from t1;
154
187
a
155
188
9223372036854775809
156
189
drop table t1;
190
+ DROP DATABASE IF EXISTS `scott`;
191
+ Warnings:
192
+ Note 1008 Can't drop database 'scott'; database doesn't exist
193
+ create table t1 (a char(100), b varchar(100), c text, d blob);
194
+ insert into t1 values(
195
+ 18446744073709551615,18446744073709551615,
196
+ 18446744073709551615, 18446744073709551615
197
+ );
198
+ insert into t1 values (-1 | 0,-1 | 0,-1 | 0 ,-1 | 0);
199
+ select * from t1;
200
+ a b c d
201
+ 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
202
+ 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
203
+ drop table t1;
204
+ create table t1 ( quantity decimal(2) unsigned);
205
+ insert into t1 values (500), (-500), (~0), (-1);
206
+ Warnings:
207
+ Warning 1264 Out of range value adjusted for column 'quantity' at row 1
208
+ Warning 1264 Out of range value adjusted for column 'quantity' at row 2
209
+ Warning 1264 Out of range value adjusted for column 'quantity' at row 3
210
+ Warning 1264 Out of range value adjusted for column 'quantity' at row 4
211
+ select * from t1;
212
+ quantity
213
+ 99
214
+ 0
215
+ 99
216
+ 0
217
+ drop table t1;
218
+ CREATE TABLE t1 (
219
+ `col1` INT(1) NULL,
220
+ `col2` INT(2) NULL,
221
+ `col3` INT(3) NULL,
222
+ `col4` INT(4) NULL,
223
+ `col5` INT(5) NULL,
224
+ `col6` INT(6) NULL,
225
+ `col7` INT(7) NULL,
226
+ `col8` INT(8) NULL,
227
+ `col9` INT(9) NULL,
228
+ `col10` BIGINT(10) NULL,
229
+ `col11` BIGINT(11) NULL,
230
+ `col12` BIGINT(12) NULL,
231
+ `col13` BIGINT(13) NULL,
232
+ `col14` BIGINT(14) NULL,
233
+ `col15` BIGINT(15) NULL,
234
+ `col16` BIGINT(16) NULL,
235
+ `col17` BIGINT(17) NULL,
236
+ `col18` BIGINT(18) NULL,
237
+ `col19` DECIMAL(19, 0) NULL,
238
+ `col20` DECIMAL(20, 0) NULL,
239
+ `col21` DECIMAL(21, 0) NULL,
240
+ `col22` DECIMAL(22, 0) NULL,
241
+ `col23` DECIMAL(23, 0) NULL,
242
+ `col24` DECIMAL(24, 0) NULL,
243
+ `col25` DECIMAL(25, 0) NULL,
244
+ `col26` DECIMAL(26, 0) NULL,
245
+ `col27` DECIMAL(27, 0) NULL,
246
+ `col28` DECIMAL(28, 0) NULL,
247
+ `col29` DECIMAL(29, 0) NULL,
248
+ `col30` DECIMAL(30, 0) NULL,
249
+ `col31` DECIMAL(31, 0) NULL,
250
+ `col32` DECIMAL(32, 0) NULL,
251
+ `col33` DECIMAL(33, 0) NULL,
252
+ `col34` DECIMAL(34, 0) NULL,
253
+ `col35` DECIMAL(35, 0) NULL,
254
+ `col36` DECIMAL(36, 0) NULL,
255
+ `col37` DECIMAL(37, 0) NULL,
256
+ `col38` DECIMAL(38, 0) NULL,
257
+ `fix1` DECIMAL(38, 1) NULL,
258
+ `fix2` DECIMAL(38, 2) NULL,
259
+ `fix3` DECIMAL(38, 3) NULL,
260
+ `fix4` DECIMAL(38, 4) NULL,
261
+ `fix5` DECIMAL(38, 5) NULL,
262
+ `fix6` DECIMAL(38, 6) NULL,
263
+ `fix7` DECIMAL(38, 7) NULL,
264
+ `fix8` DECIMAL(38, 8) NULL,
265
+ `fix9` DECIMAL(38, 9) NULL,
266
+ `fix10` DECIMAL(38, 10) NULL,
267
+ `fix11` DECIMAL(38, 11) NULL,
268
+ `fix12` DECIMAL(38, 12) NULL,
269
+ `fix13` DECIMAL(38, 13) NULL,
270
+ `fix14` DECIMAL(38, 14) NULL,
271
+ `fix15` DECIMAL(38, 15) NULL,
272
+ `fix16` DECIMAL(38, 16) NULL,
273
+ `fix17` DECIMAL(38, 17) NULL,
274
+ `fix18` DECIMAL(38, 18) NULL,
275
+ `fix19` DECIMAL(38, 19) NULL,
276
+ `fix20` DECIMAL(38, 20) NULL,
277
+ `fix21` DECIMAL(38, 21) NULL,
278
+ `fix22` DECIMAL(38, 22) NULL,
279
+ `fix23` DECIMAL(38, 23) NULL,
280
+ `fix24` DECIMAL(38, 24) NULL,
281
+ `fix25` DECIMAL(38, 25) NULL,
282
+ `fix26` DECIMAL(38, 26) NULL,
283
+ `fix27` DECIMAL(38, 27) NULL,
284
+ `fix28` DECIMAL(38, 28) NULL,
285
+ `fix29` DECIMAL(38, 29) NULL,
286
+ `fix30` DECIMAL(38, 30) NULL
287
+ );
288
+ 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`)
289
+ VALUES (9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999,
290
+ 9999999999, 99999999999, 999999999999, 9999999999999, 99999999999999,
291
+ 999999999999999, 9999999999999999, 99999999999999999, 999999999999999999,
292
+ 9999999999999999999, 99999999999999999999, 999999999999999999999,
293
+ 9999999999999999999999, 99999999999999999999999, 999999999999999999999999,
294
+ 9999999999999999999999999, 99999999999999999999999999,
295
+ 999999999999999999999999999, 9999999999999999999999999999,
296
+ 99999999999999999999999999999, 999999999999999999999999999999,
297
+ 9999999999999999999999999999999, 99999999999999999999999999999999,
298
+ 999999999999999999999999999999999, 9999999999999999999999999999999999,
299
+ 99999999999999999999999999999999999, 999999999999999999999999999999999999,
300
+ 9999999999999999999999999999999999999, 99999999999999999999999999999999999999,
301
+ 9999999999999999999999999999999999999.9,
302
+ 999999999999999999999999999999999999.99,
303
+ 99999999999999999999999999999999999.999,
304
+ 9999999999999999999999999999999999.9999,
305
+ 999999999999999999999999999999999.99999,
306
+ 99999999999999999999999999999999.999999,
307
+ 9999999999999999999999999999999.9999999,
308
+ 999999999999999999999999999999.99999999,
309
+ 99999999999999999999999999999.999999999,
310
+ 9999999999999999999999999999.9999999999,
311
+ 999999999999999999999999999.99999999999,
312
+ 99999999999999999999999999.999999999999,
313
+ 9999999999999999999999999.9999999999999,
314
+ 999999999999999999999999.99999999999999,
315
+ 99999999999999999999999.999999999999999,
316
+ 9999999999999999999999.9999999999999999,
317
+ 999999999999999999999.99999999999999999,
318
+ 99999999999999999999.999999999999999999,
319
+ 9999999999999999999.9999999999999999999,
320
+ 999999999999999999.99999999999999999999,
321
+ 99999999999999999.999999999999999999999,
322
+ 9999999999999999.9999999999999999999999,
323
+ 999999999999999.99999999999999999999999,
324
+ 99999999999999.999999999999999999999999,
325
+ 9999999999999.9999999999999999999999999,
326
+ 999999999999.99999999999999999999999999,
327
+ 99999999999.999999999999999999999999999,
328
+ 9999999999.9999999999999999999999999999,
329
+ 999999999.99999999999999999999999999999,
330
+ 99999999.999999999999999999999999999999);
331
+ SELECT * FROM t1;
332
+ 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
333
+ 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
334
+ DROP TABLE t1;
0 commit comments