1# 2# Tests with the big5 character set 3# 4--disable_warnings 5drop table if exists t1; 6--enable_warnings 7 8# 9# Bug 1552: tis620 <-> unicode conversion crashed 10# Check tis620 -> utf8 -> tis620 round trip conversion 11# 12 13SET @pl0= _tis620 0x000102030405060708090A0B0C0D0E0F; 14SET @pl1= _tis620 0x101112131415161718191A1B1C1D1E1F; 15SET @pl2= _tis620 0x202122232425262728292A2B2C2D2E2F; 16SET @pl3= _tis620 0x303132333435363738393A3B3C3D3E3F; 17SET @pl4= _tis620 0x404142434445464748494A4B4C4D4E4F; 18SET @pl5= _tis620 0x505152535455565758595A5B5C5D5E5F; 19SET @pl6= _tis620 0x606162636465666768696A6B6C6D6E6F; 20SET @pl7= _tis620 0x707172737475767778797A7B7C7D7E7F; 21SET @pl8= _tis620 0x808182838485868788898A8B8C8D8E8F; 22SET @pl9= _tis620 0x909192939495969798999A9B9C9D9E9F; 23SET @plA= _tis620 0xA0A1A2A3A4A5A6A7A8A9AAABACADAEAF; 24SET @plB= _tis620 0xB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF; 25SET @plC= _tis620 0xC0C1C2C3C4C5C6C7C8C9CACBCCCDCECF; 26SET @plD= _tis620 0xD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF; 27SET @plE= _tis620 0xE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF; 28SET @plF= _tis620 0xF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF; 29 30SELECT hex(@u0:=convert(@pl0 using utf8)); 31SELECT hex(@u1:=convert(@pl1 using utf8)); 32SELECT hex(@u2:=convert(@pl2 using utf8)); 33SELECT hex(@u3:=convert(@pl3 using utf8)); 34SELECT hex(@u4:=convert(@pl4 using utf8)); 35SELECT hex(@u5:=convert(@pl5 using utf8)); 36SELECT hex(@u6:=convert(@pl6 using utf8)); 37SELECT hex(@u7:=convert(@pl7 using utf8)); 38SELECT hex(@u8:=convert(@pl8 using utf8)); 39SELECT hex(@u9:=convert(@pl9 using utf8)); 40SELECT hex(@uA:=convert(@plA using utf8)); 41SELECT hex(@uB:=convert(@plB using utf8)); 42SELECT hex(@uC:=convert(@plC using utf8)); 43SELECT hex(@uD:=convert(@plD using utf8)); 44SELECT hex(@uE:=convert(@plE using utf8)); 45SELECT hex(@uF:=convert(@plF using utf8)); 46 47SELECT hex(convert(@u0 USING tis620)); 48SELECT hex(convert(@u1 USING tis620)); 49SELECT hex(convert(@u2 USING tis620)); 50SELECT hex(convert(@u3 USING tis620)); 51SELECT hex(convert(@u4 USING tis620)); 52SELECT hex(convert(@u5 USING tis620)); 53SELECT hex(convert(@u6 USING tis620)); 54SELECT hex(convert(@u7 USING tis620)); 55SELECT hex(convert(@u8 USING tis620)); 56SELECT hex(convert(@u9 USING tis620)); 57SELECT hex(convert(@uA USING tis620)); 58SELECT hex(convert(@uB USING tis620)); 59SELECT hex(convert(@uC USING tis620)); 60SELECT hex(convert(@uD USING tis620)); 61SELECT hex(convert(@uE USING tis620)); 62SELECT hex(convert(@uF USING tis620)); 63 64SET NAMES tis620; 65--character_set tis620 66 67# 68# Check the following: 69# "a" == "a " 70# "a\0" < "a" 71# "a\0" < "a " 72 73SELECT 'a' = 'a '; 74SELECT 'a\0' < 'a'; 75SELECT 'a\0' < 'a '; 76SELECT 'a\t' < 'a'; 77SELECT 'a\t' < 'a '; 78 79CREATE TABLE t1 (a char(10) not null) CHARACTER SET tis620; 80INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); 81SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; 82DROP TABLE t1; 83 84# 85# Bug#6608 86# 87SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; 88CREATE TABLE t1 ( 89 `id` int(11) NOT NULL auto_increment, 90 `url` varchar(200) NOT NULL default '', 91 `name` varchar(250) NOT NULL default '', 92 `type` int(11) NOT NULL default '0', 93 `website` varchar(250) NOT NULL default '', 94 `adddate` date NOT NULL default '0000-00-00', 95 `size` varchar(20) NOT NULL default '', 96 `movieid` int(11) NOT NULL default '0', 97 `musicid` int(11) NOT NULL default '0', 98 `star` varchar(20) NOT NULL default '', 99 `download` int(11) NOT NULL default '0', 100 `lastweek` int(11) NOT NULL default '0', 101 `thisweek` int(11) NOT NULL default '0', 102 `page` varchar(250) NOT NULL default '', 103 PRIMARY KEY (`id`), 104 UNIQUE KEY `url` (`url`) 105) CHARACTER SET tis620; 106 107INSERT INTO t1 VALUES 108(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord 109of the Rings 110Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0, 111''); 112INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O 113Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,''); 114INSERT INTO t1 VALUES 115(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso 116n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,''); 117select * from t1 order by id; 118DROP TABLE t1; 119 120 121SET collation_connection='tis620_thai_ci'; 122-- source include/ctype_filesort.inc 123-- source include/ctype_like_escape.inc 124--source include/ctype_ascii_order.inc 125SET collation_connection='tis620_bin'; 126-- source include/ctype_filesort.inc 127-- source include/ctype_like_escape.inc 128SET sql_mode = default; 129# End of 4.1 tests 130 131 132--echo # 133--echo # Start of 5.6 tests 134--echo # 135 136--echo # 137--echo # WL#3664 WEIGHT_STRING 138--echo # 139 140set names tis620; 141set collation_connection=tis620_thai_ci; 142--source include/weight_string.inc 143select hex(weight_string(cast(0xE0A1 as char))); 144select hex(weight_string(cast(0xE0A1 as char) as char(1))); 145 146set collation_connection=tis620_bin; 147--source include/weight_string.inc 148select hex(weight_string(cast(0xE0A1 as char))); 149select hex(weight_string(cast(0xE0A1 as char) as char(1))); 150 151--echo # 152--echo # Bugs#12635232: VALGRIND WARNINGS: IS_IPV6, IS_IPV4, INET6_ATON, 153--echo # INET6_NTOA + MULTIBYTE CHARSET. 154--echo # 155 156SET NAMES tis620; 157--source include/ctype_inet.inc 158 159--echo # 160--echo # End of 5.6 tests 161--echo # 162