1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
|
########################
# Fixed point columns (NUMERIC, DECIMAL)
########################
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
d DECIMAL UNSIGNED,
d0 DECIMAL(0) UNSIGNED,
d1_1 DECIMAL(1,1) UNSIGNED,
d10_2 DECIMAL(10,2) UNSIGNED,
d60_10 DECIMAL(60,10) UNSIGNED,
n NUMERIC UNSIGNED,
n0_0 NUMERIC(0,0) UNSIGNED,
n1 NUMERIC(1) UNSIGNED,
n20_4 NUMERIC(20,4) UNSIGNED,
n65_4 NUMERIC(65,4) UNSIGNED,
pk NUMERIC UNSIGNED PRIMARY KEY
) ENGINE=rocksdb;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
d decimal(10,0) unsigned YES NULL
d0 decimal(10,0) unsigned YES NULL
d1_1 decimal(1,1) unsigned YES NULL
d10_2 decimal(10,2) unsigned YES NULL
d60_10 decimal(60,10) unsigned YES NULL
n decimal(10,0) unsigned YES NULL
n0_0 decimal(10,0) unsigned YES NULL
n1 decimal(1,0) unsigned YES NULL
n20_4 decimal(20,4) unsigned YES NULL
n65_4 decimal(65,4) unsigned YES NULL
pk decimal(10,0) unsigned NO PRI NULL
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
Warnings:
Warning 1264 Out of range value for column 'd' at row 1
Warning 1264 Out of range value for column 'd0' at row 1
Warning 1264 Out of range value for column 'd1_1' at row 1
Warning 1264 Out of range value for column 'd10_2' at row 1
Warning 1264 Out of range value for column 'd60_10' at row 1
Warning 1264 Out of range value for column 'n' at row 1
Warning 1264 Out of range value for column 'n0_0' at row 1
Warning 1264 Out of range value for column 'n1' at row 1
Warning 1264 Out of range value for column 'n20_4' at row 1
Warning 1264 Out of range value for column 'n65_4' at row 1
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
Warnings:
Warning 1264 Out of range value for column 'd' at row 1
Warning 1264 Out of range value for column 'd0' at row 1
Warning 1264 Out of range value for column 'd1_1' at row 1
Warning 1264 Out of range value for column 'd10_2' at row 1
Warning 1264 Out of range value for column 'd60_10' at row 1
Warning 1264 Out of range value for column 'n' at row 1
Warning 1264 Out of range value for column 'n0_0' at row 1
Warning 1264 Out of range value for column 'n1' at row 1
Warning 1264 Out of range value for column 'n20_4' at row 1
Warning 1264 Out of range value for column 'n65_4' at row 1
SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
6
);
Warnings:
Warning 1264 Out of range value for column 'd' at row 1
Warning 1264 Out of range value for column 'd0' at row 1
Warning 1264 Out of range value for column 'd1_1' at row 1
Warning 1264 Out of range value for column 'd10_2' at row 1
Warning 1264 Out of range value for column 'd60_10' at row 1
Warning 1264 Out of range value for column 'n' at row 1
Warning 1264 Out of range value for column 'n0_0' at row 1
Warning 1264 Out of range value for column 'n1' at row 1
Warning 1264 Out of range value for column 'n20_4' at row 1
SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
Warnings:
Warning 1264 Out of range value for column 'd' at row 1
Warning 1264 Out of range value for column 'd0' at row 1
Warning 1264 Out of range value for column 'd1_1' at row 1
Warning 1264 Out of range value for column 'd10_2' at row 1
Warning 1264 Out of range value for column 'd60_10' at row 1
Warning 1264 Out of range value for column 'n' at row 1
Warning 1264 Out of range value for column 'n0_0' at row 1
Warning 1264 Out of range value for column 'n1' at row 1
Warning 1264 Out of range value for column 'n20_4' at row 1
Warning 1264 Out of range value for column 'n65_4' at row 1
SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
Warnings:
Note 1265 Data truncated for column 'd' at row 1
Note 1265 Data truncated for column 'd0' at row 1
Warning 1264 Out of range value for column 'd1_1' at row 1
Note 1265 Data truncated for column 'd10_2' at row 1
Note 1265 Data truncated for column 'd60_10' at row 1
Note 1265 Data truncated for column 'n' at row 1
Note 1265 Data truncated for column 'n0_0' at row 1
Note 1265 Data truncated for column 'n1' at row 1
Note 1265 Data truncated for column 'n20_4' at row 1
Note 1265 Data truncated for column 'n65_4' at row 1
SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000
100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000
9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) UNSIGNED;
ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) UNSIGNED;
ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) UNSIGNED;
ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 38
DROP TABLE t1;
CREATE TABLE t1 (
a DECIMAL UNSIGNED,
b NUMERIC UNSIGNED,
PRIMARY KEY (a)
) ENGINE=rocksdb;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
a decimal(10,0) unsigned NO PRI NULL
b decimal(10,0) unsigned YES NULL
INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
Warnings:
Warning 1264 Out of range value for column 'b' at row 1
INSERT INTO t1 (a,b) VALUES (-100,100);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
SELECT a,b FROM t1;
a b
0 100
1 0
DROP TABLE t1;
########################
# Floating point columns (FLOAT, DOUBLE)
########################
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f FLOAT UNSIGNED,
f0 FLOAT(0) UNSIGNED,
r1_1 REAL(1,1) UNSIGNED,
f23_0 FLOAT(23) UNSIGNED,
f20_3 FLOAT(20,3) UNSIGNED,
d DOUBLE UNSIGNED,
d1_0 DOUBLE(1,0) UNSIGNED,
d10_10 DOUBLE PRECISION (10,10) UNSIGNED,
d53 DOUBLE(53,0) UNSIGNED,
d53_10 DOUBLE(53,10) UNSIGNED,
pk DOUBLE UNSIGNED PRIMARY KEY
) ENGINE=rocksdb;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
f float unsigned YES NULL
f0 float unsigned YES NULL
r1_1 double(1,1) unsigned YES NULL
f23_0 float unsigned YES NULL
f20_3 float(20,3) unsigned YES NULL
d double unsigned YES NULL
d1_0 double(1,0) unsigned YES NULL
d10_10 double(10,10) unsigned YES NULL
d53 double(53,0) unsigned YES NULL
d53_10 double(53,10) unsigned YES NULL
pk double unsigned NO PRI NULL
INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
f 12345.1
d 11111111.111
d10_10 0.0123456789
d1_0 8
d53 1234566789123456800
d53_10 100000000000000000.0000000000
f0 12345.1
f20_3 56789.988
f23_0 123457000
r1_1 0.9
INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
99999999999999999999999999999999999999,
99999999999999999999999999999999999999.9999999999999999,
0.9,
99999999999999999999999999999999999999.9,
99999999999999999.999,
999999999999999999999999999999999999999999999999999999999999999999999999999999999,
9,
0.9999999999,
1999999999999999999999999999999999999999999999999999999,
19999999999999999999999999999999999999999999.9999999999,
3
);
Warnings:
Warning 1264 Out of range value for column 'd53' at row 1
Warning 1264 Out of range value for column 'd53_10' at row 1
SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
f 12345.1
d 0
d 11111111.111
d 1e81
d10_10 0.0000000000
d10_10 0.0123456789
d10_10 0.9999999999
d1_0 0
d1_0 8
d1_0 9
d53 0
d53 100000000000000000000000000000000000000000000000000000
d53 1234566789123456800
d53_10 0.0000000000
d53_10 100000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
f 0
f 1e38
f0 0
f0 12345.1
f0 1e38
f20_3 0.000
f20_3 56789.988
f20_3 99999998430674940.000
f23_0 0
f23_0 123457000
f23_0 1e38
r1_1 0.0
r1_1 0.9
r1_1 0.9
INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'f0' at row 1
Warning 1264 Out of range value for column 'r1_1' at row 1
Warning 1264 Out of range value for column 'f23_0' at row 1
Warning 1264 Out of range value for column 'f20_3' at row 1
Warning 1264 Out of range value for column 'd' at row 1
Warning 1264 Out of range value for column 'd1_0' at row 1
Warning 1264 Out of range value for column 'd10_10' at row 1
Warning 1264 Out of range value for column 'd53' at row 1
Warning 1264 Out of range value for column 'd53_10' at row 1
SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
f 12345.1
d 0
d 0
d 11111111.111
d 1e81
d10_10 0.0000000000
d10_10 0.0000000000
d10_10 0.0123456789
d10_10 0.9999999999
d1_0 0
d1_0 0
d1_0 8
d1_0 9
d53 0
d53 0
d53 100000000000000000000000000000000000000000000000000000
d53 1234566789123456800
d53_10 0.0000000000
d53_10 0.0000000000
d53_10 100000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
f 0
f 0
f 1e38
f0 0
f0 0
f0 12345.1
f0 1e38
f20_3 0.000
f20_3 0.000
f20_3 56789.988
f20_3 99999998430674940.000
f23_0 0
f23_0 0
f23_0 123457000
f23_0 1e38
r1_1 0.0
r1_1 0.0
r1_1 0.9
r1_1 0.9
SELECT
CONCAT('', MAX(f)),
CONCAT('', MAX(f0)),
CONCAT('', MAX(r1_1)),
CONCAT('', MAX(f23_0)),
CONCAT('', MAX(f20_3)),
CONCAT('', MAX(d)),
CONCAT('', MAX(d1_0)),
CONCAT('', MAX(d10_10)),
CONCAT('', MAX(d53)),
CONCAT('', MAX(d53_10)) FROM t1;
CONCAT('', MAX(f)) 1e38
CONCAT('', MAX(d)) 1e81
CONCAT('', MAX(d10_10)) 0.9999999999
CONCAT('', MAX(d1_0)) 9
CONCAT('', MAX(d53)) 100000000000000000000000000000000000000000000000000000
CONCAT('', MAX(d53_10)) 10000000000000000000000000000000000000000000.0000000000
CONCAT('', MAX(f0)) 1e38
CONCAT('', MAX(f20_3)) 99999998430674940.000
CONCAT('', MAX(f23_0)) 1e38
CONCAT('', MAX(r1_1)) 0.9
INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
9999999999999999999999999999999999999999999999999999999999999.9999,
5
);
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'f0' at row 1
Warning 1264 Out of range value for column 'r1_1' at row 1
Warning 1264 Out of range value for column 'f23_0' at row 1
Warning 1264 Out of range value for column 'f20_3' at row 1
Warning 1264 Out of range value for column 'd1_0' at row 1
Warning 1264 Out of range value for column 'd10_10' at row 1
Warning 1264 Out of range value for column 'd53' at row 1
Warning 1264 Out of range value for column 'd53_10' at row 1
SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
f 12345.1
d 0
d 0
d 11111111.111
d 1e61
d 1e81
d10_10 0.0000000000
d10_10 0.0000000000
d10_10 0.0123456789
d10_10 0.9999999999
d10_10 0.9999999999
d1_0 0
d1_0 0
d1_0 8
d1_0 9
d1_0 9
d53 0
d53 0
d53 100000000000000000000000000000000000000000000000000000
d53 100000000000000000000000000000000000000000000000000000
d53 1234566789123456800
d53_10 0.0000000000
d53_10 0.0000000000
d53_10 100000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
f 0
f 0
f 1e38
f 3.40282e38
f0 0
f0 0
f0 12345.1
f0 1e38
f0 3.40282e38
f20_3 0.000
f20_3 0.000
f20_3 56789.988
f20_3 99999998430674940.000
f20_3 99999998430674940.000
f23_0 0
f23_0 0
f23_0 123457000
f23_0 1e38
f23_0 3.40282e38
r1_1 0.0
r1_1 0.0
r1_1 0.9
r1_1 0.9
r1_1 0.9
INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
999999999999999999999999999999999999999,
999999999999999999999999999999999999999.9999999999999999,
1.9,
999999999999999999999999999999999999999.9,
999999999999999999.999,
9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
99,
1.9999999999,
1999999999999999999999999999999999999999999999999999999,
19999999999999999999999999999999999999999999.9999999999,
6
);
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'f0' at row 1
Warning 1264 Out of range value for column 'r1_1' at row 1
Warning 1264 Out of range value for column 'f23_0' at row 1
Warning 1264 Out of range value for column 'f20_3' at row 1
Warning 1264 Out of range value for column 'd1_0' at row 1
Warning 1264 Out of range value for column 'd10_10' at row 1
Warning 1264 Out of range value for column 'd53' at row 1
Warning 1264 Out of range value for column 'd53_10' at row 1
SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
f 12345.1
d 0
d 0
d 11111111.111
d 1e61
d 1e65
d 1e81
d10_10 0.0000000000
d10_10 0.0000000000
d10_10 0.0123456789
d10_10 0.9999999999
d10_10 0.9999999999
d10_10 0.9999999999
d1_0 0
d1_0 0
d1_0 8
d1_0 9
d1_0 9
d1_0 9
d53 0
d53 0
d53 100000000000000000000000000000000000000000000000000000
d53 100000000000000000000000000000000000000000000000000000
d53 100000000000000000000000000000000000000000000000000000
d53 1234566789123456800
d53_10 0.0000000000
d53_10 0.0000000000
d53_10 100000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
d53_10 10000000000000000000000000000000000000000000.0000000000
f 0
f 0
f 1e38
f 3.40282e38
f 3.40282e38
f0 0
f0 0
f0 12345.1
f0 1e38
f0 3.40282e38
f0 3.40282e38
f20_3 0.000
f20_3 0.000
f20_3 56789.988
f20_3 99999998430674940.000
f20_3 99999998430674940.000
f20_3 99999998430674940.000
f23_0 0
f23_0 0
f23_0 123457000
f23_0 1e38
f23_0 3.40282e38
f23_0 3.40282e38
r1_1 0.0
r1_1 0.0
r1_1 0.9
r1_1 0.9
r1_1 0.9
r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) UNSIGNED;
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) UNSIGNED;
ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) UNSIGNED;
DROP TABLE t1;
CREATE TABLE t1 (
a DOUBLE UNSIGNED,
b FLOAT UNSIGNED,
PRIMARY KEY (b)
) ENGINE=rocksdb;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
a double unsigned YES NULL
b float unsigned NO PRI NULL
INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
Warnings:
Warning 1264 Out of range value for column 'b' at row 1
INSERT INTO t1 (a,b) VALUES (-100,100);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
SELECT a,b FROM t1;
a b
0 100
1 0
DROP TABLE t1;
########################
# INT columns
########################
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
i INT UNSIGNED,
i0 INT(0) UNSIGNED,
i1 INT(1) UNSIGNED,
i20 INT(20) UNSIGNED,
t TINYINT UNSIGNED,
t0 TINYINT(0) UNSIGNED,
t1 TINYINT(1) UNSIGNED,
t20 TINYINT(20) UNSIGNED,
s SMALLINT UNSIGNED,
s0 SMALLINT(0) UNSIGNED,
s1 SMALLINT(1) UNSIGNED,
s20 SMALLINT(20) UNSIGNED,
m MEDIUMINT UNSIGNED,
m0 MEDIUMINT(0) UNSIGNED,
m1 MEDIUMINT(1) UNSIGNED,
m20 MEDIUMINT(20) UNSIGNED,
b BIGINT UNSIGNED,
b0 BIGINT(0) UNSIGNED,
b1 BIGINT(1) UNSIGNED,
b20 BIGINT(20) UNSIGNED,
pk INT AUTO_INCREMENT PRIMARY KEY
) ENGINE=rocksdb;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
i int(10) unsigned YES NULL
i0 int(10) unsigned YES NULL
i1 int(1) unsigned YES NULL
i20 int(20) unsigned YES NULL
t tinyint(3) unsigned YES NULL
t0 tinyint(3) unsigned YES NULL
t1 tinyint(1) unsigned YES NULL
t20 tinyint(20) unsigned YES NULL
s smallint(5) unsigned YES NULL
s0 smallint(5) unsigned YES NULL
s1 smallint(1) unsigned YES NULL
s20 smallint(20) unsigned YES NULL
m mediumint(8) unsigned YES NULL
m0 mediumint(8) unsigned YES NULL
m1 mediumint(1) unsigned YES NULL
m20 mediumint(20) unsigned YES NULL
b bigint(20) unsigned YES NULL
b0 bigint(20) unsigned YES NULL
b1 bigint(1) unsigned YES NULL
b20 bigint(20) unsigned YES NULL
pk int(11) NO PRI NULL auto_increment
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
Warning 1264 Out of range value for column 'i0' at row 1
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i20' at row 1
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 't0' at row 1
Warning 1264 Out of range value for column 't1' at row 1
Warning 1264 Out of range value for column 't20' at row 1
Warning 1264 Out of range value for column 's' at row 1
Warning 1264 Out of range value for column 's0' at row 1
Warning 1264 Out of range value for column 's1' at row 1
Warning 1264 Out of range value for column 's20' at row 1
Warning 1264 Out of range value for column 'm' at row 1
Warning 1264 Out of range value for column 'm0' at row 1
Warning 1264 Out of range value for column 'm1' at row 1
Warning 1264 Out of range value for column 'm20' at row 1
Warning 1264 Out of range value for column 'b' at row 1
Warning 1264 Out of range value for column 'b0' at row 1
Warning 1264 Out of range value for column 'b1' at row 1
Warning 1264 Out of range value for column 'b20' at row 1
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807
4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
Warning 1264 Out of range value for column 'i0' at row 1
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i20' at row 1
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 't0' at row 1
Warning 1264 Out of range value for column 't1' at row 1
Warning 1264 Out of range value for column 't20' at row 1
Warning 1264 Out of range value for column 's' at row 1
Warning 1264 Out of range value for column 's0' at row 1
Warning 1264 Out of range value for column 's1' at row 1
Warning 1264 Out of range value for column 's20' at row 1
Warning 1264 Out of range value for column 'm' at row 1
Warning 1264 Out of range value for column 'm0' at row 1
Warning 1264 Out of range value for column 'm1' at row 1
Warning 1264 Out of range value for column 'm20' at row 1
Warning 1264 Out of range value for column 'b' at row 1
Warning 1264 Out of range value for column 'b0' at row 1
Warning 1264 Out of range value for column 'b1' at row 1
Warning 1264 Out of range value for column 'b20' at row 1
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
Warning 1264 Out of range value for column 'i0' at row 1
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i20' at row 1
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 't0' at row 1
Warning 1264 Out of range value for column 't1' at row 1
Warning 1264 Out of range value for column 't20' at row 1
Warning 1264 Out of range value for column 's' at row 1
Warning 1264 Out of range value for column 's0' at row 1
Warning 1264 Out of range value for column 's1' at row 1
Warning 1264 Out of range value for column 's20' at row 1
Warning 1264 Out of range value for column 'm' at row 1
Warning 1264 Out of range value for column 'm0' at row 1
Warning 1264 Out of range value for column 'm1' at row 1
Warning 1264 Out of range value for column 'm20' at row 1
Warning 1264 Out of range value for column 'b' at row 1
Warning 1264 Out of range value for column 'b0' at row 1
Warning 1264 Out of range value for column 'b1' at row 1
Warning 1264 Out of range value for column 'b20' at row 1
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
Warning 1264 Out of range value for column 'i0' at row 1
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i20' at row 1
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 't0' at row 1
Warning 1264 Out of range value for column 't1' at row 1
Warning 1264 Out of range value for column 't20' at row 1
Warning 1264 Out of range value for column 's' at row 1
Warning 1264 Out of range value for column 's0' at row 1
Warning 1264 Out of range value for column 's1' at row 1
Warning 1264 Out of range value for column 's20' at row 1
Warning 1264 Out of range value for column 'm' at row 1
Warning 1264 Out of range value for column 'm0' at row 1
Warning 1264 Out of range value for column 'm1' at row 1
Warning 1264 Out of range value for column 'm20' at row 1
Warning 1264 Out of range value for column 'i' at row 2
Warning 1264 Out of range value for column 'i0' at row 2
Warning 1264 Out of range value for column 'i1' at row 2
Warning 1264 Out of range value for column 'i20' at row 2
Warning 1264 Out of range value for column 't' at row 2
Warning 1264 Out of range value for column 't0' at row 2
Warning 1264 Out of range value for column 't1' at row 2
Warning 1264 Out of range value for column 't20' at row 2
Warning 1264 Out of range value for column 's' at row 2
Warning 1264 Out of range value for column 's0' at row 2
Warning 1264 Out of range value for column 's1' at row 2
Warning 1264 Out of range value for column 's20' at row 2
Warning 1264 Out of range value for column 'm' at row 2
Warning 1264 Out of range value for column 'm0' at row 2
Warning 1264 Out of range value for column 'm1' at row 2
Warning 1264 Out of range value for column 'm20' at row 2
Warning 1264 Out of range value for column 'i' at row 3
Warning 1264 Out of range value for column 'i0' at row 3
Warning 1264 Out of range value for column 'i1' at row 3
Warning 1264 Out of range value for column 'i20' at row 3
Warning 1264 Out of range value for column 't' at row 3
Warning 1264 Out of range value for column 't0' at row 3
Warning 1264 Out of range value for column 't1' at row 3
Warning 1264 Out of range value for column 't20' at row 3
Warning 1264 Out of range value for column 's' at row 3
Warning 1264 Out of range value for column 's0' at row 3
Warning 1264 Out of range value for column 's1' at row 3
Warning 1264 Out of range value for column 's20' at row 3
Warning 1264 Out of range value for column 'm' at row 3
Warning 1264 Out of range value for column 'm0' at row 3
Warning 1264 Out of range value for column 'm1' at row 3
Warning 1264 Out of range value for column 'm20' at row 3
SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807
4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615
4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807
ALTER TABLE t1 ADD COLUMN i257 INT(257) UNSIGNED;
ERROR 42000: Display width out of range for 'i257' (max = 255)
DROP TABLE t1;
CREATE TABLE t1 (
t TINYINT UNSIGNED,
s SMALLINT UNSIGNED,
m MEDIUMINT UNSIGNED,
i INT UNSIGNED,
b BIGINT UNSIGNED,
PRIMARY KEY (b)
) ENGINE=rocksdb;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
t tinyint(3) unsigned YES NULL
s smallint(5) unsigned YES NULL
m mediumint(8) unsigned YES NULL
i int(10) unsigned YES NULL
b bigint(20) unsigned NO PRI NULL
INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615);
INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1);
Warnings:
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 's' at row 1
Warning 1264 Out of range value for column 'm' at row 1
Warning 1264 Out of range value for column 'i' at row 1
Warning 1264 Out of range value for column 'b' at row 1
SELECT t,s,m,i,b FROM t1;
t s m i b
0 0 0 0 0
255 65535 16777215 4294967295 18446744073709551615
DROP TABLE t1;
|