-- source include/have_innodb.inc
-- source include/have_bdb.inc
--source include/have_ujis.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 INSTR() function with Japanese characters in ujis encoding
#

SET NAMES ujis;
SET character_set_database = ujis;

CREATE TABLE `Ｔ１` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `Ｔ２` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `Ｔ３` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `Ｔ４` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `Ｔ５` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `Ｔ６` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `Ｔ７` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `Ｔ８` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `Ｔ９` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `Ｔ１０` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = bdb;
CREATE TABLE `Ｔ１１` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis engine = bdb;
CREATE TABLE `Ｔ１２` (`Ｃ１` char(5), INDEX(`Ｃ１`)) DEFAULT CHARSET = ujis 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 INSTR(`Ｃ１`,'ｱ') from `Ｔ１`;
SELECT INSTR(`Ｃ１`,'ｲ') from `Ｔ１`;
SELECT INSTR(`Ｃ１`,'ｳ') from `Ｔ１`;
SELECT INSTR(`Ｃ１`,'ｴ') from `Ｔ１`;
SELECT INSTR(`Ｃ１`,'ｵ') from `Ｔ１`;
SELECT INSTR(`Ｃ１`,'ﾝ') from `Ｔ１`;
SELECT INSTR(`Ｃ１`,'あ') from `Ｔ２`;
SELECT INSTR(`Ｃ１`,'い') from `Ｔ２`;
SELECT INSTR(`Ｃ１`,'う') from `Ｔ２`;
SELECT INSTR(`Ｃ１`,'え') from `Ｔ２`;
SELECT INSTR(`Ｃ１`,'お') from `Ｔ２`;
SELECT INSTR(`Ｃ１`,'ん') from `Ｔ２`;
SELECT INSTR(`Ｃ１`,'龔') from `Ｔ３`;
SELECT INSTR(`Ｃ１`,'龖') from `Ｔ３`;
SELECT INSTR(`Ｃ１`,'龗') from `Ｔ３`;
SELECT INSTR(`Ｃ１`,'龞') from `Ｔ３`;
SELECT INSTR(`Ｃ１`,'龡') from `Ｔ３`;
SELECT INSTR(`Ｃ１`,'丂') from `Ｔ３`;

#MyISAM
SELECT INSTR(`Ｃ１`,'ｱ') from `Ｔ４`;
SELECT INSTR(`Ｃ１`,'ｲ') from `Ｔ４`;
SELECT INSTR(`Ｃ１`,'ｳ') from `Ｔ４`;
SELECT INSTR(`Ｃ１`,'ｴ') from `Ｔ４`;
SELECT INSTR(`Ｃ１`,'ｵ') from `Ｔ４`;
SELECT INSTR(`Ｃ１`,'ﾝ') from `Ｔ４`;
SELECT INSTR(`Ｃ１`,'あ') from `Ｔ５`;
SELECT INSTR(`Ｃ１`,'い') from `Ｔ５`;
SELECT INSTR(`Ｃ１`,'う') from `Ｔ５`;
SELECT INSTR(`Ｃ１`,'え') from `Ｔ５`;
SELECT INSTR(`Ｃ１`,'お') from `Ｔ５`;
SELECT INSTR(`Ｃ１`,'ん') from `Ｔ５`;
SELECT INSTR(`Ｃ１`,'龔') from `Ｔ６`;
SELECT INSTR(`Ｃ１`,'龖') from `Ｔ６`;
SELECT INSTR(`Ｃ１`,'龗') from `Ｔ６`;
SELECT INSTR(`Ｃ１`,'龞') from `Ｔ６`;
SELECT INSTR(`Ｃ１`,'龡') from `Ｔ６`;
SELECT INSTR(`Ｃ１`,'丂') from `Ｔ６`;

#HEAP
SELECT INSTR(`Ｃ１`,'ｱ') from `Ｔ７`;
SELECT INSTR(`Ｃ１`,'ｲ') from `Ｔ７`;
SELECT INSTR(`Ｃ１`,'ｳ') from `Ｔ７`;
SELECT INSTR(`Ｃ１`,'ｴ') from `Ｔ７`;
SELECT INSTR(`Ｃ１`,'ｵ') from `Ｔ７`;
SELECT INSTR(`Ｃ１`,'ﾝ') from `Ｔ７`;
SELECT INSTR(`Ｃ１`,'あ') from `Ｔ８`;
SELECT INSTR(`Ｃ１`,'い') from `Ｔ８`;
SELECT INSTR(`Ｃ１`,'う') from `Ｔ８`;
SELECT INSTR(`Ｃ１`,'え') from `Ｔ８`;
SELECT INSTR(`Ｃ１`,'お') from `Ｔ８`;
SELECT INSTR(`Ｃ１`,'ん') from `Ｔ８`;
SELECT INSTR(`Ｃ１`,'龔') from `Ｔ９`;
SELECT INSTR(`Ｃ１`,'龖') from `Ｔ９`;
SELECT INSTR(`Ｃ１`,'龗') from `Ｔ９`;
SELECT INSTR(`Ｃ１`,'龞') from `Ｔ９`;
SELECT INSTR(`Ｃ１`,'龡') from `Ｔ９`;
SELECT INSTR(`Ｃ１`,'丂') from `Ｔ９`;

#BDB
SELECT INSTR(`Ｃ１`,'ｱ') from `Ｔ１０`;
SELECT INSTR(`Ｃ１`,'ｲ') from `Ｔ１０`;
SELECT INSTR(`Ｃ１`,'ｳ') from `Ｔ１０`;
SELECT INSTR(`Ｃ１`,'ｴ') from `Ｔ１０`;
SELECT INSTR(`Ｃ１`,'ｵ') from `Ｔ１０`;
SELECT INSTR(`Ｃ１`,'ﾝ') from `Ｔ１０`;
SELECT INSTR(`Ｃ１`,'あ') from `Ｔ１１`;
SELECT INSTR(`Ｃ１`,'い') from `Ｔ１１`;
SELECT INSTR(`Ｃ１`,'う') from `Ｔ１１`;
SELECT INSTR(`Ｃ１`,'え') from `Ｔ１１`;
SELECT INSTR(`Ｃ１`,'お') from `Ｔ１１`;
SELECT INSTR(`Ｃ１`,'ん') from `Ｔ１１`;
SELECT INSTR(`Ｃ１`,'龔') from `Ｔ１２`;
SELECT INSTR(`Ｃ１`,'龖') from `Ｔ１２`;
SELECT INSTR(`Ｃ１`,'龗') from `Ｔ１２`;
SELECT INSTR(`Ｃ１`,'龞') from `Ｔ１２`;
SELECT INSTR(`Ｃ１`,'龡') from `Ｔ１２`;
SELECT INSTR(`Ｃ１`,'丂') 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 `Ｔ１２`;
