6
# Start of WL#2649 Number-to-string conversions
11
create table t1 as select concat(1) as c1;
14
t1 CREATE TABLE `t1` (
15
`c1` varbinary(1) NOT NULL DEFAULT ''
16
) ENGINE=MyISAM DEFAULT CHARSET=latin1
17
select hex(c1) from t1;
21
select hex(concat(18446744073709551615));
22
hex(concat(18446744073709551615))
23
3138343436373434303733373039353531363135
24
create table t1 as select concat(18446744073709551615) as c1;
27
t1 CREATE TABLE `t1` (
28
`c1` varbinary(20) NOT NULL DEFAULT ''
29
) ENGINE=MyISAM DEFAULT CHARSET=latin1
30
select hex(c1) from t1;
32
3138343436373434303733373039353531363135
34
select hex(concat(1.1));
37
create table t1 as select concat(1.1) as c1;
40
t1 CREATE TABLE `t1` (
41
`c1` varbinary(4) NOT NULL DEFAULT ''
42
) ENGINE=MyISAM DEFAULT CHARSET=latin1
43
select hex(c1) from t1;
47
select hex(concat('a', 1+2)), charset(concat(1+2));
48
hex(concat('a', 1+2)) charset(concat(1+2))
50
create table t1 as select concat(1+2) as c1;
53
t1 CREATE TABLE `t1` (
54
`c1` varbinary(3) NOT NULL DEFAULT ''
55
) ENGINE=MyISAM DEFAULT CHARSET=latin1
57
select hex(concat(1-2));
60
create table t1 as select concat(1-2) as c1;
63
t1 CREATE TABLE `t1` (
64
`c1` varbinary(3) NOT NULL DEFAULT ''
65
) ENGINE=MyISAM DEFAULT CHARSET=latin1
67
select hex(concat(1*2));
70
create table t1 as select concat(1*2) as c1;
73
t1 CREATE TABLE `t1` (
74
`c1` varbinary(3) NOT NULL DEFAULT ''
75
) ENGINE=MyISAM DEFAULT CHARSET=latin1
77
select hex(concat(1/2));
80
create table t1 as select concat(1/2) as c1;
83
t1 CREATE TABLE `t1` (
84
`c1` varbinary(7) DEFAULT NULL
85
) ENGINE=MyISAM DEFAULT CHARSET=latin1
87
select hex(concat(1 div 2));
90
create table t1 as select concat(1 div 2) as c1;
93
t1 CREATE TABLE `t1` (
94
`c1` varbinary(1) DEFAULT NULL
95
) ENGINE=MyISAM DEFAULT CHARSET=latin1
97
select hex(concat(1 % 2));
100
create table t1 as select concat(1 % 2) as c1;
101
show create table t1;
103
t1 CREATE TABLE `t1` (
104
`c1` varbinary(1) DEFAULT NULL
105
) ENGINE=MyISAM DEFAULT CHARSET=latin1
107
select hex(concat(-1));
110
create table t1 as select concat(-1) as c1;
111
show create table t1;
113
t1 CREATE TABLE `t1` (
114
`c1` varbinary(2) NOT NULL DEFAULT ''
115
) ENGINE=MyISAM DEFAULT CHARSET=latin1
117
select hex(concat(-(1+2)));
120
create table t1 as select concat(-(1+2)) as c1;
121
show create table t1;
123
t1 CREATE TABLE `t1` (
124
`c1` varbinary(4) NOT NULL DEFAULT ''
125
) ENGINE=MyISAM DEFAULT CHARSET=latin1
127
select hex(concat(1|2));
130
create table t1 as select concat(1|2) as c1;
131
show create table t1;
133
t1 CREATE TABLE `t1` (
134
`c1` varbinary(21) NOT NULL DEFAULT ''
135
) ENGINE=MyISAM DEFAULT CHARSET=latin1
137
select hex(concat(1&2));
140
create table t1 as select concat(1&2) as c1;
141
show create table t1;
143
t1 CREATE TABLE `t1` (
144
`c1` varbinary(21) NOT NULL DEFAULT ''
145
) ENGINE=MyISAM DEFAULT CHARSET=latin1
147
select hex(concat(bit_count(12)));
148
hex(concat(bit_count(12)))
150
create table t1 as select concat(bit_count(12)) as c1;
151
show create table t1;
153
t1 CREATE TABLE `t1` (
154
`c1` varbinary(2) NOT NULL DEFAULT ''
155
) ENGINE=MyISAM DEFAULT CHARSET=latin1
157
select hex(concat(2<<1));
160
create table t1 as select concat(2<<1) as c1;
161
show create table t1;
163
t1 CREATE TABLE `t1` (
164
`c1` varbinary(21) NOT NULL DEFAULT ''
165
) ENGINE=MyISAM DEFAULT CHARSET=latin1
167
select hex(concat(2>>1));
170
create table t1 as select concat(2>>1) as c1;
171
show create table t1;
173
t1 CREATE TABLE `t1` (
174
`c1` varbinary(21) NOT NULL DEFAULT ''
175
) ENGINE=MyISAM DEFAULT CHARSET=latin1
177
select hex(concat(~0));
179
3138343436373434303733373039353531363135
180
create table t1 as select concat(~0) as c1;
181
show create table t1;
183
t1 CREATE TABLE `t1` (
184
`c1` varbinary(21) NOT NULL DEFAULT ''
185
) ENGINE=MyISAM DEFAULT CHARSET=latin1
187
select hex(concat(3^2));
190
create table t1 as select concat(3^2) as c1;
191
show create table t1;
193
t1 CREATE TABLE `t1` (
194
`c1` varbinary(21) NOT NULL DEFAULT ''
195
) ENGINE=MyISAM DEFAULT CHARSET=latin1
197
select hex(concat(abs(-2)));
200
create table t1 as select concat(abs(-2)) as c1;
201
show create table t1;
203
t1 CREATE TABLE `t1` (
204
`c1` varbinary(2) NOT NULL DEFAULT ''
205
) ENGINE=MyISAM DEFAULT CHARSET=latin1
207
select hex(left(concat(exp(2)),1));
208
hex(left(concat(exp(2)),1))
210
create table t1 as select concat(exp(2)) as c1;
211
show create table t1;
213
t1 CREATE TABLE `t1` (
214
`c1` varbinary(23) DEFAULT NULL
215
) ENGINE=MyISAM DEFAULT CHARSET=latin1
217
select hex(left(concat(log(2)),1));
218
hex(left(concat(log(2)),1))
220
create table t1 as select concat(log(2)) as c1;
221
show create table t1;
223
t1 CREATE TABLE `t1` (
224
`c1` varbinary(23) DEFAULT NULL
225
) ENGINE=MyISAM DEFAULT CHARSET=latin1
227
select hex(left(concat(log2(2)),1));
228
hex(left(concat(log2(2)),1))
230
create table t1 as select concat(log2(2)) as c1;
231
show create table t1;
233
t1 CREATE TABLE `t1` (
234
`c1` varbinary(23) DEFAULT NULL
235
) ENGINE=MyISAM DEFAULT CHARSET=latin1
237
select hex(left(concat(log10(2)),1));
238
hex(left(concat(log10(2)),1))
240
create table t1 as select concat(log10(2)) as c1;
241
show create table t1;
243
t1 CREATE TABLE `t1` (
244
`c1` varbinary(23) DEFAULT NULL
245
) ENGINE=MyISAM DEFAULT CHARSET=latin1
247
select hex(left(concat(sqrt(2)),1));
248
hex(left(concat(sqrt(2)),1))
250
create table t1 as select concat(sqrt(2)) as c1;
251
show create table t1;
253
t1 CREATE TABLE `t1` (
254
`c1` varbinary(23) DEFAULT NULL
255
) ENGINE=MyISAM DEFAULT CHARSET=latin1
257
select hex(left(concat(pow(2,2)),1));
258
hex(left(concat(pow(2,2)),1))
260
create table t1 as select concat(pow(2,2)) as c1;
261
show create table t1;
263
t1 CREATE TABLE `t1` (
264
`c1` varbinary(23) DEFAULT NULL
265
) ENGINE=MyISAM DEFAULT CHARSET=latin1
267
select hex(left(concat(acos(0.5)),1));
268
hex(left(concat(acos(0.5)),1))
270
create table t1 as select concat(acos(0.5)) as c1;
271
show create table t1;
273
t1 CREATE TABLE `t1` (
274
`c1` varbinary(23) DEFAULT NULL
275
) ENGINE=MyISAM DEFAULT CHARSET=latin1
277
select hex(left(concat(asin(0.5)),1));
278
hex(left(concat(asin(0.5)),1))
280
create table t1 as select concat(asin(0.5)) as c1;
281
show create table t1;
283
t1 CREATE TABLE `t1` (
284
`c1` varbinary(23) DEFAULT NULL
285
) ENGINE=MyISAM DEFAULT CHARSET=latin1
287
select hex(left(concat(atan(0.5)),1));
288
hex(left(concat(atan(0.5)),1))
290
create table t1 as select concat(atan(0.5)) as c1;
291
show create table t1;
293
t1 CREATE TABLE `t1` (
294
`c1` varbinary(23) DEFAULT NULL
295
) ENGINE=MyISAM DEFAULT CHARSET=latin1
297
select hex(left(concat(cos(0.5)),1));
298
hex(left(concat(cos(0.5)),1))
300
create table t1 as select concat(cos(0.5)) as c1;
301
show create table t1;
303
t1 CREATE TABLE `t1` (
304
`c1` varbinary(23) DEFAULT NULL
305
) ENGINE=MyISAM DEFAULT CHARSET=latin1
307
select hex(left(concat(sin(0.5)),1));
308
hex(left(concat(sin(0.5)),1))
310
create table t1 as select concat(sin(0.5)) as c1;
311
show create table t1;
313
t1 CREATE TABLE `t1` (
314
`c1` varbinary(23) DEFAULT NULL
315
) ENGINE=MyISAM DEFAULT CHARSET=latin1
317
select hex(left(concat(tan(0.5)),1));
318
hex(left(concat(tan(0.5)),1))
320
create table t1 as select concat(tan(0.5)) as c1;
321
show create table t1;
323
t1 CREATE TABLE `t1` (
324
`c1` varbinary(23) DEFAULT NULL
325
) ENGINE=MyISAM DEFAULT CHARSET=latin1
327
select hex(concat(degrees(0)));
328
hex(concat(degrees(0)))
330
create table t1 as select concat(degrees(0)) as c1;
331
show create table t1;
333
t1 CREATE TABLE `t1` (
334
`c1` varbinary(23) NOT NULL DEFAULT ''
335
) ENGINE=MyISAM DEFAULT CHARSET=latin1
337
select hex(concat(radians(0)));
338
hex(concat(radians(0)))
340
create table t1 as select concat(radians(0)) as c1;
341
show create table t1;
343
t1 CREATE TABLE `t1` (
344
`c1` varbinary(23) NOT NULL DEFAULT ''
345
) ENGINE=MyISAM DEFAULT CHARSET=latin1
347
select hex(concat(ceiling(0.5)));
348
hex(concat(ceiling(0.5)))
350
create table t1 as select concat(ceiling(0.5)) as c1;
351
show create table t1;
353
t1 CREATE TABLE `t1` (
354
`c1` varbinary(4) NOT NULL DEFAULT ''
355
) ENGINE=MyISAM DEFAULT CHARSET=latin1
357
select hex(concat(floor(0.5)));
358
hex(concat(floor(0.5)))
360
create table t1 as select concat(floor(0.5)) as c1;
361
show create table t1;
363
t1 CREATE TABLE `t1` (
364
`c1` varbinary(4) NOT NULL DEFAULT ''
365
) ENGINE=MyISAM DEFAULT CHARSET=latin1
367
select hex(concat(round(0.5)));
368
hex(concat(round(0.5)))
370
create table t1 as select concat(round(0.5)) as c1;
371
show create table t1;
373
t1 CREATE TABLE `t1` (
374
`c1` varbinary(3) NOT NULL DEFAULT ''
375
) ENGINE=MyISAM DEFAULT CHARSET=latin1
377
select hex(concat(sign(0.5)));
378
hex(concat(sign(0.5)))
380
create table t1 as select concat(sign(0.5)) as c1;
381
show create table t1;
383
t1 CREATE TABLE `t1` (
384
`c1` varbinary(21) NOT NULL DEFAULT ''
385
) ENGINE=MyISAM DEFAULT CHARSET=latin1
387
create table t1 as select concat(rand()) as c1;
388
show create table t1;
390
t1 CREATE TABLE `t1` (
391
`c1` varbinary(23) NOT NULL DEFAULT ''
392
) ENGINE=MyISAM DEFAULT CHARSET=latin1
394
select hex(concat(length('a')));
395
hex(concat(length('a')))
397
create table t1 as select concat(length('a')) as c1;
398
show create table t1;
400
t1 CREATE TABLE `t1` (
401
`c1` varbinary(10) NOT NULL DEFAULT ''
402
) ENGINE=MyISAM DEFAULT CHARSET=latin1
404
select hex(concat(char_length('a')));
405
hex(concat(char_length('a')))
407
create table t1 as select concat(char_length('a')) as c1;
408
show create table t1;
410
t1 CREATE TABLE `t1` (
411
`c1` varbinary(10) NOT NULL DEFAULT ''
412
) ENGINE=MyISAM DEFAULT CHARSET=latin1
414
select hex(concat(bit_length('a')));
415
hex(concat(bit_length('a')))
417
create table t1 as select concat(bit_length('a')) as c1;
418
show create table t1;
420
t1 CREATE TABLE `t1` (
421
`c1` varbinary(10) NOT NULL DEFAULT ''
422
) ENGINE=MyISAM DEFAULT CHARSET=latin1
424
select hex(concat(coercibility('a')));
425
hex(concat(coercibility('a')))
427
create table t1 as select concat(coercibility('a')) as c1;
428
show create table t1;
430
t1 CREATE TABLE `t1` (
431
`c1` varbinary(10) NOT NULL DEFAULT ''
432
) ENGINE=MyISAM DEFAULT CHARSET=latin1
434
select hex(concat(locate('a','a')));
435
hex(concat(locate('a','a')))
437
create table t1 as select concat(locate('a','a')) as c1;
438
show create table t1;
440
t1 CREATE TABLE `t1` (
441
`c1` varbinary(11) NOT NULL DEFAULT ''
442
) ENGINE=MyISAM DEFAULT CHARSET=latin1
444
select hex(concat(field('c','a','b','c')));
445
hex(concat(field('c','a','b','c')))
447
create table t1 as select concat(field('c','a','b','c')) as c1;
448
show create table t1;
450
t1 CREATE TABLE `t1` (
451
`c1` varbinary(3) NOT NULL DEFAULT ''
452
) ENGINE=MyISAM DEFAULT CHARSET=latin1
454
select hex(concat(ascii(61)));
455
hex(concat(ascii(61)))
457
create table t1 as select concat(ascii(61)) as c1;
458
show create table t1;
460
t1 CREATE TABLE `t1` (
461
`c1` varbinary(3) NOT NULL DEFAULT ''
462
) ENGINE=MyISAM DEFAULT CHARSET=latin1
464
select hex(concat(ord(61)));
467
create table t1 as select concat(ord(61)) as c1;
468
show create table t1;
470
t1 CREATE TABLE `t1` (
471
`c1` varbinary(21) NOT NULL DEFAULT ''
472
) ENGINE=MyISAM DEFAULT CHARSET=latin1
474
select hex(concat(find_in_set('b','a,b,c,d')));
475
hex(concat(find_in_set('b','a,b,c,d')))
477
create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1;
478
show create table t1;
480
t1 CREATE TABLE `t1` (
481
`c1` varbinary(3) NOT NULL DEFAULT ''
482
) ENGINE=MyISAM DEFAULT CHARSET=latin1
484
select md5('a'), hex(md5('a'));
485
md5('a') hex(md5('a'))
486
0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631
487
create table t1 as select md5('a') as c1;
488
show create table t1;
490
t1 CREATE TABLE `t1` (
491
`c1` varbinary(32) NOT NULL DEFAULT ''
492
) ENGINE=MyISAM DEFAULT CHARSET=latin1
494
select old_password('a'), hex(old_password('a'));
495
old_password('a') hex(old_password('a'))
496
60671c896665c3fa 36303637316338393636363563336661
497
create table t1 as select old_password('a') as c1;
498
show create table t1;
500
t1 CREATE TABLE `t1` (
501
`c1` varbinary(16) NOT NULL DEFAULT ''
502
) ENGINE=MyISAM DEFAULT CHARSET=latin1
504
select password('a'), hex(password('a'));
505
password('a') hex(password('a'))
506
*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445
507
create table t1 as select password('a') as c1;
508
show create table t1;
510
t1 CREATE TABLE `t1` (
511
`c1` varbinary(41) NOT NULL DEFAULT ''
512
) ENGINE=MyISAM DEFAULT CHARSET=latin1
514
select sha('a'), hex(sha('a'));
515
sha('a') hex(sha('a'))
516
86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
517
create table t1 as select sha('a') as c1;
518
show create table t1;
520
t1 CREATE TABLE `t1` (
521
`c1` varbinary(40) NOT NULL DEFAULT ''
522
) ENGINE=MyISAM DEFAULT CHARSET=latin1
524
select sha1('a'), hex(sha1('a'));
525
sha1('a') hex(sha1('a'))
526
86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238
527
create table t1 as select sha1('a') as c1;
528
show create table t1;
530
t1 CREATE TABLE `t1` (
531
`c1` varbinary(40) NOT NULL DEFAULT ''
532
) ENGINE=MyISAM DEFAULT CHARSET=latin1
534
select hex(concat(cast('-1' as signed)));
535
hex(concat(cast('-1' as signed)))
537
create table t1 as select concat(cast('-1' as signed)) as c1;
538
show create table t1;
540
t1 CREATE TABLE `t1` (
541
`c1` varbinary(2) NOT NULL DEFAULT ''
542
) ENGINE=MyISAM DEFAULT CHARSET=latin1
544
select hex(concat(cast('1' as unsigned)));
545
hex(concat(cast('1' as unsigned)))
547
create table t1 as select concat(cast('1' as unsigned)) as c1;
548
show create table t1;
550
t1 CREATE TABLE `t1` (
551
`c1` varbinary(1) NOT NULL DEFAULT ''
552
) ENGINE=MyISAM DEFAULT CHARSET=latin1
554
select hex(concat(cast(1/2 as decimal(5,5))));
555
hex(concat(cast(1/2 as decimal(5,5))))
557
create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1;
558
show create table t1;
560
t1 CREATE TABLE `t1` (
561
`c1` varbinary(7) DEFAULT NULL
562
) ENGINE=MyISAM DEFAULT CHARSET=latin1
564
select hex(concat(cast('2001-01-02 03:04:05' as date)));
565
hex(concat(cast('2001-01-02 03:04:05' as date)))
567
create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1;
568
show create table t1;
570
t1 CREATE TABLE `t1` (
571
`c1` varbinary(10) DEFAULT NULL
572
) ENGINE=MyISAM DEFAULT CHARSET=latin1
577
select hex(concat(cast('2001-01-02 03:04:05' as time)));
578
hex(concat(cast('2001-01-02 03:04:05' as time)))
580
create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1;
581
show create table t1;
583
t1 CREATE TABLE `t1` (
584
`c1` varbinary(19) DEFAULT NULL
585
) ENGINE=MyISAM DEFAULT CHARSET=latin1
590
select hex(concat(cast('2001-01-02' as datetime)));
591
hex(concat(cast('2001-01-02' as datetime)))
592
323030312D30312D30322030303A30303A3030
593
create table t1 as select concat(cast('2001-01-02' as datetime)) as c1;
594
show create table t1;
596
t1 CREATE TABLE `t1` (
597
`c1` varbinary(29) DEFAULT NULL
598
) ENGINE=MyISAM DEFAULT CHARSET=latin1
603
select hex(concat(least(1,2)));
604
hex(concat(least(1,2)))
606
create table t1 as select concat(least(1,2)) as c1;
607
show create table t1;
609
t1 CREATE TABLE `t1` (
610
`c1` varbinary(2) NOT NULL DEFAULT ''
611
) ENGINE=MyISAM DEFAULT CHARSET=latin1
613
select hex(concat(greatest(1,2)));
614
hex(concat(greatest(1,2)))
616
create table t1 as select concat(greatest(1,2)) as c1;
617
show create table t1;
619
t1 CREATE TABLE `t1` (
620
`c1` varbinary(2) NOT NULL DEFAULT ''
621
) ENGINE=MyISAM DEFAULT CHARSET=latin1
623
select hex(concat(case when 11 then 22 else 33 end));
624
hex(concat(case when 11 then 22 else 33 end))
626
create table t1 as select concat(case when 11 then 22 else 33 end) as c1;
627
show create table t1;
629
t1 CREATE TABLE `t1` (
630
`c1` varbinary(2) NOT NULL DEFAULT ''
631
) ENGINE=MyISAM DEFAULT CHARSET=latin1
633
select hex(concat(coalesce(1,2)));
634
hex(concat(coalesce(1,2)))
636
create table t1 as select concat(coalesce(1,2)) as c1;
637
show create table t1;
639
t1 CREATE TABLE `t1` (
640
`c1` varbinary(1) NOT NULL DEFAULT ''
641
) ENGINE=MyISAM DEFAULT CHARSET=latin1
643
select hex(concat_ws(1,2,3));
644
hex(concat_ws(1,2,3))
646
create table t1 as select concat_ws(1,2,3) as c1;
647
show create table t1;
649
t1 CREATE TABLE `t1` (
650
`c1` varbinary(3) NOT NULL DEFAULT ''
651
) ENGINE=MyISAM DEFAULT CHARSET=latin1
653
select hex(group_concat(1,2,3));
654
hex(group_concat(1,2,3))
656
create table t1 as select group_concat(1,2,3) as c1;
657
show create table t1;
659
t1 CREATE TABLE `t1` (
661
) ENGINE=MyISAM DEFAULT CHARSET=latin1
663
create table t1 as select 1 as c1 union select 'a';
664
show create table t1;
666
t1 CREATE TABLE `t1` (
667
`c1` varbinary(1) NOT NULL DEFAULT ''
668
) ENGINE=MyISAM DEFAULT CHARSET=latin1
669
select hex(c1) from t1 order by c1;
674
create table t1 as select concat(last_insert_id()) as c1;
675
show create table t1;
677
t1 CREATE TABLE `t1` (
678
`c1` varbinary(21) NOT NULL DEFAULT ''
679
) ENGINE=MyISAM DEFAULT CHARSET=latin1
681
select hex(concat(benchmark(0,0)));
682
hex(concat(benchmark(0,0)))
684
create table t1 as select concat(benchmark(0,0)) as c1;
685
show create table t1;
687
t1 CREATE TABLE `t1` (
688
`c1` varbinary(1) NOT NULL DEFAULT ''
689
) ENGINE=MyISAM DEFAULT CHARSET=latin1
691
select hex(concat(sleep(0)));
692
hex(concat(sleep(0)))
694
create table t1 as select concat(sleep(0)) as c1;
695
show create table t1;
697
t1 CREATE TABLE `t1` (
698
`c1` varbinary(21) NOT NULL DEFAULT ''
699
) ENGINE=MyISAM DEFAULT CHARSET=latin1
701
select hex(concat(is_free_lock('xxxx')));
702
hex(concat(is_free_lock('xxxx')))
704
create table t1 as select concat(is_free_lock('xxxx')) as c1;
705
show create table t1;
707
t1 CREATE TABLE `t1` (
708
`c1` varbinary(1) DEFAULT NULL
709
) ENGINE=MyISAM DEFAULT CHARSET=latin1
711
create table t1 as select concat(is_used_lock('a')) as c1;
712
show create table t1;
714
t1 CREATE TABLE `t1` (
715
`c1` varbinary(10) DEFAULT NULL
716
) ENGINE=MyISAM DEFAULT CHARSET=latin1
718
create table t1 as select concat(release_lock('a')) as c1;
719
show create table t1;
721
t1 CREATE TABLE `t1` (
722
`c1` varbinary(1) DEFAULT NULL
723
) ENGINE=MyISAM DEFAULT CHARSET=latin1
725
select hex(concat(crc32('')));
726
hex(concat(crc32('')))
728
create table t1 as select concat(crc32('')) as c1;
729
show create table t1;
731
t1 CREATE TABLE `t1` (
732
`c1` varbinary(10) NOT NULL DEFAULT ''
733
) ENGINE=MyISAM DEFAULT CHARSET=latin1
735
select hex(concat(uncompressed_length('')));
736
hex(concat(uncompressed_length('')))
738
create table t1 as select concat(uncompressed_length('')) as c1;
739
show create table t1;
741
t1 CREATE TABLE `t1` (
742
`c1` varbinary(10) NOT NULL DEFAULT ''
743
) ENGINE=MyISAM DEFAULT CHARSET=latin1
745
create table t1 as select concat(connection_id()) as c1;
746
show create table t1;
748
t1 CREATE TABLE `t1` (
749
`c1` varbinary(10) NOT NULL DEFAULT ''
750
) ENGINE=MyISAM DEFAULT CHARSET=latin1
752
select hex(concat(inet_aton('127.1.1.1')));
753
hex(concat(inet_aton('127.1.1.1')))
755
create table t1 as select concat(inet_aton('127.1.1.1')) as c1;
756
show create table t1;
758
t1 CREATE TABLE `t1` (
759
`c1` varbinary(21) DEFAULT NULL
760
) ENGINE=MyISAM DEFAULT CHARSET=latin1
762
select hex(concat(inet_ntoa(2130772225)));
763
hex(concat(inet_ntoa(2130772225)))
765
create table t1 as select concat(inet_ntoa(2130772225)) as c1;
769
show create table t1;
771
t1 CREATE TABLE `t1` (
772
`c1` varbinary(31) DEFAULT NULL
773
) ENGINE=MyISAM DEFAULT CHARSET=latin1
775
select hex(concat(row_count()));
776
hex(concat(row_count()))
778
create table t1 as select concat(row_count()) as c1;
779
show create table t1;
781
t1 CREATE TABLE `t1` (
782
`c1` varbinary(21) NOT NULL DEFAULT ''
783
) ENGINE=MyISAM DEFAULT CHARSET=latin1
785
select hex(concat(found_rows()));
786
hex(concat(found_rows()))
788
create table t1 as select concat(found_rows()) as c1;
789
show create table t1;
791
t1 CREATE TABLE `t1` (
792
`c1` varbinary(21) NOT NULL DEFAULT ''
793
) ENGINE=MyISAM DEFAULT CHARSET=latin1
795
create table t1 as select concat(uuid_short()) as c1;
796
show create table t1;
798
t1 CREATE TABLE `t1` (
799
`c1` varbinary(21) NOT NULL DEFAULT ''
800
) ENGINE=MyISAM DEFAULT CHARSET=latin1
802
create table t1 as select concat(uuid()) as c1;
803
show create table t1;
805
t1 CREATE TABLE `t1` (
806
`c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
807
) ENGINE=MyISAM DEFAULT CHARSET=latin1
809
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
810
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
812
select charset(concat(uuid(), cast('a' as char character set latin1)));
813
charset(concat(uuid(), cast('a' as char character set latin1)))
815
create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1;
816
show create table t1;
818
t1 CREATE TABLE `t1` (
819
`c1` varchar(37) NOT NULL DEFAULT ''
820
) ENGINE=MyISAM DEFAULT CHARSET=latin1
822
create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1;
823
show create table t1;
825
t1 CREATE TABLE `t1` (
826
`c1` varbinary(21) DEFAULT NULL
827
) ENGINE=MyISAM DEFAULT CHARSET=latin1
829
select hex(concat(@a1:=1));
832
create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2;
833
select hex(c1) from t1;
836
show create table t1;
838
t1 CREATE TABLE `t1` (
839
`c1` varbinary(1) NOT NULL DEFAULT '',
840
`c2` int(1) NOT NULL DEFAULT '0'
841
) ENGINE=MyISAM DEFAULT CHARSET=latin1
844
select hex(concat(@a2));
847
create table t1 as select concat(@a2) as c1, @a2 as c2;
848
select hex(c1) from t1;
851
show create table t1;
853
t1 CREATE TABLE `t1` (
854
`c1` varbinary(20) DEFAULT NULL,
855
`c2` bigint(20) DEFAULT NULL
856
) ENGINE=MyISAM DEFAULT CHARSET=latin1
858
select hex(concat(@a1:=sqrt(1)));
859
hex(concat(@a1:=sqrt(1)))
861
create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2;
862
select hex(c1) from t1;
865
show create table t1;
867
t1 CREATE TABLE `t1` (
868
`c1` varbinary(23) DEFAULT NULL,
869
`c2` double DEFAULT NULL
870
) ENGINE=MyISAM DEFAULT CHARSET=latin1
873
select hex(concat(@a2));
876
create table t1 as select concat(@a2) as c1, @a2 as c2;
877
select hex(c1) from t1;
880
show create table t1;
882
t1 CREATE TABLE `t1` (
883
`c1` varbinary(23) DEFAULT NULL,
884
`c2` double DEFAULT NULL
885
) ENGINE=MyISAM DEFAULT CHARSET=latin1
887
select hex(concat(@a1:=1.1));
888
hex(concat(@a1:=1.1))
890
create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2;
891
select hex(c1) from t1;
894
show create table t1;
896
t1 CREATE TABLE `t1` (
897
`c1` varbinary(4) NOT NULL DEFAULT '',
898
`c2` decimal(2,1) NOT NULL DEFAULT '0.0'
899
) ENGINE=MyISAM DEFAULT CHARSET=latin1
902
select hex(concat(@a2));
905
create table t1 as select concat(@a2) as c1, @a2 as c2;
906
select hex(c1) from t1;
909
show create table t1;
911
t1 CREATE TABLE `t1` (
912
`c1` varbinary(83) DEFAULT NULL,
913
`c2` decimal(65,30) DEFAULT NULL
914
) ENGINE=MyISAM DEFAULT CHARSET=latin1
916
select hex(concat(@@ft_max_word_len));
917
hex(concat(@@ft_max_word_len))
919
create table t1 as select concat(@@ft_max_word_len) as c1;
920
select hex(c1) from t1;
923
show create table t1;
925
t1 CREATE TABLE `t1` (
926
`c1` varbinary(21) DEFAULT NULL
927
) ENGINE=MyISAM DEFAULT CHARSET=latin1
929
select hex(concat('a'='a' IS TRUE));
930
hex(concat('a'='a' IS TRUE))
932
create table t1 as select concat('a'='a' IS TRUE) as c1;
933
show create table t1;
935
t1 CREATE TABLE `t1` (
936
`c1` varbinary(1) NOT NULL DEFAULT ''
937
) ENGINE=MyISAM DEFAULT CHARSET=latin1
939
select hex(concat('a'='a' IS NOT TRUE));
940
hex(concat('a'='a' IS NOT TRUE))
942
create table t1 as select concat('a'='a' IS NOT TRUE) as c1;
943
show create table t1;
945
t1 CREATE TABLE `t1` (
946
`c1` varbinary(1) NOT NULL DEFAULT ''
947
) ENGINE=MyISAM DEFAULT CHARSET=latin1
949
select hex(concat(NOT 'a'='a'));
950
hex(concat(NOT 'a'='a'))
952
create table t1 as select concat(NOT 'a'='a') as c1;
953
show create table t1;
955
t1 CREATE TABLE `t1` (
956
`c1` varbinary(1) NOT NULL DEFAULT ''
957
) ENGINE=MyISAM DEFAULT CHARSET=latin1
959
select hex(concat('a' IS NULL));
960
hex(concat('a' IS NULL))
962
create table t1 as select concat('a' IS NULL) as c1;
963
show create table t1;
965
t1 CREATE TABLE `t1` (
966
`c1` varbinary(1) NOT NULL DEFAULT ''
967
) ENGINE=MyISAM DEFAULT CHARSET=latin1
969
select hex(concat('a' IS NOT NULL));
970
hex(concat('a' IS NOT NULL))
972
create table t1 as select concat('a' IS NOT NULL) as c1;
973
show create table t1;
975
t1 CREATE TABLE `t1` (
976
`c1` varbinary(1) NOT NULL DEFAULT ''
977
) ENGINE=MyISAM DEFAULT CHARSET=latin1
979
select hex(concat('a' rlike 'a'));
980
hex(concat('a' rlike 'a'))
982
create table t1 as select concat('a' IS NOT NULL) as c1;
983
show create table t1;
985
t1 CREATE TABLE `t1` (
986
`c1` varbinary(1) NOT NULL DEFAULT ''
987
) ENGINE=MyISAM DEFAULT CHARSET=latin1
989
select hex(concat(strcmp('a','b')));
990
hex(concat(strcmp('a','b')))
992
create table t1 as select concat(strcmp('a','b')) as c1;
993
show create table t1;
995
t1 CREATE TABLE `t1` (
996
`c1` varbinary(2) NOT NULL DEFAULT ''
997
) ENGINE=MyISAM DEFAULT CHARSET=latin1
999
select hex(concat('a' like 'a'));
1000
hex(concat('a' like 'a'))
1002
create table t1 as select concat('a' like 'b') as c1;
1003
show create table t1;
1005
t1 CREATE TABLE `t1` (
1006
`c1` varbinary(1) NOT NULL DEFAULT ''
1007
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1009
select hex(concat('a' between 'b' and 'c'));
1010
hex(concat('a' between 'b' and 'c'))
1012
create table t1 as select concat('a' between 'b' and 'c') as c1;
1013
show create table t1;
1015
t1 CREATE TABLE `t1` (
1016
`c1` varbinary(1) NOT NULL DEFAULT ''
1017
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1019
select hex(concat('a' in ('a','b')));
1020
hex(concat('a' in ('a','b')))
1022
create table t1 as select concat('a' in ('a','b')) as c1;
1023
show create table t1;
1025
t1 CREATE TABLE `t1` (
1026
`c1` varbinary(1) NOT NULL DEFAULT ''
1027
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1029
select hex(concat(interval(23, 1, 15, 17, 30, 44, 200)));
1030
hex(concat(interval(23, 1, 15, 17, 30, 44, 200)))
1032
create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1;
1033
show create table t1;
1035
t1 CREATE TABLE `t1` (
1036
`c1` varbinary(2) NOT NULL DEFAULT ''
1037
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1039
create table t1 (a varchar(10), fulltext key(a));
1040
insert into t1 values ('a');
1041
select hex(concat(match (a) against ('a'))) from t1;
1042
hex(concat(match (a) against ('a')))
1044
create table t2 as select concat(match (a) against ('a')) as a from t1;
1045
show create table t2;
1047
t2 CREATE TABLE `t2` (
1048
`a` varbinary(23) DEFAULT NULL
1049
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1051
select hex(ifnull(1,'a'));
1054
create table t1 as select ifnull(1,'a') as c1;
1055
show create table t1;
1057
t1 CREATE TABLE `t1` (
1058
`c1` varbinary(1) NOT NULL DEFAULT ''
1059
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1061
select hex(concat(ifnull(1,1)));
1062
hex(concat(ifnull(1,1)))
1064
create table t1 as select concat(ifnull(1,1)) as c1;
1065
show create table t1;
1067
t1 CREATE TABLE `t1` (
1068
`c1` varbinary(1) NOT NULL DEFAULT ''
1069
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1071
select hex(concat(ifnull(1.1,1.1)));
1072
hex(concat(ifnull(1.1,1.1)))
1074
create table t1 as select concat(ifnull(1.1,1.1)) as c1;
1075
show create table t1;
1077
t1 CREATE TABLE `t1` (
1078
`c1` varbinary(4) NOT NULL DEFAULT ''
1079
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1081
select hex(if(1,'b',1));
1084
create table t1 as select if(1,'b',1) as c1;
1085
show create table t1;
1087
t1 CREATE TABLE `t1` (
1088
`c1` varbinary(1) NOT NULL DEFAULT ''
1089
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1091
select hex(if(1,1,'b'));
1094
create table t1 as select if(1,1,'b') as c1;
1095
show create table t1;
1097
t1 CREATE TABLE `t1` (
1098
`c1` varbinary(1) NOT NULL DEFAULT ''
1099
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1101
select hex(concat(if(1,1,1)));
1102
hex(concat(if(1,1,1)))
1104
create table t1 as select concat(if(1,1,1)) as c1;
1105
show create table t1;
1107
t1 CREATE TABLE `t1` (
1108
`c1` varbinary(1) NOT NULL DEFAULT ''
1109
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1111
select hex(concat(nullif(1,2)));
1112
hex(concat(nullif(1,2)))
1114
create table t1 as select concat(nullif(1,2)) as c1;
1115
show create table t1;
1117
t1 CREATE TABLE `t1` (
1118
`c1` varbinary(1) DEFAULT NULL
1119
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1121
select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))));
1122
hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)'))))
1124
create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1;
1125
show create table t1;
1127
t1 CREATE TABLE `t1` (
1128
`c1` varbinary(10) DEFAULT NULL
1129
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1131
select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
1132
hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
1134
create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
1135
show create table t1;
1137
t1 CREATE TABLE `t1` (
1138
`c1` varbinary(10) DEFAULT NULL
1139
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1141
select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))));
1142
hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))))
1144
create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1;
1145
show create table t1;
1147
t1 CREATE TABLE `t1` (
1148
`c1` varbinary(10) DEFAULT NULL
1149
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1151
select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))));
1152
hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))))
1154
create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1;
1155
show create table t1;
1157
t1 CREATE TABLE `t1` (
1158
`c1` varbinary(10) DEFAULT NULL
1159
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1161
select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))));
1162
hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))))
1164
create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1;
1165
show create table t1;
1167
t1 CREATE TABLE `t1` (
1168
`c1` varbinary(10) DEFAULT NULL
1169
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1171
select hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))));
1172
hex(concat(IsEmpty(GeomFromText('POINT(1 1)'))))
1174
create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1;
1175
show create table t1;
1177
t1 CREATE TABLE `t1` (
1178
`c1` varbinary(21) DEFAULT NULL
1179
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1181
select hex(concat(IsSimple(GeomFromText('POINT(1 1)'))));
1182
hex(concat(IsSimple(GeomFromText('POINT(1 1)'))))
1184
create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
1185
show create table t1;
1187
t1 CREATE TABLE `t1` (
1188
`c1` varbinary(21) DEFAULT NULL
1189
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1191
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
1192
hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))))
1194
create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1;
1195
show create table t1;
1197
t1 CREATE TABLE `t1` (
1198
`c1` varbinary(21) DEFAULT NULL
1199
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1201
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));
1202
hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))))
1204
create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1;
1206
select hex(concat(x(GeomFromText('Point(1 2)'))));
1207
hex(concat(x(GeomFromText('Point(1 2)'))))
1209
create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
1210
show create table t1;
1212
t1 CREATE TABLE `t1` (
1213
`c1` varbinary(23) DEFAULT NULL
1214
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1216
select hex(concat(y(GeomFromText('Point(1 2)'))));
1217
hex(concat(y(GeomFromText('Point(1 2)'))))
1219
create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1;
1220
show create table t1;
1222
t1 CREATE TABLE `t1` (
1223
`c1` varbinary(23) DEFAULT NULL
1224
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1226
select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))));
1227
hex(concat(GLength(GeomFromText('LineString(1 2,2 2)'))))
1229
create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1;
1230
show create table t1;
1232
t1 CREATE TABLE `t1` (
1233
`c1` varbinary(23) DEFAULT NULL
1234
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1236
select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))));
1237
hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))))
1239
create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1;
1240
show create table t1;
1242
t1 CREATE TABLE `t1` (
1243
`c1` varbinary(23) DEFAULT NULL
1244
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1246
select hex(concat(GeometryType(GeomFromText('Point(1 2)'))));
1247
hex(concat(GeometryType(GeomFromText('Point(1 2)'))))
1249
create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1;
1250
show create table t1;
1252
t1 CREATE TABLE `t1` (
1253
`c1` varbinary(20) DEFAULT NULL
1254
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1256
select hex(concat(AsText(GeomFromText('Point(1 2)'))));
1257
hex(concat(AsText(GeomFromText('Point(1 2)'))))
1258
504F494E542831203229
1259
create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1;
1260
show create table t1;
1262
t1 CREATE TABLE `t1` (
1264
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1266
select hex(concat(period_add(200902, 2)));
1267
hex(concat(period_add(200902, 2)))
1269
create table t1 as select concat(period_add(200902, 2)) as c1;
1270
show create table t1;
1272
t1 CREATE TABLE `t1` (
1273
`c1` varbinary(6) NOT NULL DEFAULT ''
1274
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1276
select hex(concat(period_diff(200902, 200802)));
1277
hex(concat(period_diff(200902, 200802)))
1279
create table t1 as select concat(period_add(200902, 200802)) as c1;
1281
Warning 1265 Data truncated for column 'c1' at row 1
1282
show create table t1;
1284
t1 CREATE TABLE `t1` (
1285
`c1` varbinary(6) NOT NULL DEFAULT ''
1286
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1288
select hex(concat(to_days(20090224)));
1289
hex(concat(to_days(20090224)))
1291
create table t1 as select concat(to_days(20090224)) as c1;
1292
show create table t1;
1294
t1 CREATE TABLE `t1` (
1295
`c1` varbinary(6) DEFAULT NULL
1296
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1298
select hex(concat(dayofmonth(20090224)));
1299
hex(concat(dayofmonth(20090224)))
1301
create table t1 as select concat(dayofmonth(20090224)) as c1;
1302
show create table t1;
1304
t1 CREATE TABLE `t1` (
1305
`c1` varbinary(2) DEFAULT NULL
1306
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1308
select hex(concat(dayofyear(20090224)));
1309
hex(concat(dayofyear(20090224)))
1311
create table t1 as select concat(dayofyear(20090224)) as c1;
1312
show create table t1;
1314
t1 CREATE TABLE `t1` (
1315
`c1` varbinary(3) DEFAULT NULL
1316
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1318
select hex(concat(hour('10:11:12')));
1319
hex(concat(hour('10:11:12')))
1321
create table t1 as select concat(hour('10:11:12')) as c1;
1322
show create table t1;
1324
t1 CREATE TABLE `t1` (
1325
`c1` varbinary(2) DEFAULT NULL
1326
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1328
select hex(concat(minute('10:11:12')));
1329
hex(concat(minute('10:11:12')))
1331
create table t1 as select concat(minute('10:11:12')) as c1;
1332
show create table t1;
1334
t1 CREATE TABLE `t1` (
1335
`c1` varbinary(2) DEFAULT NULL
1336
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1338
select hex(concat(second('10:11:12')));
1339
hex(concat(second('10:11:12')))
1341
create table t1 as select concat(second('10:11:12')) as c1;
1342
show create table t1;
1344
t1 CREATE TABLE `t1` (
1345
`c1` varbinary(2) DEFAULT NULL
1346
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1348
select hex(concat(quarter(20090224)));
1349
hex(concat(quarter(20090224)))
1351
create table t1 as select concat(quarter(20090224)) as c1;
1352
show create table t1;
1354
t1 CREATE TABLE `t1` (
1355
`c1` varbinary(1) DEFAULT NULL
1356
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1358
select hex(concat(week(20090224)));
1359
hex(concat(week(20090224)))
1361
create table t1 as select concat(week(20090224)) as c1;
1362
show create table t1;
1364
t1 CREATE TABLE `t1` (
1365
`c1` varbinary(2) DEFAULT NULL
1366
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1368
select hex(concat(yearweek(20090224)));
1369
hex(concat(yearweek(20090224)))
1371
create table t1 as select concat(yearweek(20090224)) as c1;
1372
show create table t1;
1374
t1 CREATE TABLE `t1` (
1375
`c1` varbinary(6) DEFAULT NULL
1376
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1378
select hex(concat(year(20090224)));
1379
hex(concat(year(20090224)))
1381
create table t1 as select concat(year(20090224)) as c1;
1382
show create table t1;
1384
t1 CREATE TABLE `t1` (
1385
`c1` varbinary(4) DEFAULT NULL
1386
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1388
select hex(concat(weekday(20090224)));
1389
hex(concat(weekday(20090224)))
1391
create table t1 as select concat(weekday(20090224)) as c1;
1392
show create table t1;
1394
t1 CREATE TABLE `t1` (
1395
`c1` varbinary(1) DEFAULT NULL
1396
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1398
select hex(concat(dayofweek(20090224)));
1399
hex(concat(dayofweek(20090224)))
1401
create table t1 as select concat(dayofweek(20090224)) as c1;
1402
show create table t1;
1404
t1 CREATE TABLE `t1` (
1405
`c1` varbinary(1) DEFAULT NULL
1406
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1408
select hex(concat(unix_timestamp(20090224)));
1409
hex(concat(unix_timestamp(20090224)))
1410
31323335343232383030
1411
create table t1 as select concat(unix_timestamp(20090224)) as c1;
1412
show create table t1;
1414
t1 CREATE TABLE `t1` (
1415
`c1` varbinary(10) NOT NULL DEFAULT ''
1416
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1418
select hex(concat(time_to_sec('10:11:12')));
1419
hex(concat(time_to_sec('10:11:12')))
1421
create table t1 as select concat(time_to_sec('10:11:12')) as c1;
1422
show create table t1;
1424
t1 CREATE TABLE `t1` (
1425
`c1` varbinary(10) NOT NULL DEFAULT ''
1426
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1428
select hex(concat(extract(year from 20090702)));
1429
hex(concat(extract(year from 20090702)))
1431
create table t1 as select concat(extract(year from 20090702)) as c1;
1432
show create table t1;
1434
t1 CREATE TABLE `t1` (
1435
`c1` varbinary(4) DEFAULT NULL
1436
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1438
select hex(concat(microsecond('12:00:00.123456')));
1439
hex(concat(microsecond('12:00:00.123456')))
1441
create table t1 as select concat(microsecond('12:00:00.123456')) as c1;
1442
show create table t1;
1444
t1 CREATE TABLE `t1` (
1445
`c1` varbinary(21) DEFAULT NULL
1446
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1448
select hex(concat(month(20090224)));
1449
hex(concat(month(20090224)))
1451
create table t1 as select concat(month(20090224)) as c1;
1452
show create table t1;
1454
t1 CREATE TABLE `t1` (
1455
`c1` varbinary(2) DEFAULT NULL
1456
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1458
create table t1 as select concat(last_day('2003-02-05')) as c1;
1459
show create table t1;
1461
t1 CREATE TABLE `t1` (
1462
`c1` varbinary(10) DEFAULT NULL
1463
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1464
select c1, hex(c1) from t1;
1466
2003-02-28 323030332D30322D3238
1468
create table t1 as select concat(from_days(730669)) as c1;
1469
show create table t1;
1471
t1 CREATE TABLE `t1` (
1472
`c1` varbinary(10) NOT NULL DEFAULT ''
1473
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1474
select c1, hex(c1) from t1;
1476
2000-07-03 323030302D30372D3033
1478
create table t1 as select concat(curdate()) as c1;
1479
show create table t1;
1481
t1 CREATE TABLE `t1` (
1482
`c1` varbinary(10) NOT NULL DEFAULT ''
1483
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1485
create table t1 as select concat(utc_date()) as c1;
1486
show create table t1;
1488
t1 CREATE TABLE `t1` (
1489
`c1` varbinary(10) NOT NULL DEFAULT ''
1490
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1492
create table t1 as select concat(curtime()) as c1;
1493
show create table t1;
1495
t1 CREATE TABLE `t1` (
1496
`c1` varbinary(8) NOT NULL DEFAULT ''
1497
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1499
create table t1 as select repeat('a',20) as c1 limit 0;
1500
set timestamp=1216359724;
1501
insert into t1 values (current_date);
1502
insert into t1 values (current_time);
1503
select c1, hex(c1) from t1;
1505
2008-07-18 323030382D30372D3138
1506
08:42:04 30383A34323A3034
1508
create table t1 as select concat(utc_time()) as c1;
1509
show create table t1;
1511
t1 CREATE TABLE `t1` (
1512
`c1` varbinary(8) NOT NULL DEFAULT ''
1513
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1515
select hex(concat(sec_to_time(2378)));
1516
hex(concat(sec_to_time(2378)))
1518
create table t1 as select concat(sec_to_time(2378)) as c1;
1519
show create table t1;
1521
t1 CREATE TABLE `t1` (
1522
`c1` varbinary(23) DEFAULT NULL
1523
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1525
select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')));
1526
hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')))
1528
create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1;
1529
show create table t1;
1531
t1 CREATE TABLE `t1` (
1532
`c1` varbinary(23) DEFAULT NULL
1533
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1535
select hex(concat(maketime(10,11,12)));
1536
hex(concat(maketime(10,11,12)))
1538
create table t1 as select concat(maketime(10,11,12)) as c1;
1539
show create table t1;
1541
t1 CREATE TABLE `t1` (
1542
`c1` varbinary(23) DEFAULT NULL
1543
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1545
select hex(get_format(DATE,'USA'));
1546
hex(get_format(DATE,'USA'))
1548
create table t1 as select get_format(DATE,'USA') as c1;
1549
show create table t1;
1551
t1 CREATE TABLE `t1` (
1552
`c1` varbinary(17) DEFAULT NULL
1553
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1555
select hex(left(concat(from_unixtime(1111885200)),4));
1556
hex(left(concat(from_unixtime(1111885200)),4))
1558
create table t1 as select concat(from_unixtime(1111885200)) as c1;
1559
show create table t1;
1561
t1 CREATE TABLE `t1` (
1562
`c1` varbinary(19) DEFAULT NULL
1563
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1565
select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')));
1566
hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')))
1567
323030332D31322D33312032303A30303A3030
1568
create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1;
1569
show create table t1;
1571
t1 CREATE TABLE `t1` (
1572
`c1` varbinary(19) DEFAULT NULL
1573
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1575
select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)));
1576
hex(concat(date_add('2004-01-01 12:00:00', interval 1 day)))
1577
323030342D30312D30322031323A30303A3030
1578
create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1;
1579
show create table t1;
1581
t1 CREATE TABLE `t1` (
1582
`c1` varbinary(29) DEFAULT NULL
1583
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1588
select hex(concat(makedate(2009,1)));
1589
hex(concat(makedate(2009,1)))
1590
323030392D30312D3031
1591
create table t1 as select concat(makedate(2009,1)) as c1;
1592
show create table t1;
1594
t1 CREATE TABLE `t1` (
1595
`c1` varbinary(10) DEFAULT NULL
1596
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1601
create table t1 as select concat(now()) as c1;
1602
show create table t1;
1604
t1 CREATE TABLE `t1` (
1605
`c1` varbinary(19) NOT NULL DEFAULT ''
1606
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1608
create table t1 as select concat(utc_timestamp()) as c1;
1609
show create table t1;
1611
t1 CREATE TABLE `t1` (
1612
`c1` varbinary(19) NOT NULL DEFAULT ''
1613
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1615
create table t1 as select concat(sysdate()) as c1;
1616
show create table t1;
1618
t1 CREATE TABLE `t1` (
1619
`c1` varbinary(19) NOT NULL DEFAULT ''
1620
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1622
select hex(concat(addtime('00:00:00','11:22:33')));
1623
hex(concat(addtime('00:00:00','11:22:33')))
1625
create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1;
1626
show create table t1;
1628
t1 CREATE TABLE `t1` (
1629
`c1` varbinary(29) DEFAULT NULL
1630
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1632
select hex(concat(subtime('23:59:59','11:22:33')));
1633
hex(concat(subtime('23:59:59','11:22:33')))
1635
create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1;
1636
show create table t1;
1638
t1 CREATE TABLE `t1` (
1639
`c1` varbinary(29) DEFAULT NULL
1640
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1642
select hex(elt(1,2,3));
1645
create table t1 as select elt(1,2,3) as c1;
1646
show create table t1;
1648
t1 CREATE TABLE `t1` (
1649
`c1` varbinary(1) DEFAULT NULL
1650
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1652
select hex(export_set(1,2,3,4,2));
1653
hex(export_set(1,2,3,4,2))
1655
create table t1 as select export_set(1,2,3,4,2) as c1;
1656
show create table t1;
1658
t1 CREATE TABLE `t1` (
1659
`c1` varbinary(127) NOT NULL DEFAULT ''
1660
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1662
select hex(insert(1133,3,0,22));
1663
hex(insert(1133,3,0,22))
1665
create table t1 as select insert(1133,3,0,22) as c1;
1666
show create table t1;
1668
t1 CREATE TABLE `t1` (
1669
`c1` varbinary(6) NOT NULL DEFAULT ''
1670
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1672
select hex(lcase(123));
1675
create table t1 as select lcase(123) as c1;
1676
show create table t1;
1678
t1 CREATE TABLE `t1` (
1679
`c1` varbinary(3) NOT NULL DEFAULT ''
1680
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1682
select hex(left(123,1));
1685
create table t1 as select left(123,1) as c1;
1686
show create table t1;
1688
t1 CREATE TABLE `t1` (
1689
`c1` varbinary(1) NOT NULL DEFAULT ''
1690
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1692
select hex(lower(123));
1695
create table t1 as select lower(123) as c1;
1696
show create table t1;
1698
t1 CREATE TABLE `t1` (
1699
`c1` varbinary(3) NOT NULL DEFAULT ''
1700
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1702
select hex(lpad(1,2,0));
1705
create table t1 as select lpad(1,2,0) as c1;
1706
show create table t1;
1708
t1 CREATE TABLE `t1` (
1709
`c1` varbinary(2) NOT NULL DEFAULT ''
1710
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1712
select hex(ltrim(1));
1715
create table t1 as select ltrim(1) as c1;
1716
show create table t1;
1718
t1 CREATE TABLE `t1` (
1719
`c1` varbinary(1) NOT NULL DEFAULT ''
1720
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1722
select hex(mid(1,1,1));
1725
create table t1 as select mid(1,1,1) as c1;
1726
show create table t1;
1728
t1 CREATE TABLE `t1` (
1729
`c1` varbinary(1) NOT NULL DEFAULT ''
1730
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1732
select hex(repeat(1,2));
1735
create table t1 as select repeat(1,2) as c1;
1736
show create table t1;
1738
t1 CREATE TABLE `t1` (
1739
`c1` varbinary(2) NOT NULL DEFAULT ''
1740
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1742
select hex(replace(1,1,2));
1745
create table t1 as select replace(1,1,2) as c1;
1746
show create table t1;
1748
t1 CREATE TABLE `t1` (
1749
`c1` varbinary(1) NOT NULL DEFAULT ''
1750
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1752
select hex(reverse(12));
1755
create table t1 as select reverse(12) as c1;
1756
show create table t1;
1758
t1 CREATE TABLE `t1` (
1759
`c1` varbinary(2) NOT NULL DEFAULT ''
1760
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1762
select hex(right(123,1));
1765
create table t1 as select right(123,1) as c1;
1766
show create table t1;
1768
t1 CREATE TABLE `t1` (
1769
`c1` varbinary(1) NOT NULL DEFAULT ''
1770
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1772
select hex(rpad(1,2,0));
1775
create table t1 as select rpad(1,2,0) as c1;
1776
show create table t1;
1778
t1 CREATE TABLE `t1` (
1779
`c1` varbinary(2) NOT NULL DEFAULT ''
1780
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1782
select hex(rtrim(1));
1785
create table t1 as select rtrim(1) as c1;
1786
show create table t1;
1788
t1 CREATE TABLE `t1` (
1789
`c1` varbinary(1) NOT NULL DEFAULT ''
1790
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1792
select hex(soundex(1));
1795
create table t1 as select soundex(1) as c1;
1796
show create table t1;
1798
t1 CREATE TABLE `t1` (
1799
`c1` varbinary(4) NOT NULL DEFAULT ''
1800
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1802
select hex(substring(1,1,1));
1803
hex(substring(1,1,1))
1805
create table t1 as select substring(1,1,1) as c1;
1806
show create table t1;
1808
t1 CREATE TABLE `t1` (
1809
`c1` varbinary(1) NOT NULL DEFAULT ''
1810
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1812
select hex(trim(1));
1815
create table t1 as select trim(1) as c1;
1816
show create table t1;
1818
t1 CREATE TABLE `t1` (
1819
`c1` varbinary(1) NOT NULL DEFAULT ''
1820
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1822
select hex(ucase(1));
1825
create table t1 as select ucase(1) as c1;
1826
show create table t1;
1828
t1 CREATE TABLE `t1` (
1829
`c1` varbinary(1) NOT NULL DEFAULT ''
1830
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1832
select hex(upper(1));
1835
create table t1 as select upper(1) as c1;
1836
show create table t1;
1838
t1 CREATE TABLE `t1` (
1839
`c1` varbinary(1) NOT NULL DEFAULT ''
1840
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1842
create table t1 as select repeat(' ', 64) as a limit 0;
1843
show create table t1;
1845
t1 CREATE TABLE `t1` (
1846
`a` varbinary(64) NOT NULL DEFAULT ''
1847
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1848
insert into t1 values ("1.1"), ("2.1");
1849
select a, hex(a) from t1;
1853
update t1 set a= a + 0.1;
1854
select a, hex(a) from t1;
1856
1.2000000000000002 312E32303030303030303030303030303032
1859
create table t1 (a tinyint);
1860
insert into t1 values (1);
1861
select hex(concat(a)) from t1;
1864
create table t2 as select concat(a) from t1;
1865
show create table t2;
1867
t2 CREATE TABLE `t2` (
1868
`concat(a)` varbinary(4) DEFAULT NULL
1869
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1871
create table t1 (a tinyint zerofill);
1872
insert into t1 values (1), (10), (100);
1873
select hex(concat(a)), a from t1;
1879
create table t1 (a tinyint(4) zerofill);
1880
insert into t1 values (1), (10), (100);
1881
select hex(concat(a)), a from t1;
1887
create table t1 (a decimal(10,2));
1888
insert into t1 values (123.45);
1889
select hex(concat(a)) from t1;
1892
create table t2 as select concat(a) from t1;
1893
show create table t2;
1895
t2 CREATE TABLE `t2` (
1896
`concat(a)` varbinary(12) DEFAULT NULL
1897
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1899
create table t1 (a smallint);
1900
insert into t1 values (1);
1901
select hex(concat(a)) from t1;
1904
create table t2 as select concat(a) from t1;
1905
show create table t2;
1907
t2 CREATE TABLE `t2` (
1908
`concat(a)` varbinary(6) DEFAULT NULL
1909
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1911
create table t1 (a smallint zerofill);
1912
insert into t1 values (1), (10), (100), (1000), (10000);
1913
select hex(concat(a)), a from t1;
1921
create table t1 (a mediumint);
1922
insert into t1 values (1);
1923
select hex(concat(a)) from t1;
1926
create table t2 as select concat(a) from t1;
1927
show create table t2;
1929
t2 CREATE TABLE `t2` (
1930
`concat(a)` varbinary(9) DEFAULT NULL
1931
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1933
create table t1 (a mediumint zerofill);
1934
insert into t1 values (1), (10), (100), (1000), (10000);
1935
select hex(concat(a)), a from t1;
1937
3030303030303031 00000001
1938
3030303030303130 00000010
1939
3030303030313030 00000100
1940
3030303031303030 00001000
1941
3030303130303030 00010000
1943
create table t1 (a int);
1944
insert into t1 values (1);
1945
select hex(concat(a)) from t1;
1948
create table t2 as select concat(a) from t1;
1949
show create table t2;
1951
t2 CREATE TABLE `t2` (
1952
`concat(a)` varbinary(11) DEFAULT NULL
1953
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1955
create table t1 (a int zerofill);
1956
insert into t1 values (1), (10), (100), (1000), (10000);
1957
select hex(concat(a)), a from t1;
1959
30303030303030303031 0000000001
1960
30303030303030303130 0000000010
1961
30303030303030313030 0000000100
1962
30303030303031303030 0000001000
1963
30303030303130303030 0000010000
1965
create table t1 (a bigint);
1966
insert into t1 values (1);
1967
select hex(concat(a)) from t1;
1970
create table t2 as select concat(a) from t1;
1971
show create table t2;
1973
t2 CREATE TABLE `t2` (
1974
`concat(a)` varbinary(20) DEFAULT NULL
1975
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1977
create table t1 (a bigint zerofill);
1978
insert into t1 values (1), (10), (100), (1000), (10000);
1979
select hex(concat(a)), a from t1;
1981
3030303030303030303030303030303030303031 00000000000000000001
1982
3030303030303030303030303030303030303130 00000000000000000010
1983
3030303030303030303030303030303030313030 00000000000000000100
1984
3030303030303030303030303030303031303030 00000000000000001000
1985
3030303030303030303030303030303130303030 00000000000000010000
1987
create table t1 (a float);
1988
insert into t1 values (123.456);
1989
select hex(concat(a)) from t1;
1992
select concat(a) from t1;
1995
create table t2 as select concat(a) from t1;
1996
show create table t2;
1998
t2 CREATE TABLE `t2` (
1999
`concat(a)` varbinary(12) DEFAULT NULL
2000
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2002
create table t1 (a float zerofill);
2003
insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
2004
select hex(concat(a)), a from t1;
2006
303030303030303030312E31 0000000001.1
2007
303030303030303031302E31 0000000010.1
2008
303030303030303130302E31 0000000100.1
2009
303030303030313030302E31 0000001000.1
2010
303030303031303030302E31 0000010000.1
2012
create table t1 (a double);
2013
insert into t1 values (123.456);
2014
select hex(concat(a)) from t1;
2017
select concat(a) from t1;
2020
create table t2 as select concat(a) from t1;
2021
show create table t2;
2023
t2 CREATE TABLE `t2` (
2024
`concat(a)` varbinary(22) DEFAULT NULL
2025
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2027
create table t1 (a double zerofill);
2028
insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
2029
select hex(concat(a)), a from t1;
2031
30303030303030303030303030303030303030312E31 00000000000000000001.1
2032
30303030303030303030303030303030303031302E31 00000000000000000010.1
2033
30303030303030303030303030303030303130302E31 00000000000000000100.1
2034
30303030303030303030303030303030313030302E31 00000000000000001000.1
2035
30303030303030303030303030303031303030302E31 00000000000000010000.1
2037
create table t1 (a year(2));
2038
insert into t1 values (1);
2039
select hex(concat(a)) from t1;
2042
create table t2 as select concat(a) from t1;
2043
show create table t2;
2045
t2 CREATE TABLE `t2` (
2046
`concat(a)` varbinary(2) DEFAULT NULL
2047
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2049
create table t1 (a year);
2050
insert into t1 values (1);
2051
select hex(concat(a)) from t1;
2054
create table t2 as select concat(a) from t1;
2055
show create table t2;
2057
t2 CREATE TABLE `t2` (
2058
`concat(a)` varbinary(4) DEFAULT NULL
2059
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2061
create table t1 (a bit(64));
2062
insert into t1 values (1);
2063
select hex(concat(a)) from t1;
2066
create table t2 as select concat(a) from t1;
2067
show create table t2;
2069
t2 CREATE TABLE `t2` (
2070
`concat(a)` varbinary(64) DEFAULT NULL
2071
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2073
create table t1 (a timestamp);
2074
insert into t1 values (0);
2075
insert into t1 values (20010203040506);
2076
insert into t1 values (19800203040506);
2077
insert into t1 values ('2001-02-03 04:05:06');
2078
select hex(concat(a)) from t1;
2080
303030302D30302D30302030303A30303A3030
2081
323030312D30322D30332030343A30353A3036
2082
313938302D30322D30332030343A30353A3036
2083
323030312D30322D30332030343A30353A3036
2084
select concat(a) from t1;
2090
create table t2 as select concat(a) from t1;
2091
show create table t2;
2093
t2 CREATE TABLE `t2` (
2094
`concat(a)` varbinary(19) NOT NULL DEFAULT ''
2095
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2097
create table t1 (a date);
2098
insert into t1 values ('2001-02-03');
2099
insert into t1 values (20010203);
2100
select hex(concat(a)) from t1;
2102
323030312D30322D3033
2103
323030312D30322D3033
2104
create table t2 as select concat(a) from t1;
2105
show create table t2;
2107
t2 CREATE TABLE `t2` (
2108
`concat(a)` varbinary(10) DEFAULT NULL
2109
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2111
create table t1 (a time);
2112
insert into t1 values (1);
2113
insert into t1 values ('01:02:03');
2114
select hex(concat(a)) from t1;
2118
select concat(a) from t1;
2122
create table t2 as select concat(a) from t1;
2123
show create table t2;
2125
t2 CREATE TABLE `t2` (
2126
`concat(a)` varbinary(8) DEFAULT NULL
2127
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2129
create table t1 (a datetime);
2130
insert into t1 values ('2001-02-03 04:05:06');
2131
insert into t1 values (20010203040506);
2132
select hex(concat(a)) from t1;
2134
323030312D30322D30332030343A30353A3036
2135
323030312D30322D30332030343A30353A3036
2136
create table t2 as select concat(a) from t1;
2137
show create table t2;
2139
t2 CREATE TABLE `t2` (
2140
`concat(a)` varbinary(19) DEFAULT NULL
2141
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2143
create table t1 (a tinyint);
2144
insert into t1 values (1);
2145
create view v1(a) as select concat(a) from t1;
2146
show columns from v1;
2147
Field Type Null Key Default Extra
2148
a varbinary(4) YES NULL
2149
select hex(a) from v1;
2154
create table t1 (a tinyint zerofill);
2155
insert into t1 values (1), (10), (100);
2156
create view v1(a) as select concat(a) from t1;
2157
show columns from v1;
2158
Field Type Null Key Default Extra
2159
a varbinary(3) YES NULL
2160
select hex(a) from v1;
2167
create table t1 (a tinyint(30) zerofill);
2168
insert into t1 values (1), (10), (100);
2169
create view v1(a) as select concat(a) from t1;
2170
show columns from v1;
2171
Field Type Null Key Default Extra
2172
a varbinary(30) YES NULL
2173
select hex(a) from v1;
2175
303030303030303030303030303030303030303030303030303030303031
2176
303030303030303030303030303030303030303030303030303030303130
2177
303030303030303030303030303030303030303030303030303030313030
2180
create table t1 (a decimal(10,2));
2181
insert into t1 values (123.45);
2182
create view v1(a) as select concat(a) from t1;
2183
show columns from v1;
2184
Field Type Null Key Default Extra
2185
a varbinary(12) YES NULL
2186
select hex(a) from v1;
2191
create table t1 (a smallint);
2192
insert into t1 values (1);
2193
create view v1(a) as select concat(a) from t1;
2194
show columns from v1;
2195
Field Type Null Key Default Extra
2196
a varbinary(6) YES NULL
2197
select hex(a) from v1;
2202
create table t1 (a smallint zerofill);
2203
insert into t1 values (1), (10), (100), (1000), (10000);
2204
create view v1(a) as select concat(a) from t1;
2205
show columns from v1;
2206
Field Type Null Key Default Extra
2207
a varbinary(5) YES NULL
2208
select hex(a) from v1;
2217
create table t1 (a mediumint);
2218
insert into t1 values (1);
2219
create view v1(a) as select concat(a) from t1;
2220
show columns from v1;
2221
Field Type Null Key Default Extra
2222
a varbinary(9) YES NULL
2223
select hex(a) from v1;
2228
create table t1 (a mediumint zerofill);
2229
insert into t1 values (1), (10), (100), (1000), (10000);
2230
create view v1(a) as select concat(a) from t1;
2231
show columns from v1;
2232
Field Type Null Key Default Extra
2233
a varbinary(8) YES NULL
2234
select hex(a) from v1;
2243
create table t1 (a int);
2244
insert into t1 values (1);
2245
create view v1(a) as select concat(a) from t1;
2246
show columns from v1;
2247
Field Type Null Key Default Extra
2248
a varbinary(11) YES NULL
2249
select hex(a) from v1;
2254
create table t1 (a int zerofill);
2255
insert into t1 values (1), (10), (100), (1000), (10000);
2256
create view v1(a) as select concat(a) from t1;
2257
show columns from v1;
2258
Field Type Null Key Default Extra
2259
a varbinary(10) YES NULL
2260
select hex(a) from v1;
2262
30303030303030303031
2263
30303030303030303130
2264
30303030303030313030
2265
30303030303031303030
2266
30303030303130303030
2269
create table t1 (a bigint);
2270
insert into t1 values (1);
2271
create view v1(a) as select concat(a) from t1;
2272
show columns from v1;
2273
Field Type Null Key Default Extra
2274
a varbinary(20) YES NULL
2275
select hex(a) from v1;
2280
create table t1 (a bigint zerofill);
2281
insert into t1 values (1), (10), (100), (1000), (10000);
2282
create view v1(a) as select concat(a) from t1;
2283
show columns from v1;
2284
Field Type Null Key Default Extra
2285
a varbinary(20) YES NULL
2286
select hex(a) from v1;
2288
3030303030303030303030303030303030303031
2289
3030303030303030303030303030303030303130
2290
3030303030303030303030303030303030313030
2291
3030303030303030303030303030303031303030
2292
3030303030303030303030303030303130303030
2295
create table t1 (a float);
2296
insert into t1 values (123.456);
2297
create view v1(a) as select concat(a) from t1;
2298
show columns from v1;
2299
Field Type Null Key Default Extra
2300
a varbinary(12) YES NULL
2301
select hex(a) from v1;
2306
create table t1 (a float zerofill);
2307
insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
2308
create view v1(a) as select concat(a) from t1;
2309
show columns from v1;
2310
Field Type Null Key Default Extra
2311
a varbinary(12) YES NULL
2312
select hex(a) from v1;
2314
303030303030303030312E31
2315
303030303030303031302E31
2316
303030303030303130302E31
2317
303030303030313030302E31
2318
303030303031303030302E31
2321
create table t1 (a double);
2322
insert into t1 values (123.456);
2323
select concat(a) from t1;
2326
create view v1(a) as select concat(a) from t1;
2327
show columns from v1;
2328
Field Type Null Key Default Extra
2329
a varbinary(22) YES NULL
2330
select hex(a) from v1;
2335
create table t1 (a double zerofill);
2336
insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1);
2337
create view v1(a) as select concat(a) from t1;
2338
show columns from v1;
2339
Field Type Null Key Default Extra
2340
a varbinary(22) YES NULL
2341
select hex(a) from v1;
2343
30303030303030303030303030303030303030312E31
2344
30303030303030303030303030303030303031302E31
2345
30303030303030303030303030303030303130302E31
2346
30303030303030303030303030303030313030302E31
2347
30303030303030303030303030303031303030302E31
2350
create table t1 (a year(2));
2351
insert into t1 values (1);
2352
create view v1(a) as select concat(a) from t1;
2353
show columns from v1;
2354
Field Type Null Key Default Extra
2355
a varbinary(2) YES NULL
2356
select hex(a) from v1;
2361
create table t1 (a year);
2362
insert into t1 values (1);
2363
create view v1(a) as select concat(a) from t1;
2364
show columns from v1;
2365
Field Type Null Key Default Extra
2366
a varbinary(4) YES NULL
2367
select hex(a) from v1;
2372
create table t1 (a bit(64));
2373
insert into t1 values (1);
2374
create view v1(a) as select concat(a) from t1;
2375
show columns from v1;
2376
Field Type Null Key Default Extra
2377
a varbinary(64) YES NULL
2378
select hex(a) from v1;
2383
create table t1 (a timestamp);
2384
insert into t1 values (0);
2385
insert into t1 values (20010203040506);
2386
insert into t1 values (19800203040506);
2387
insert into t1 values ('2001-02-03 04:05:06');
2388
create view v1(a) as select concat(a) from t1;
2389
show columns from v1;
2390
Field Type Null Key Default Extra
2392
select hex(a) from v1;
2394
303030302D30302D30302030303A30303A3030
2395
323030312D30322D30332030343A30353A3036
2396
313938302D30322D30332030343A30353A3036
2397
323030312D30322D30332030343A30353A3036
2400
create table t1 (a date);
2401
insert into t1 values ('2001-02-03');
2402
insert into t1 values (20010203);
2403
create view v1(a) as select concat(a) from t1;
2404
show columns from v1;
2405
Field Type Null Key Default Extra
2406
a varbinary(10) YES NULL
2407
select hex(a) from v1;
2409
323030312D30322D3033
2410
323030312D30322D3033
2413
create table t1 (a time);
2414
insert into t1 values (1);
2415
insert into t1 values ('01:02:03');
2416
create view v1(a) as select concat(a) from t1;
2417
show columns from v1;
2418
Field Type Null Key Default Extra
2419
a varbinary(8) YES NULL
2420
select hex(a) from v1;
2426
create table t1 (a datetime);
2427
insert into t1 values ('2001-02-03 04:05:06');
2428
insert into t1 values (20010203040506);
2429
create view v1(a) as select concat(a) from t1;
2430
show columns from v1;
2431
Field Type Null Key Default Extra
2432
a varbinary(19) YES NULL
2433
select hex(a) from v1;
2435
323030312D30322D30332030343A30353A3036
2436
323030312D30322D30332030343A30353A3036
2439
create function f1 (par1 int) returns int
2441
return concat(par1);
2447
select hex(concat(f1(1)));
2450
create table t1 as select f1(1) as c1;
2451
show create table t1;
2453
t1 CREATE TABLE `t1` (
2454
`c1` int(11) DEFAULT NULL
2455
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2457
create table t1 as select concat(f1(1)) as c1;
2458
show create table t1;
2460
t1 CREATE TABLE `t1` (
2461
`c1` varchar(11) DEFAULT NULL
2462
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2463
create view v1 as select concat(f1(1)) as c1;
2464
show columns from v1;
2465
Field Type Null Key Default Extra
2466
c1 varchar(11) YES NULL
2470
create function f1 (par1 decimal(18,2)) returns decimal(18,2)
2472
return concat(par1);
2478
select hex(concat(f1(123.45)));
2479
hex(concat(f1(123.45)))
2481
create table t1 as select f1(123.45) as c1;
2482
show create table t1;
2484
t1 CREATE TABLE `t1` (
2485
`c1` decimal(18,2) DEFAULT NULL
2486
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2488
create table t1 as select concat(f1(123.45)) as c1;
2489
show create table t1;
2491
t1 CREATE TABLE `t1` (
2492
`c1` varchar(20) DEFAULT NULL
2493
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2494
create view v1 as select concat(f1(123.45)) as c1;
2495
show columns from v1;
2496
Field Type Null Key Default Extra
2497
c1 varchar(20) YES NULL
2501
create function f1 (par1 float) returns float
2503
return concat(par1);
2509
select hex(concat(f1(123.45)));
2510
hex(concat(f1(123.45)))
2512
create table t1 as select f1(123.45) as c1;
2513
show create table t1;
2515
t1 CREATE TABLE `t1` (
2516
`c1` float DEFAULT NULL
2517
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2519
create table t1 as select concat(f1(123.45)) as c1;
2520
show create table t1;
2522
t1 CREATE TABLE `t1` (
2523
`c1` varchar(12) DEFAULT NULL
2524
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2525
create view v1 as select concat(f1(123.45)) as c1;
2526
show columns from v1;
2527
Field Type Null Key Default Extra
2528
c1 varchar(12) YES NULL
2532
create function f1 (par1 date) returns date
2534
return concat(par1);
2536
set @a= f1(cast('2001-01-02' as date));
2539
323030312D30312D3032
2540
select hex(concat(f1(cast('2001-01-02' as date))));
2541
hex(concat(f1(cast('2001-01-02' as date))))
2542
323030312D30312D3032
2543
create table t1 as select f1(cast('2001-01-02' as date)) as c1;
2544
show create table t1;
2546
t1 CREATE TABLE `t1` (
2547
`c1` date DEFAULT NULL
2548
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2550
create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1;
2551
show create table t1;
2553
t1 CREATE TABLE `t1` (
2554
`c1` varchar(10) DEFAULT NULL
2555
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2556
create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1;
2557
show columns from v1;
2558
Field Type Null Key Default Extra
2559
c1 varchar(10) YES NULL
2564
# End of WL#2649 Number-to-string conversions