# # Test TRIM() function with Japanese characters sjis encoding # --source include/have_sjis.inc --character_set sjis SET NAMES sjis; SET character_set_database = sjis; --disable_warnings DROP TABLE IF EXISTS `T1`; DROP TABLE IF EXISTS `T2`; DROP TABLE IF EXISTS `T3`; --enable_warnings --replace_result $engine eval CREATE TABLE `T1` (`C1` CHAR(12), INDEX(`C1`)) DEFAULT CHARSET = sjis ENGINE = $engine; --replace_result $engine eval CREATE TABLE `T2` (`C1` CHAR(12), INDEX(`C1`)) DEFAULT CHARSET = sjis ENGINE = $engine; --replace_result $engine eval CREATE TABLE `T3` (`C1` CHAR(12), INDEX(`C1`)) DEFAULT CHARSET = sjis ENGINE = $engine; # Nothing to trim INSERT INTO `T1` VALUES ('アイウエオ'); # Test data for TRIM(TRAILING [remstr] FROM str) INSERT INTO `T1` VALUES ('アイウエオカ'); INSERT INTO `T1` VALUES ('アイウエオカカ'); INSERT INTO `T1` VALUES ('アイウエオカカカ'); # Test data for TRIM(LEADING [remstr] FROM str) INSERT INTO `T1` VALUES ('カアイウエオ'); INSERT INTO `T1` VALUES ('カカアイウエオ'); INSERT INTO `T1` VALUES ('カカカアイウエオ'); # Test data for TRIM(BOTH [remstr] FROM str) INSERT INTO `T1` VALUES ('カカカアイウエオカカカ'); # Test data for TRIM without [remstr] (remove spaces) INSERT INTO `T1` VALUES (' アイウエオ '); INSERT INTO `T2` VALUES ('あいうえお'); INSERT INTO `T2` VALUES ('あいうえおか'); INSERT INTO `T2` VALUES ('あいうえおかか'); INSERT INTO `T2` VALUES ('あいうえおかかか'); INSERT INTO `T2` VALUES ('かあいうえお'); INSERT INTO `T2` VALUES ('かかあいうえお'); INSERT INTO `T2` VALUES ('かかかあいうえお'); INSERT INTO `T2` VALUES ('かかかあいうえおかかか'); INSERT INTO `T2` VALUES (' あいうえお '); INSERT INTO `T3` VALUES ('ソ十表予構'); INSERT INTO `T3` VALUES ('ソ十表予構暴'); INSERT INTO `T3` VALUES ('ソ十表予構暴暴'); INSERT INTO `T3` VALUES ('ソ十表予構暴暴暴'); INSERT INTO `T3` VALUES ('暴ソ十表予構'); INSERT INTO `T3` VALUES ('暴暴ソ十表予構'); INSERT INTO `T3` VALUES ('暴暴暴ソ十表予構'); INSERT INTO `T3` VALUES ('暴暴暴ソ十表予構暴暴暴'); INSERT INTO `T3` VALUES (' ソ十表予構 '); SELECT `C1`,TRIM(TRAILING 'カ' FROM `C1`) FROM `T1`; SELECT `C1`,TRIM(LEADING 'カ' FROM `C1`) FROM `T1`; SELECT `C1`,TRIM(BOTH 'カ' FROM `C1`) FROM `T1`; SELECT `C1`,TRIM(`C1`) FROM `T1`; SELECT `C1`,TRIM(TRAILING 'か' FROM `C1`) FROM `T2`; SELECT `C1`,TRIM(LEADING 'か' FROM `C1`) FROM `T2`; SELECT `C1`,TRIM(BOTH 'か' FROM `C1`) FROM `T2`; SELECT `C1`,TRIM(`C1`) FROM `T2`; SELECT `C1`,TRIM(TRAILING '暴' FROM `C1`) FROM `T3`; SELECT `C1`,TRIM(LEADING '暴' FROM `C1`) FROM `T3`; SELECT `C1`,TRIM(BOTH '暴' FROM `C1`) FROM `T3`; SELECT `C1`,TRIM(`C1`) FROM `T3`; DROP TABLE `T1`; DROP TABLE `T2`; DROP TABLE `T3`;