--source include/have_ucs2.inc

--disable_warnings
drop table if exists `Ｔ１`;
drop table if exists `Ｔ２`;
drop table if exists `Ｔ３`;
drop table if exists `Ｔ４`;
drop table if exists `Ｔ５`;
drop table if exists `Ｔ６`;
drop table if exists `Ｔ７`;
drop table if exists `Ｔ８`;
drop table if exists `Ｔ９`;
drop table if exists `Ｔ１０`;
--enable_warnings

#
# Test RTRIM() function with Japanese characters in ucs2 encoding
#

SET NAMES ujis;
SET character_set_database = ucs2;
SET collation_connection = ucs2_general_ci;

CREATE TABLE `Ｔ１` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = innodb;
CREATE TABLE `Ｔ２` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = innodb;
CREATE TABLE `Ｔ３` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = innodb;
CREATE TABLE `Ｔ４` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = myisam;
CREATE TABLE `Ｔ５` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = myisam;
CREATE TABLE `Ｔ６` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = myisam;
CREATE TABLE `Ｔ７` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = heap;
CREATE TABLE `Ｔ８` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = heap;
CREATE TABLE `Ｔ９` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = heap;
CREATE TABLE `Ｔ１０` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = bdb;
CREATE TABLE `Ｔ１１` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = bdb;
CREATE TABLE `Ｔ１２` (`Ｃ１` char(8), INDEX(`Ｃ１`)) DEFAULT CHARSET = ucs2 engine = bdb;

INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ');
INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ ');
INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ  ');
INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ　');
INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ　　');
INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ　　　');
INSERT INTO `Ｔ２` VALUES ('あいうえお');
INSERT INTO `Ｔ２` VALUES ('あいうえお ');
INSERT INTO `Ｔ２` VALUES ('あいうえお  ');
INSERT INTO `Ｔ２` VALUES ('あいうえお   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ２` VALUES ('あいうえお　');
INSERT INTO `Ｔ２` VALUES ('あいうえお　　');
INSERT INTO `Ｔ２` VALUES ('あいうえお　　　');
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡');
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡 ');
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡  ');
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡　');
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡　　');
INSERT INTO `Ｔ３` VALUES ('龔龖龗龞龡　　　');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ ');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ  ');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ　');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ　　');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ　　　');
INSERT INTO `Ｔ５` VALUES ('あいうえお');
INSERT INTO `Ｔ５` VALUES ('あいうえお ');
INSERT INTO `Ｔ５` VALUES ('あいうえお  ');
INSERT INTO `Ｔ５` VALUES ('あいうえお   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ５` VALUES ('あいうえお　');
INSERT INTO `Ｔ５` VALUES ('あいうえお　　');
INSERT INTO `Ｔ５` VALUES ('あいうえお　　　');
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡');
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡 ');
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡  ');
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡　');
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡　　');
INSERT INTO `Ｔ６` VALUES ('龔龖龗龞龡　　　');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ ');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ  ');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ　');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ　　');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ　　　');
INSERT INTO `Ｔ８` VALUES ('あいうえお');
INSERT INTO `Ｔ８` VALUES ('あいうえお ');
INSERT INTO `Ｔ８` VALUES ('あいうえお  ');
INSERT INTO `Ｔ８` VALUES ('あいうえお   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ８` VALUES ('あいうえお　');
INSERT INTO `Ｔ８` VALUES ('あいうえお　　');
INSERT INTO `Ｔ８` VALUES ('あいうえお　　　');
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡');
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡 ');
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡  ');
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡　');
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡　　');
INSERT INTO `Ｔ９` VALUES ('龔龖龗龞龡　　　');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ ');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ  ');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ　');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ　　');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ　　　');
INSERT INTO `Ｔ１１` VALUES ('あいうえお');
INSERT INTO `Ｔ１１` VALUES ('あいうえお ');
INSERT INTO `Ｔ１１` VALUES ('あいうえお  ');
INSERT INTO `Ｔ１１` VALUES ('あいうえお   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ１１` VALUES ('あいうえお　');
INSERT INTO `Ｔ１１` VALUES ('あいうえお　　');
INSERT INTO `Ｔ１１` VALUES ('あいうえお　　　');
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡');
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡 ');
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡  ');
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡   ');
# Double byte spaces are not supposed to be trimed
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡　');
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡　　');
INSERT INTO `Ｔ１２` VALUES ('龔龖龗龞龡　　　');

#InnoDB
SELECT RTRIM(`Ｃ１`) from `Ｔ１`;
SELECT RTRIM(`Ｃ１`) from `Ｔ２`;
SELECT RTRIM(`Ｃ１`) from `Ｔ３`;

#MyISAM
SELECT RTRIM(`Ｃ１`) from `Ｔ４`;
SELECT RTRIM(`Ｃ１`) from `Ｔ５`;
SELECT RTRIM(`Ｃ１`) from `Ｔ６`;

#HEAP
SELECT RTRIM(`Ｃ１`) from `Ｔ７`;
SELECT RTRIM(`Ｃ１`) from `Ｔ８`;
SELECT RTRIM(`Ｃ１`) from `Ｔ９`;

#BDB
SELECT RTRIM(`Ｃ１`) from `Ｔ１０`;
SELECT RTRIM(`Ｃ１`) from `Ｔ１１`;
SELECT RTRIM(`Ｃ１`) from `Ｔ１２`;

DROP TABLE `Ｔ１`;
DROP TABLE `Ｔ２`;
DROP TABLE `Ｔ３`;
DROP TABLE `Ｔ４`;
DROP TABLE `Ｔ５`;
DROP TABLE `Ｔ６`;
DROP TABLE `Ｔ７`;
DROP TABLE `Ｔ８`;
DROP TABLE `Ｔ９`;
DROP TABLE `Ｔ１０`;
DROP TABLE `Ｔ１１`;
DROP TABLE `Ｔ１２`;
