2 # Test TRIM() function with Japanese characters sjis encoding
5 --source include/have_sjis.inc
8 SET character_set_database = sjis;
11 DROP TABLE IF EXISTS `‚s‚P`;
12 DROP TABLE IF EXISTS `‚s‚Q`;
13 DROP TABLE IF EXISTS `‚s‚R`;
15 --replace_result $engine <engine_to_be_tested>
16 eval CREATE TABLE `‚s‚P` (`‚b‚P` CHAR(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis ENGINE = $engine;
17 --replace_result $engine <engine_to_be_tested>
18 eval CREATE TABLE `‚s‚Q` (`‚b‚P` CHAR(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis ENGINE = $engine;
19 --replace_result $engine <engine_to_be_tested>
20 eval CREATE TABLE `‚s‚R` (`‚b‚P` CHAR(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis ENGINE = $engine;
23 INSERT INTO `‚s‚P` VALUES ('±²³´µ');
24 # Test data for TRIM(TRAILING [remstr] FROM str)
25 INSERT INTO `‚s‚P` VALUES ('±²³´µ¶');
26 INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶');
27 INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶¶');
28 # Test data for TRIM(LEADING [remstr] FROM str)
29 INSERT INTO `‚s‚P` VALUES ('¶±²³´µ');
30 INSERT INTO `‚s‚P` VALUES ('¶¶±²³´µ');
31 INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ');
32 # Test data for TRIM(BOTH [remstr] FROM str)
33 INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ¶¶¶');
34 # Test data for TRIM without [remstr] (remove spaces)
35 INSERT INTO `‚s‚P` VALUES (' ±²³´µ ');
36 INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨');
37 INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©');
38 INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©');
39 INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©');
40 INSERT INTO `‚s‚Q` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨');
41 INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨');
42 INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨');
43 INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©');
44 INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨ ');
45 INSERT INTO `‚s‚R` VALUES ('ƒ\�\•\—\�\');
46 INSERT INTO `‚s‚R` VALUES ('ƒ\�\•\—\�\–\');
47 INSERT INTO `‚s‚R` VALUES ('ƒ\�\•\—\�\–\–\');
48 INSERT INTO `‚s‚R` VALUES ('ƒ\�\•\—\�\–\–\–\');
49 INSERT INTO `‚s‚R` VALUES ('–\ƒ\�\•\—\�\');
50 INSERT INTO `‚s‚R` VALUES ('–\–\ƒ\�\•\—\�\');
51 INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\�\•\—\�\');
52 INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\�\•\—\�\–\–\–\');
53 INSERT INTO `‚s‚R` VALUES (' ƒ\�\•\—\�\ ');
55 SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P`;
56 SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P`;
57 SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P`;
58 SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P`;
59 SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`;
60 SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`;
61 SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚Q`;
62 SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚Q`;
63 SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚R`;
64 SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚R`;
65 SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚R`;
66 SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚R`;