1
by brian
clean slate |
1 |
--character_set sjis
|
2 |
--disable_warnings
|
|
3 |
drop table if exists `sP`; |
|
4 |
drop table if exists `sQ`; |
|
5 |
drop table if exists `sR`; |
|
6 |
drop table if exists `sS`; |
|
7 |
drop table if exists `sT`; |
|
8 |
drop table if exists `sU`; |
|
9 |
drop table if exists `sV`; |
|
10 |
drop table if exists `sW`; |
|
11 |
drop table if exists `sX`; |
|
12 |
drop table if exists `sPO`; |
|
13 |
drop table if exists `sPP`; |
|
14 |
drop table if exists `sPQ`; |
|
15 |
--enable_warnings
|
|
16 |
||
17 |
#
|
|
18 |
# Test Displaying Japanese charact using WHERE condtion in sjis encoding |
|
19 |
#
|
|
20 |
||
21 |
SET NAMES sjis; |
|
22 |
SET character_set_database = sjis; |
|
23 |
||
24 |
CREATE TABLE `sP` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = innodb; |
|
25 |
CREATE TABLE `sQ` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = innodb; |
|
26 |
CREATE TABLE `sR` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = innodb; |
|
27 |
CREATE TABLE `sS` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = myisam; |
|
28 |
CREATE TABLE `sT` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = myisam; |
|
29 |
CREATE TABLE `sU` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = myisam; |
|
30 |
CREATE TABLE `sV` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = heap; |
|
31 |
CREATE TABLE `sW` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = heap; |
|
32 |
CREATE TABLE `sX` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = heap; |
|
33 |
CREATE TABLE `sPO` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = bdb; |
|
34 |
CREATE TABLE `sPP` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = bdb; |
|
35 |
CREATE TABLE `sPQ` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = bdb; |
|
36 |
||
37 |
#Load the following data in each table |
|
38 |
# jisx0201 hankaku-katakana data |
|
39 |
# jisx0208 data |
|
40 |
# jisx0212 supplemental character data |
|
41 |
||
42 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sP`; |
|
43 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sQ`; |
|
44 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sR`; |
|
45 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sS`; |
|
46 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sT`; |
|
47 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sU`; |
|
48 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sV`; |
|
49 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sW`; |
|
50 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sX`; |
|
51 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sPO`; |
|
52 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sPP`; |
|
53 |
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sPQ`; |
|
54 |
||
55 |
#InnoDB |
|
56 |
SELECT * FROM `sP` WHERE `bP` = '°±²³Žµ¶·ž¹º»ŒœŸ¿'; |
|
57 |
SELECT * FROM `sQ` WHERE `bP` = 'E ¡¢£€¥Š§š©ª«¬®¯°±'; |
|
58 |
SELECT * FROM `sR` WHERE `bP` = '\\\\\\\\\\\\\\\\\\\\'; |
|
59 |
||
60 |
#MyISAM |
|
61 |
SELECT * FROM `sS` WHERE `bP` = '°±²³Žµ¶·ž¹º»ŒœŸ¿'; |
|
62 |
SELECT * FROM `sT` WHERE `bP` = 'E ¡¢£€¥Š§š©ª«¬®¯°±'; |
|
63 |
SELECT * FROM `sU` WHERE `bP` = '\\\\\\\\\\\\\\\\\\\\'; |
|
64 |
||
65 |
#Heap |
|
66 |
SELECT * FROM `sV` WHERE `bP` = '°±²³Žµ¶·ž¹º»ŒœŸ¿'; |
|
67 |
SELECT * FROM `sW` WHERE `bP` = 'E ¡¢£€¥Š§š©ª«¬®¯°±'; |
|
68 |
SELECT * FROM `sX` WHERE `bP` = '\\\\\\\\\\\\\\\\\\\\'; |
|
69 |
||
70 |
#BDB |
|
71 |
SELECT * FROM `sPO` WHERE `bP` = '°±²³Žµ¶·ž¹º»ŒœŸ¿'; |
|
72 |
SELECT * FROM `sPP` WHERE `bP` = 'E ¡¢£€¥Š§š©ª«¬®¯°±'; |
|
73 |
SELECT * FROM `sPQ` WHERE `bP` = '\\\\\\\\\\\\\\\\\\\\'; |
|
74 |
||
75 |
#Test to distinguish 0x9353 and 0x9373 |
|
76 |
CREATE TABLE t1(c1 char(1)) default charset = sjis engine=innodb; |
|
77 |
CREATE TABLE t2(c1 char(1)) default charset = sjis engine=myisam; |
|
78 |
CREATE TABLE t3(c1 char(1)) default charset = sjis engine=heap; |
|
79 |
CREATE TABLE t4(c1 char(1)) default charset = sjis engine=bdb; |
|
80 |
INSERT INTO t1 VALUES('S'),('s'); |
|
81 |
INSERT INTO t2 VALUES('S'),('s'); |
|
82 |
INSERT INTO t3 VALUES('S'),('s'); |
|
83 |
INSERT INTO t4 VALUES('S'),('s'); |
|
84 |
SELECT * FROM t1 WHERE c1 = 'S'; |
|
85 |
SELECT * FROM t2 WHERE c1 = 'S'; |
|
86 |
SELECT * FROM t3 WHERE c1 = 'S'; |
|
87 |
SELECT * FROM t4 WHERE c1 = 'S'; |
|
88 |
SELECT * FROM t1 WHERE c1 = 's'; |
|
89 |
SELECT * FROM t2 WHERE c1 = 's'; |
|
90 |
SELECT * FROM t3 WHERE c1 = 's'; |
|
91 |
SELECT * FROM t4 WHERE c1 = 's'; |
|
92 |
||
93 |
DROP TABLE `sP`; |
|
94 |
DROP TABLE `sQ`; |
|
95 |
DROP TABLE `sR`; |
|
96 |
DROP TABLE `sS`; |
|
97 |
DROP TABLE `sT`; |
|
98 |
DROP TABLE `sU`; |
|
99 |
DROP TABLE `sV`; |
|
100 |
DROP TABLE `sW`; |
|
101 |
DROP TABLE `sX`; |
|
102 |
DROP TABLE `sPO`; |
|
103 |
DROP TABLE `sPP`; |
|
104 |
DROP TABLE `sPQ`; |