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

#
# Test LIKE pattern matching using Japanese characters in ucs2 encoding
#

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

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

#Insert the following data in each table
# jisx0201 hankaku-katakana data
# jisx0208 data
# jisx0212 supplemental character data

INSERT INTO `Ｔ１` VALUES
 ('PQRSTUVWXYZ[\\]^_')
,(' ｡｢｣､･ｦｧｨｩｪｫｬｭｮｯ')
,('ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ')
,('ﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏ')
,('ﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜﾝﾞﾟ');

INSERT INTO `Ｔ２` VALUES
 ('　　、。，．・：；？！゛゜´｀¨＾￣＿ヽ')
,('ヾゝゞ〃仝々〆〇ー―‐／＼〜‖｜…‥‘’')
,('“”（）〔〕［］｛｝〈〉《》「」『』【】')
,('・ぁあぃいぅうぇえぉおかがきぎくぐけげこ')
,('とどなにぬねのはばぱひびぴふぶぷへべぺほ')
,('ぼぽまみむめもゃやゅゆょよらりるれろゎわ')
,('・ァアィイゥウェエォオカガキギクグケゲコ')
,('・亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵')
,('・弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞')
,('・鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻');

INSERT INTO `Ｔ３` VALUES
 ('・˛˚~΄΅・・・・・・・・¡¦¿・・・')
,('乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠')
,('仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众')
,('伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘')
,('・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪')
,('鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖')
,('齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒');

INSERT INTO `Ｔ４` VALUES
 ('PQRSTUVWXYZ[\\]^_')
,(' ｡｢｣､･ｦｧｨｩｪｫｬｭｮｯ')
,('ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ')
,('ﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏ')
,('ﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜﾝﾞﾟ');

INSERT INTO `Ｔ５` VALUES
 ('　　、。，．・：；？！゛゜´｀¨＾￣＿ヽ')
,('ヾゝゞ〃仝々〆〇ー―‐／＼〜‖｜…‥‘’')
,('“”（）〔〕［］｛｝〈〉《》「」『』【】')
,('・ぁあぃいぅうぇえぉおかがきぎくぐけげこ')
,('とどなにぬねのはばぱひびぴふぶぷへべぺほ')
,('ぼぽまみむめもゃやゅゆょよらりるれろゎわ')
,('・ァアィイゥウェエォオカガキギクグケゲコ')
,('・亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵')
,('・弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞')
,('・鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻');

INSERT INTO `Ｔ６` VALUES
 ('・˛˚~΄΅・・・・・・・・¡¦¿・・・')
,('乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠')
,('仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众')
,('伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘')
,('・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪')
,('鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖')
,('齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒');

INSERT INTO `Ｔ７` VALUES
 ('PQRSTUVWXYZ[\\]^_')
,(' ｡｢｣､･ｦｧｨｩｪｫｬｭｮｯ')
,('ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ')
,('ﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏ')
,('ﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜﾝﾞﾟ');

INSERT INTO `Ｔ８` VALUES
 ('　　、。，．・：；？！゛゜´｀¨＾￣＿ヽ')
,('ヾゝゞ〃仝々〆〇ー―‐／＼〜‖｜…‥‘’')
,('“”（）〔〕［］｛｝〈〉《》「」『』【】')
,('・ぁあぃいぅうぇえぉおかがきぎくぐけげこ')
,('とどなにぬねのはばぱひびぴふぶぷへべぺほ')
,('ぼぽまみむめもゃやゅゆょよらりるれろゎわ')
,('・ァアィイゥウェエォオカガキギクグケゲコ')
,('・亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵')
,('・弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞')
,('・鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻');

INSERT INTO `Ｔ９` VALUES
 ('・˛˚~΄΅・・・・・・・・¡¦¿・・・')
,('乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠')
,('仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众')
,('伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘')
,('・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪')
,('鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖')
,('齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒');

#INNODB
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE ' %';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE '% %';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE '% ';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE 'ﾀ%';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE '%ﾗﾘ%';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE '%ｿ';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE 'ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ%';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE '%ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ%';
SELECT * FROM `Ｔ１` WHERE `Ｃ１` LIKE '%ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '　%';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '%　%';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '%　';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE 'と%';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '%あ%';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '%わ';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '・ぁあぃいぅうぇえぉおかがきぎくぐけげこ%';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '%・ぁあぃいぅうぇえぉおかがきぎくぐけげこ%';
SELECT * FROM `Ｔ２` WHERE `Ｃ１` LIKE '%・ぁあぃいぅうぇえぉおかがきぎくぐけげこ';
SELECT * FROM `Ｔ３` WHERE `Ｃ１` LIKE '鼫%';
SELECT * FROM `Ｔ３` WHERE `Ｃ１` LIKE '%鼺%';
SELECT * FROM `Ｔ３` WHERE `Ｃ１` LIKE '%齖';
SELECT * FROM `Ｔ３` WHERE `Ｃ１` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖%';
SELECT * FROM `Ｔ３` WHERE `Ｃ１` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖%';
SELECT * FROM `Ｔ３` WHERE `Ｃ１` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖';

#MyISAM
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE ' %';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE '% %';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE '% ';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE 'ﾀ%';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE '%ﾗﾘ%';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE '%ｿ';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE 'ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ%';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE '%ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ%';
SELECT * FROM `Ｔ４` WHERE `Ｃ１` LIKE '%ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '　%';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '%　%';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '%　';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE 'と%';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '%あ%';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '%わ';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '・ぁあぃいぅうぇえぉおかがきぎくぐけげこ%';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '%・ぁあぃいぅうぇえぉおかがきぎくぐけげこ%';
SELECT * FROM `Ｔ５` WHERE `Ｃ１` LIKE '%・ぁあぃいぅうぇえぉおかがきぎくぐけげこ';
SELECT * FROM `Ｔ６` WHERE `Ｃ１` LIKE '鼫%';
SELECT * FROM `Ｔ６` WHERE `Ｃ１` LIKE '%鼺%';
SELECT * FROM `Ｔ６` WHERE `Ｃ１` LIKE '%齖';
SELECT * FROM `Ｔ６` WHERE `Ｃ１` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖%';
SELECT * FROM `Ｔ６` WHERE `Ｃ１` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖%';
SELECT * FROM `Ｔ６` WHERE `Ｃ１` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖';

#MEMORY
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE ' %';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE '% %';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE '% ';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE 'ﾀ%';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE '%ﾗﾘ%';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE '%ｿ';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE 'ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ%';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE '%ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ%';
SELECT * FROM `Ｔ７` WHERE `Ｃ１` LIKE '%ｰｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿ';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '　%';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '%　%';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '%　';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE 'と%';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '%あ%';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '%わ';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '・ぁあぃいぅうぇえぉおかがきぎくぐけげこ%';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '%・ぁあぃいぅうぇえぉおかがきぎくぐけげこ%';
SELECT * FROM `Ｔ８` WHERE `Ｃ１` LIKE '%・ぁあぃいぅうぇえぉおかがきぎくぐけげこ';
SELECT * FROM `Ｔ９` WHERE `Ｃ１` LIKE '鼫%';
SELECT * FROM `Ｔ９` WHERE `Ｃ１` LIKE '%鼺%';
SELECT * FROM `Ｔ９` WHERE `Ｃ１` LIKE '%齖';
SELECT * FROM `Ｔ９` WHERE `Ｃ１` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖%';
SELECT * FROM `Ｔ９` WHERE `Ｃ１` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖%';
SELECT * FROM `Ｔ９` WHERE `Ｃ１` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖';

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