@@ -246,14 +246,53 @@ DROP TABLE t1;
246
246
drop table if exists t1;
247
247
create table t1 select repeat('a',10) as c1;
248
248
delete from t1;
249
+ insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
250
+ insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
249
251
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
250
252
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
251
253
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
252
254
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
253
255
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
254
256
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
255
- SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
256
- GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
257
+ create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
258
+ select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
259
+ column_name collation_name
260
+ c1 big5_chinese_ci
261
+ name big5_chinese_ci
262
+ SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
263
+ GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
264
+ <00> 00
265
+ <01> 01
266
+ <02> 02
267
+ <03> 03
268
+ <04> 04
269
+ <05> 05
270
+ <06> 06
271
+ <07> 07
272
+ <08> 08
273
+ <09> 09
274
+ <0A> 0A
275
+ <0B> 0B
276
+ <0C> 0C
277
+ <0D> 0D
278
+ <0E> 0E
279
+ <0F> 0F
280
+ <10> 10
281
+ <11> 11
282
+ <12> 12
283
+ <13> 13
284
+ <14> 14
285
+ <15> 15
286
+ <16> 16
287
+ <17> 17
288
+ <18> 18
289
+ <19> 19
290
+ <1A> 1A
291
+ <1B> 1B
292
+ <1C> 1C
293
+ <1D> 1D
294
+ <1E> 1E
295
+ <1F> 1F
257
296
20
258
297
! 21
259
298
" 22
321
360
{ 7B
322
361
| 7C
323
362
} 7D
324
- 7F
363
+ <7F> 7F
325
364
drop table t1;
365
+ drop view v1;
326
366
SELECT strcmp('a','a '), strcmp('a ','a');
327
367
strcmp('a','a ') strcmp('a ','a')
328
368
0 0
@@ -479,6 +519,154 @@ a hex(b) c
479
519
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
480
520
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
481
521
DROP TABLE t1;
522
+ drop table if exists t1;
523
+ create table t1 select repeat('a',10) as c1;
524
+ delete from t1;
525
+ insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
526
+ insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
527
+ insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
528
+ insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
529
+ insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
530
+ insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
531
+ insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
532
+ insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
533
+ create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
534
+ select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
535
+ column_name collation_name
536
+ c1 big5_bin
537
+ name big5_bin
538
+ SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
539
+ GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
540
+ <00> 00
541
+ <01> 01
542
+ <02> 02
543
+ <03> 03
544
+ <04> 04
545
+ <05> 05
546
+ <06> 06
547
+ <07> 07
548
+ <08> 08
549
+ <09> 09
550
+ <0A> 0A
551
+ <0B> 0B
552
+ <0C> 0C
553
+ <0D> 0D
554
+ <0E> 0E
555
+ <0F> 0F
556
+ <10> 10
557
+ <11> 11
558
+ <12> 12
559
+ <13> 13
560
+ <14> 14
561
+ <15> 15
562
+ <16> 16
563
+ <17> 17
564
+ <18> 18
565
+ <19> 19
566
+ <1A> 1A
567
+ <1B> 1B
568
+ <1C> 1C
569
+ <1D> 1D
570
+ <1E> 1E
571
+ <1F> 1F
572
+ 20
573
+ ! 21
574
+ " 22
575
+ # 23
576
+ $ 24
577
+ % 25
578
+ & 26
579
+ ' 27
580
+ ( 28
581
+ ) 29
582
+ * 2A
583
+ + 2B
584
+ , 2C
585
+ - 2D
586
+ . 2E
587
+ / 2F
588
+ 0 30
589
+ 1 31
590
+ 2 32
591
+ 3 33
592
+ 4 34
593
+ 5 35
594
+ 6 36
595
+ 7 37
596
+ 8 38
597
+ 9 39
598
+ : 3A
599
+ ; 3B
600
+ < 3C
601
+ = 3D
602
+ > 3E
603
+ ? 3F
604
+ @ 40
605
+ A 41
606
+ B 42
607
+ C 43
608
+ D 44
609
+ E 45
610
+ F 46
611
+ G 47
612
+ H 48
613
+ I 49
614
+ J 4A
615
+ K 4B
616
+ L 4C
617
+ M 4D
618
+ N 4E
619
+ O 4F
620
+ P 50
621
+ Q 51
622
+ R 52
623
+ S 53
624
+ T 54
625
+ U 55
626
+ V 56
627
+ W 57
628
+ X 58
629
+ Y 59
630
+ Z 5A
631
+ [ 5B
632
+ \ 5C
633
+ ] 5D
634
+ ^ 5E
635
+ _ 5F
636
+ ` 60
637
+ a 61
638
+ b 62
639
+ c 63
640
+ d 64
641
+ e 65
642
+ f 66
643
+ g 67
644
+ h 68
645
+ i 69
646
+ j 6A
647
+ k 6B
648
+ l 6C
649
+ m 6D
650
+ n 6E
651
+ o 6F
652
+ p 70
653
+ q 71
654
+ r 72
655
+ s 73
656
+ t 74
657
+ u 75
658
+ v 76
659
+ w 77
660
+ x 78
661
+ y 79
662
+ z 7A
663
+ { 7B
664
+ | 7C
665
+ } 7D
666
+ ~ 7E
667
+ <7F> 7F
668
+ drop table t1;
669
+ drop view v1;
482
670
SELECT strcmp('a','a '), strcmp('a ','a');
483
671
strcmp('a','a ') strcmp('a ','a')
484
672
0 0
0 commit comments