--character_set sjis
--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 `Ｔ１０`;
drop table if exists `Ｔ１１`;
drop table if exists `Ｔ１２`;
--enable_warnings

#
# Test RPAD() function with Japanese character in sjis encoding
#

SET NAMES sjis;
SET character_set_database = sjis;

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

INSERT INTO `Ｔ１` VALUES ('ｱｲｳｴｵ'),('ｱｲｳｴ'),('ｱｲｳ'),('ｱｲ'),('ｱ'),('');
INSERT INTO `Ｔ２` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `Ｔ３` VALUES ('ソ十表予構'),('ソ十表予'),('ソ十表'),('ソ十'),('ソ'),('');
INSERT INTO `Ｔ４` VALUES ('ｱｲｳｴｵ'),('ｱｲｳｴ'),('ｱｲｳ'),('ｱｲ'),('ｱ'),('');
INSERT INTO `Ｔ５` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `Ｔ６` VALUES ('ソ十表予構'),('ソ十表予'),('ソ十表'),('ソ十'),('ソ'),('');
INSERT INTO `Ｔ７` VALUES ('ｱｲｳｴｵ'),('ｱｲｳｴ'),('ｱｲｳ'),('ｱｲ'),('ｱ'),('');
INSERT INTO `Ｔ８` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `Ｔ９` VALUES ('ソ十表予構'),('ソ十表予'),('ソ十表'),('ソ十'),('ソ'),('');
INSERT INTO `Ｔ１０` VALUES ('ｱｲｳｴｵ'),('ｱｲｳｴ'),('ｱｲｳ'),('ｱｲ'),('ｱ'),('');
INSERT INTO `Ｔ１１` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `Ｔ１２` VALUES ('ソ十表予構'),('ソ十表予'),('ソ十表'),('ソ十'),('ソ'),('');

#InnoDB
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'｡') FROM `Ｔ１`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'Ｘ') FROM `Ｔ２`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'暴') FROM `Ｔ３`;

#MyISAM
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'｡') FROM `Ｔ４`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'Ｘ') FROM `Ｔ５`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'暴' ) FROM `Ｔ６`;

#HEAP
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'｡') FROM `Ｔ７`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'Ｘ') FROM `Ｔ８`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'暴' ) FROM `Ｔ９`;

#BDB
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'｡') FROM `Ｔ１０`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'Ｘ') FROM `Ｔ１１`;
SELECT `Ｃ１`, RPAD(`Ｃ１`,5,'暴' ) 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 `Ｔ１２`;
