3
drop table if exists `�s�P`;
4
drop table if exists `�s�Q`;
5
drop table if exists `�s�R`;
6
drop table if exists `�s�S`;
7
drop table if exists `�s�T`;
8
drop table if exists `�s�U`;
9
drop table if exists `�s�V`;
10
drop table if exists `�s�W`;
11
drop table if exists `�s�X`;
12
drop table if exists `�s�P�O`;
13
drop table if exists `�s�P�P`;
14
drop table if exists `�s�P�Q`;
18
# Test subquery using Japanese characters in sjis encoding
22
SET character_set_database = sjis;
24
CREATE TABLE `�s�Pa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb;
25
CREATE TABLE `�s�Pb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb;
26
CREATE TABLE `�s�Qa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb;
27
CREATE TABLE `�s�Qb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb;
28
CREATE TABLE `�s�Ra` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb;
29
CREATE TABLE `�s�Rb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb;
30
CREATE TABLE `�s�Sa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam;
31
CREATE TABLE `�s�Sb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam;
32
CREATE TABLE `�s�Ta` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam;
33
CREATE TABLE `�s�Tb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam;
34
CREATE TABLE `�s�Ua` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam;
35
CREATE TABLE `�s�Ub` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam;
36
CREATE TABLE `�s�Va` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
37
CREATE TABLE `�s�Vb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
38
CREATE TABLE `�s�Wa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
39
CREATE TABLE `�s�Wb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
40
CREATE TABLE `�s�Xa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
41
CREATE TABLE `�s�Xb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
42
CREATE TABLE `�s�P�Oa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
43
CREATE TABLE `�s�P�Ob` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
44
CREATE TABLE `�s�P�Pa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
45
CREATE TABLE `�s�P�Pb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
46
CREATE TABLE `�s�P�Qa` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
47
CREATE TABLE `�s�P�Qb` (`�b�P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap;
49
#insert the following data in each table
50
# jisx0201 hankaku-katakana data
52
# jisx0212 supplemental character data
54
INSERT INTO `�s�Pa` VALUES ('�'),('�'),('�');
55
INSERT INTO `�s�Pb` VALUES ('�');
56
INSERT INTO `�s�Qa` VALUES ('��'),('��'),('��');
57
INSERT INTO `�s�Qb` VALUES ('��');
58
INSERT INTO `�s�Ra` VALUES ('�\'),('�\'),('�\');
59
INSERT INTO `�s�Rb` VALUES ('�\');
60
INSERT INTO `�s�Sa` VALUES ('�'),('�'),('�');
61
INSERT INTO `�s�Sb` VALUES ('�');
62
INSERT INTO `�s�Ta` VALUES ('��'),('��'),('��');
63
INSERT INTO `�s�Tb` VALUES ('��');
64
INSERT INTO `�s�Ua` VALUES ('�\'),('�\'),('�\');
65
INSERT INTO `�s�Ub` VALUES ('�\');
66
INSERT INTO `�s�Va` VALUES ('�'),('�'),('�');
67
INSERT INTO `�s�Vb` VALUES ('�');
68
INSERT INTO `�s�Wa` VALUES ('��'),('��'),('��');
69
INSERT INTO `�s�Wb` VALUES ('��');
70
INSERT INTO `�s�Xa` VALUES ('�\'),('�\'),('�\');
71
INSERT INTO `�s�Xb` VALUES ('�\');
72
INSERT INTO `�s�P�Oa` VALUES ('�'),('�'),('�');
73
INSERT INTO `�s�P�Ob` VALUES ('�');
74
INSERT INTO `�s�P�Pa` VALUES ('��'),('��'),('��');
75
INSERT INTO `�s�P�Pb` VALUES ('��');
76
INSERT INTO `�s�P�Qa` VALUES ('�\'),('�\'),('�\');
77
INSERT INTO `�s�P�Qb` VALUES ('�\');
80
SELECT `�b�P` FROM `�s�Pa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Pb`);
81
SELECT `�b�P` FROM `�s�Pa` WHERE EXISTS (SELECT `�b�P` FROM `�s�Pb` WHERE `�s�Pa`.`�b�P` = `�s�Pb`.`�b�P`);
82
SELECT `�b�P` FROM `�s�Pa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Pb` WHERE `�s�Pa`.`�b�P` = `�s�Pb`.`�b�P`);
83
SELECT `�b�P` FROM `�s�Qa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Qb`);
84
SELECT `�b�P` FROM `�s�Qa` WHERE EXISTS (SELECT `�b�P` FROM `�s�Qb` WHERE `�s�Qa`.`�b�P` = `�s�Qb`.`�b�P`);
85
SELECT `�b�P` FROM `�s�Qa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Qb` WHERE `�s�Qa`.`�b�P` = `�s�Qb`.`�b�P`);
86
SELECT `�b�P` FROM `�s�Ra` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Rb`);
87
SELECT `�b�P` FROM `�s�Ra` WHERE EXISTS (SELECT `�b�P` FROM `�s�Rb` WHERE `�s�Ra`.`�b�P` = `�s�Rb`.`�b�P`);
88
SELECT `�b�P` FROM `�s�Ra` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Rb` WHERE `�s�Ra`.`�b�P` = `�s�Rb`.`�b�P`);
89
SELECT `�b�P` FROM `�s�Sa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Sb`);
90
SELECT `�b�P` FROM `�s�Sa` WHERE EXISTS (SELECT `�b�P` FROM `�s�Sb` WHERE `�s�Sa`.`�b�P` = `�s�Sb`.`�b�P`);
91
SELECT `�b�P` FROM `�s�Sa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Sb` WHERE `�s�Sa`.`�b�P` = `�s�Sb`.`�b�P`);
92
SELECT `�b�P` FROM `�s�Ta` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Tb`);
93
SELECT `�b�P` FROM `�s�Ta` WHERE EXISTS (SELECT `�b�P` FROM `�s�Tb` WHERE `�s�Ta`.`�b�P` = `�s�Tb`.`�b�P`);
94
SELECT `�b�P` FROM `�s�Ta` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Tb` WHERE `�s�Ta`.`�b�P` = `�s�Tb`.`�b�P`);
95
SELECT `�b�P` FROM `�s�Ua` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Ub`);
96
SELECT `�b�P` FROM `�s�Ua` WHERE EXISTS (SELECT `�b�P` FROM `�s�Ub` WHERE `�s�Ua`.`�b�P` = `�s�Ub`.`�b�P`);
97
SELECT `�b�P` FROM `�s�Ua` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Ub` WHERE `�s�Ua`.`�b�P` = `�s�Ub`.`�b�P`);
98
SELECT `�b�P` FROM `�s�Va` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Vb`);
99
SELECT `�b�P` FROM `�s�Va` WHERE EXISTS (SELECT `�b�P` FROM `�s�Vb` WHERE `�s�Va`.`�b�P` = `�s�Vb`.`�b�P`);
100
SELECT `�b�P` FROM `�s�Va` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Vb` WHERE `�s�Va`.`�b�P` = `�s�Vb`.`�b�P`);
101
SELECT `�b�P` FROM `�s�Wa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Wb`);
102
SELECT `�b�P` FROM `�s�Wa` WHERE EXISTS (SELECT `�b�P` FROM `�s�Wb` WHERE `�s�Wa`.`�b�P` = `�s�Wb`.`�b�P`);
103
SELECT `�b�P` FROM `�s�Wa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Wb` WHERE `�s�Wa`.`�b�P` = `�s�Wb`.`�b�P`);
104
SELECT `�b�P` FROM `�s�Xa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�Xb`);
105
SELECT `�b�P` FROM `�s�Xa` WHERE EXISTS (SELECT `�b�P` FROM `�s�Xb` WHERE `�s�Xa`.`�b�P` = `�s�Xb`.`�b�P`);
106
SELECT `�b�P` FROM `�s�Xa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�Xb` WHERE `�s�Xa`.`�b�P` = `�s�Xb`.`�b�P`);
107
SELECT `�b�P` FROM `�s�P�Oa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�P�Ob`);
108
SELECT `�b�P` FROM `�s�P�Oa` WHERE EXISTS (SELECT `�b�P` FROM `�s�P�Ob` WHERE `�s�P�Oa`.`�b�P` = `�s�P�Ob`.`�b�P`);
109
SELECT `�b�P` FROM `�s�P�Oa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�P�Ob` WHERE `�s�P�Oa`.`�b�P` = `�s�P�Ob`.`�b�P`);
110
SELECT `�b�P` FROM `�s�P�Pa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�P�Pb`);
111
SELECT `�b�P` FROM `�s�P�Pa` WHERE EXISTS (SELECT `�b�P` FROM `�s�P�Pb` WHERE `�s�P�Pa`.`�b�P` = `�s�P�Pb`.`�b�P`);
112
SELECT `�b�P` FROM `�s�P�Pa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�P�Pb` WHERE `�s�P�Pa`.`�b�P` = `�s�P�Pb`.`�b�P`);
113
SELECT `�b�P` FROM `�s�P�Qa` WHERE `�b�P` IN (SELECT `�b�P` FROM `�s�P�Qb`);
114
SELECT `�b�P` FROM `�s�P�Qa` WHERE EXISTS (SELECT `�b�P` FROM `�s�P�Qb` WHERE `�s�P�Qa`.`�b�P` = `�s�P�Qb`.`�b�P`);
115
SELECT `�b�P` FROM `�s�P�Qa` WHERE NOT EXISTS (SELECT `�b�P` FROM `�s�P�Qb` WHERE `�s�P�Qa`.`�b�P` = `�s�P�Qb`.`�b�P`);
135
DROP TABLE `�s�P�Oa`;
136
DROP TABLE `�s�P�Ob`;
137
DROP TABLE `�s�P�Pa`;
138
DROP TABLE `�s�P�Pb`;
139
DROP TABLE `�s�P�Qa`;
140
DROP TABLE `�s�P�Qb`;