--source include/have_sjis.inc
--source include/have_innodb.inc
--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 `Ｔ９`;
--enable_warnings

#
# Test REPLACE() function with Japanese characters in sjis encoding
#

SET NAMES sjis;
SET character_set_database = sjis;

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

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 REPLACE(`Ｃ１`,'ｱ','ｱｱ') FROM `Ｔ１`;
SELECT REPLACE(`Ｃ１`,'ｲ','ｲｲ') FROM `Ｔ１`;
SELECT REPLACE(`Ｃ１`,'ｳ','ｳｳ') FROM `Ｔ１`;
SELECT REPLACE(`Ｃ１`,'ｴ','ｴｴ') FROM `Ｔ１`;
SELECT REPLACE(`Ｃ１`,'ｵ','ｵｵ') FROM `Ｔ１`;
SELECT REPLACE(`Ｃ１`,'あ','ああ') FROM `Ｔ２`;
SELECT REPLACE(`Ｃ１`,'い','いい') FROM `Ｔ２`;
SELECT REPLACE(`Ｃ１`,'う','うう') FROM `Ｔ２`;
SELECT REPLACE(`Ｃ１`,'え','ええ') FROM `Ｔ２`;
SELECT REPLACE(`Ｃ１`,'お','おお') FROM `Ｔ２`;
SELECT REPLACE(`Ｃ１`,'ソ','ソソ') FROM `Ｔ３`;
SELECT REPLACE(`Ｃ１`,'十','十十') FROM `Ｔ３`;
SELECT REPLACE(`Ｃ１`,'表','表表') FROM `Ｔ３`;
SELECT REPLACE(`Ｃ１`,'予','予予') FROM `Ｔ３`;
SELECT REPLACE(`Ｃ１`,'構','構構') FROM `Ｔ３`;

#MyISAM
SELECT REPLACE(`Ｃ１`,'ｱ','ｱｱ') FROM `Ｔ４`;
SELECT REPLACE(`Ｃ１`,'ｲ','ｲｲ') FROM `Ｔ４`;
SELECT REPLACE(`Ｃ１`,'ｳ','ｳｳ') FROM `Ｔ４`;
SELECT REPLACE(`Ｃ１`,'ｴ','ｴｴ') FROM `Ｔ４`;
SELECT REPLACE(`Ｃ１`,'ｵ','ｵｵ') FROM `Ｔ４`;
SELECT REPLACE(`Ｃ１`,'あ','ああ') FROM `Ｔ５`;
SELECT REPLACE(`Ｃ１`,'い','いい') FROM `Ｔ５`;
SELECT REPLACE(`Ｃ１`,'う','うう') FROM `Ｔ５`;
SELECT REPLACE(`Ｃ１`,'え','ええ') FROM `Ｔ５`;
SELECT REPLACE(`Ｃ１`,'お','おお') FROM `Ｔ５`;
SELECT REPLACE(`Ｃ１`,'ソ','ソソ') FROM `Ｔ６`;
SELECT REPLACE(`Ｃ１`,'十','十十') FROM `Ｔ６`;
SELECT REPLACE(`Ｃ１`,'表','表表') FROM `Ｔ６`;
SELECT REPLACE(`Ｃ１`,'予','予予') FROM `Ｔ６`;
SELECT REPLACE(`Ｃ１`,'構','構構') FROM `Ｔ６`;

#MEMORY
SELECT REPLACE(`Ｃ１`,'ｱ','ｱｱ') FROM `Ｔ７`;
SELECT REPLACE(`Ｃ１`,'ｲ','ｲｲ') FROM `Ｔ７`;
SELECT REPLACE(`Ｃ１`,'ｳ','ｳｳ') FROM `Ｔ７`;
SELECT REPLACE(`Ｃ１`,'ｴ','ｴｴ') FROM `Ｔ７`;
SELECT REPLACE(`Ｃ１`,'ｵ','ｵｵ') FROM `Ｔ７`;
SELECT REPLACE(`Ｃ１`,'あ','ああ') FROM `Ｔ８`;
SELECT REPLACE(`Ｃ１`,'い','いい') FROM `Ｔ８`;
SELECT REPLACE(`Ｃ１`,'う','うう') FROM `Ｔ８`;
SELECT REPLACE(`Ｃ１`,'え','ええ') FROM `Ｔ８`;
SELECT REPLACE(`Ｃ１`,'お','おお') FROM `Ｔ８`;
SELECT REPLACE(`Ｃ１`,'ソ','ソソ') FROM `Ｔ９`;
SELECT REPLACE(`Ｃ１`,'十','十十') FROM `Ｔ９`;
SELECT REPLACE(`Ｃ１`,'表','表表') FROM `Ｔ９`;
SELECT REPLACE(`Ｃ１`,'予','予予') FROM `Ｔ９`;
SELECT REPLACE(`Ｃ１`,'構','構構') FROM `Ｔ９`;

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