1
--source include/have_ujis.inc
4
drop table if exists `�ԣ�`;
5
drop table if exists `�ԣ�`;
6
drop table if exists `�ԣ�`;
7
drop table if exists `�ԣ�`;
8
drop table if exists `�ԣ�`;
9
drop table if exists `�ԣ�`;
10
drop table if exists `�ԣ�`;
11
drop table if exists `�ԣ�`;
12
drop table if exists `�ԣ�`;
13
drop table if exists `�ԣ���`;
14
drop table if exists `�ԣ���`;
15
drop table if exists `�ԣ���`;
19
# Test subquery using Japanese characters in ujis encoding
23
SET character_set_database = ujis;
25
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
26
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
27
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
28
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
29
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
30
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
31
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
32
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
33
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
34
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
35
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
36
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
37
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
38
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
39
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
40
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
41
CREATE TABLE `�ԣ�a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
42
CREATE TABLE `�ԣ�b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
43
CREATE TABLE `�ԣ���a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
44
CREATE TABLE `�ԣ���b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
45
CREATE TABLE `�ԣ���a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
46
CREATE TABLE `�ԣ���b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
47
CREATE TABLE `�ԣ���a` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
48
CREATE TABLE `�ԣ���b` (`�ã�` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
50
#insert the following data in each table
51
# jisx0201 hankaku-katakana data
53
# jisx0212 supplemental character data
55
INSERT INTO `�ԣ�a` VALUES ('��'),('��'),('��');
56
INSERT INTO `�ԣ�b` VALUES ('��');
57
INSERT INTO `�ԣ�a` VALUES ('��'),('��'),('��');
58
INSERT INTO `�ԣ�b` VALUES ('��');
59
INSERT INTO `�ԣ�a` VALUES ('���'),('���'),('���');
60
INSERT INTO `�ԣ�b` VALUES ('���');
61
INSERT INTO `�ԣ�a` VALUES ('��'),('��'),('��');
62
INSERT INTO `�ԣ�b` VALUES ('��');
63
INSERT INTO `�ԣ�a` VALUES ('��'),('��'),('��');
64
INSERT INTO `�ԣ�b` VALUES ('��');
65
INSERT INTO `�ԣ�a` VALUES ('���'),('���'),('���');
66
INSERT INTO `�ԣ�b` VALUES ('���');
67
INSERT INTO `�ԣ�a` VALUES ('��'),('��'),('��');
68
INSERT INTO `�ԣ�b` VALUES ('��');
69
INSERT INTO `�ԣ�a` VALUES ('��'),('��'),('��');
70
INSERT INTO `�ԣ�b` VALUES ('��');
71
INSERT INTO `�ԣ�a` VALUES ('���'),('���'),('���');
72
INSERT INTO `�ԣ�b` VALUES ('���');
73
INSERT INTO `�ԣ���a` VALUES ('��'),('��'),('��');
74
INSERT INTO `�ԣ���b` VALUES ('��');
75
INSERT INTO `�ԣ���a` VALUES ('��'),('��'),('��');
76
INSERT INTO `�ԣ���b` VALUES ('��');
77
INSERT INTO `�ԣ���a` VALUES ('���'),('���'),('���');
78
INSERT INTO `�ԣ���b` VALUES ('���');
81
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
82
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
83
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
84
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
85
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
86
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
87
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
88
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
89
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
90
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
91
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
92
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
93
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
94
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
95
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
96
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
97
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
98
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
99
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
100
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
101
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
102
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
103
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
104
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
105
SELECT `�ã�` FROM `�ԣ�a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ�b`);
106
SELECT `�ã�` FROM `�ԣ�a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
107
SELECT `�ã�` FROM `�ԣ�a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ�b` WHERE `�ԣ�a`.`�ã�` = `�ԣ�b`.`�ã�`);
108
SELECT `�ã�` FROM `�ԣ���a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ���b`);
109
SELECT `�ã�` FROM `�ԣ���a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ���b` WHERE `�ԣ���a`.`�ã�` = `�ԣ���b`.`�ã�`);
110
SELECT `�ã�` FROM `�ԣ���a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ���b` WHERE `�ԣ���a`.`�ã�` = `�ԣ���b`.`�ã�`);
111
SELECT `�ã�` FROM `�ԣ���a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ���b`);
112
SELECT `�ã�` FROM `�ԣ���a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ���b` WHERE `�ԣ���a`.`�ã�` = `�ԣ���b`.`�ã�`);
113
SELECT `�ã�` FROM `�ԣ���a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ���b` WHERE `�ԣ���a`.`�ã�` = `�ԣ���b`.`�ã�`);
114
SELECT `�ã�` FROM `�ԣ���a` WHERE `�ã�` IN (SELECT `�ã�` FROM `�ԣ���b`);
115
SELECT `�ã�` FROM `�ԣ���a` WHERE EXISTS (SELECT `�ã�` FROM `�ԣ���b` WHERE `�ԣ���a`.`�ã�` = `�ԣ���b`.`�ã�`);
116
SELECT `�ã�` FROM `�ԣ���a` WHERE NOT EXISTS (SELECT `�ã�` FROM `�ԣ���b` WHERE `�ԣ���a`.`�ã�` = `�ԣ���b`.`�ã�`);