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 `T1`;
12 DROP
TABLE IF EXISTS `T2`;
13 DROP
TABLE IF EXISTS `T3`;
15 --replace_result $engine <engine_to_be_tested>
16 eval CREATE
TABLE `T1` (`C1` CHAR(12), INDEX(`C1`)) DEFAULT CHARSET = sjis ENGINE = $engine;
17 --replace_result $engine <engine_to_be_tested>
18 eval CREATE
TABLE `T2` (`C1` CHAR(12), INDEX(`C1`)) DEFAULT CHARSET = sjis ENGINE = $engine;
19 --replace_result $engine <engine_to_be_tested>
20 eval CREATE
TABLE `T3` (`C1` CHAR(12), INDEX(`C1`)) DEFAULT CHARSET = sjis ENGINE = $engine;
23 INSERT INTO `T1` VALUES (
'アイウエオ');
24 # Test data for TRIM(TRAILING [remstr] FROM str)
25 INSERT INTO `T1` VALUES (
'アイウエオカ');
26 INSERT INTO `T1` VALUES (
'アイウエオカカ');
27 INSERT INTO `T1` VALUES (
'アイウエオカカカ');
28 # Test data for TRIM(LEADING [remstr] FROM str)
29 INSERT INTO `T1` VALUES (
'カアイウエオ');
30 INSERT INTO `T1` VALUES (
'カカアイウエオ');
31 INSERT INTO `T1` VALUES (
'カカカアイウエオ');
32 # Test data for TRIM(BOTH [remstr] FROM str)
33 INSERT INTO `T1` VALUES (
'カカカアイウエオカカカ');
34 # Test data for TRIM without [remstr] (remove spaces)
35 INSERT INTO `T1` VALUES (
' アイウエオ ');
36 INSERT INTO `T2` VALUES (
'あいうえお');
37 INSERT INTO `T2` VALUES (
'あいうえおか');
38 INSERT INTO `T2` VALUES (
'あいうえおかか');
39 INSERT INTO `T2` VALUES (
'あいうえおかかか');
40 INSERT INTO `T2` VALUES (
'かあいうえお');
41 INSERT INTO `T2` VALUES (
'かかあいうえお');
42 INSERT INTO `T2` VALUES (
'かかかあいうえお');
43 INSERT INTO `T2` VALUES (
'かかかあいうえおかかか');
44 INSERT INTO `T2` VALUES (
' あいうえお ');
45 INSERT INTO `T3` VALUES (
'ソ十表予構');
46 INSERT INTO `T3` VALUES ('ソ十表予構暴
');
47 INSERT INTO `T3` VALUES ('ソ十表予構暴暴
');
48 INSERT INTO `T3` VALUES ('ソ十表予構暴暴暴
');
49 INSERT INTO `T3` VALUES ('暴ソ十表予構
');
50 INSERT INTO `T3` VALUES ('暴暴ソ十表予構
');
51 INSERT INTO `T3` VALUES ('暴暴暴ソ十表予構
');
52 INSERT INTO `T3` VALUES ('暴暴暴ソ十表予構暴暴暴
');
53 INSERT INTO `T3` VALUES (' ソ十表予構
');
55 SELECT `C1`,TRIM(TRAILING 'カ
' FROM `C1`) FROM `T1`;
56 SELECT `C1`,TRIM(LEADING 'カ
' FROM `C1`) FROM `T1`;
57 SELECT `C1`,TRIM(BOTH 'カ
' FROM `C1`) FROM `T1`;
58 SELECT `C1`,TRIM(`C1`) FROM `T1`;
59 SELECT `C1`,TRIM(TRAILING 'か
' FROM `C1`) FROM `T2`;
60 SELECT `C1`,TRIM(LEADING 'か
' FROM `C1`) FROM `T2`;
61 SELECT `C1`,TRIM(BOTH 'か
' FROM `C1`) FROM `T2`;
62 SELECT `C1`,TRIM(`C1`) FROM `T2`;
63 SELECT `C1`,TRIM(TRAILING '暴
' FROM `C1`) FROM `T3`;
64 SELECT `C1`,TRIM(LEADING '暴
' FROM `C1`) FROM `T3`;
65 SELECT `C1`,TRIM(BOTH '暴
' FROM `C1`) FROM `T3`;
66 SELECT `C1`,TRIM(`C1`) FROM `T3`;