mariadb/mysql-test/suite/jp/t/jp_where_sjis.test

105 lines
4.5 KiB
Text
Raw Normal View History

--character_set sjis
--disable_warnings
drop table if exists `<60>s<EFBFBD>P`;
drop table if exists `<60>s<EFBFBD>Q`;
drop table if exists `<60>s<EFBFBD>R`;
drop table if exists `<60>s<EFBFBD>S`;
drop table if exists `<60>s<EFBFBD>T`;
drop table if exists `<60>s<EFBFBD>U`;
drop table if exists `<60>s<EFBFBD>V`;
drop table if exists `<60>s<EFBFBD>W`;
drop table if exists `<60>s<EFBFBD>X`;
drop table if exists `<60>s<EFBFBD>P<EFBFBD>O`;
drop table if exists `<60>s<EFBFBD>P<EFBFBD>P`;
drop table if exists `<60>s<EFBFBD>P<EFBFBD>Q`;
--enable_warnings
#
# Test Displaying Japanese charact using WHERE condtion in sjis encoding
#
SET NAMES sjis;
SET character_set_database = sjis;
CREATE TABLE `<60>s<EFBFBD>P` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `<60>s<EFBFBD>Q` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `<60>s<EFBFBD>R` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `<60>s<EFBFBD>S` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `<60>s<EFBFBD>T` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `<60>s<EFBFBD>U` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `<60>s<EFBFBD>V` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = heap;
CREATE TABLE `<60>s<EFBFBD>W` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = heap;
CREATE TABLE `<60>s<EFBFBD>X` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = heap;
CREATE TABLE `<60>s<EFBFBD>P<EFBFBD>O` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = bdb;
CREATE TABLE `<60>s<EFBFBD>P<EFBFBD>P` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = bdb;
CREATE TABLE `<60>s<EFBFBD>P<EFBFBD>Q` (`<60>b<EFBFBD>P` char(20), INDEX(`<60>b<EFBFBD>P`)) DEFAULT CHARSET = sjis engine = bdb;
#Load the following data in each table
# jisx0201 hankaku-katakana data
# jisx0208 data
# jisx0212 supplemental character data
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `<60>s<EFBFBD>P`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `<60>s<EFBFBD>Q`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `<60>s<EFBFBD>R`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `<60>s<EFBFBD>S`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `<60>s<EFBFBD>T`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `<60>s<EFBFBD>U`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `<60>s<EFBFBD>V`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `<60>s<EFBFBD>W`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `<60>s<EFBFBD>X`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `<60>s<EFBFBD>P<EFBFBD>O`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `<60>s<EFBFBD>P<EFBFBD>P`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `<60>s<EFBFBD>P<EFBFBD>Q`;
#InnoDB
SELECT * FROM `<60>s<EFBFBD>P` WHERE `<60>b<EFBFBD>P` = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>Q` WHERE `<60>b<EFBFBD>P` = '<27>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>R` WHERE `<60>b<EFBFBD>P` = '<27>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\';
#MyISAM
SELECT * FROM `<60>s<EFBFBD>S` WHERE `<60>b<EFBFBD>P` = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>T` WHERE `<60>b<EFBFBD>P` = '<27>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>U` WHERE `<60>b<EFBFBD>P` = '<27>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\';
#Heap
SELECT * FROM `<60>s<EFBFBD>V` WHERE `<60>b<EFBFBD>P` = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>W` WHERE `<60>b<EFBFBD>P` = '<27>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>X` WHERE `<60>b<EFBFBD>P` = '<27>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\';
#BDB
SELECT * FROM `<60>s<EFBFBD>P<EFBFBD>O` WHERE `<60>b<EFBFBD>P` = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>P<EFBFBD>P` WHERE `<60>b<EFBFBD>P` = '<27>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
SELECT * FROM `<60>s<EFBFBD>P<EFBFBD>Q` WHERE `<60>b<EFBFBD>P` = '<27>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\';
#Test to distinguish 0x9353 and 0x9373
CREATE TABLE t1(c1 char(1)) default charset = sjis engine=innodb;
CREATE TABLE t2(c1 char(1)) default charset = sjis engine=myisam;
CREATE TABLE t3(c1 char(1)) default charset = sjis engine=heap;
CREATE TABLE t4(c1 char(1)) default charset = sjis engine=bdb;
INSERT INTO t1 VALUES('<27>S'),('<27>s');
INSERT INTO t2 VALUES('<27>S'),('<27>s');
INSERT INTO t3 VALUES('<27>S'),('<27>s');
INSERT INTO t4 VALUES('<27>S'),('<27>s');
SELECT * FROM t1 WHERE c1 = '<27>S';
SELECT * FROM t2 WHERE c1 = '<27>S';
SELECT * FROM t3 WHERE c1 = '<27>S';
SELECT * FROM t4 WHERE c1 = '<27>S';
SELECT * FROM t1 WHERE c1 = '<27>s';
SELECT * FROM t2 WHERE c1 = '<27>s';
SELECT * FROM t3 WHERE c1 = '<27>s';
SELECT * FROM t4 WHERE c1 = '<27>s';
DROP TABLE `<60>s<EFBFBD>P`;
DROP TABLE `<60>s<EFBFBD>Q`;
DROP TABLE `<60>s<EFBFBD>R`;
DROP TABLE `<60>s<EFBFBD>S`;
DROP TABLE `<60>s<EFBFBD>T`;
DROP TABLE `<60>s<EFBFBD>U`;
DROP TABLE `<60>s<EFBFBD>V`;
DROP TABLE `<60>s<EFBFBD>W`;
DROP TABLE `<60>s<EFBFBD>X`;
DROP TABLE `<60>s<EFBFBD>P<EFBFBD>O`;
DROP TABLE `<60>s<EFBFBD>P<EFBFBD>P`;
DROP TABLE `<60>s<EFBFBD>P<EFBFBD>Q`;