~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
--source include/have_ujis.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 `£Ô£¹`;
drop table if exists `£Ô£±£°`;
drop table if exists `£Ô£±£±`;
drop table if exists `£Ô£±£²`;
--enable_warnings

#
# Test subquery using Japanese characters in ujis encoding 
#

SET NAMES ujis;
SET character_set_database = ujis;

CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£Ža` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£Žb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£ža` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£žb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap;

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

INSERT INTO `£Ô£±a` VALUES ('Ž±'),('Ž¶'),('Ž»');
INSERT INTO `£Ô£±b` VALUES ('Ž±');
INSERT INTO `£Ô£²a` VALUES ('€¢'),('€«'),('€µ');
INSERT INTO `£Ô£²b` VALUES ('€¢');
INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ');
INSERT INTO `£Ô£³b` VALUES ('íÜ');
INSERT INTO `£Ô£Ža` VALUES ('Ž±'),('Ž¶'),('Ž»');
INSERT INTO `£Ô£Žb` VALUES ('Ž±');
INSERT INTO `£Ô£µa` VALUES ('€¢'),('€«'),('€µ');
INSERT INTO `£Ô£µb` VALUES ('€¢');
INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ');
INSERT INTO `£Ô£¶b` VALUES ('íÜ');
INSERT INTO `£Ô£·a` VALUES ('Ž±'),('Ž¶'),('Ž»');
INSERT INTO `£Ô£·b` VALUES ('Ž±');
INSERT INTO `£Ô£ža` VALUES ('€¢'),('€«'),('€µ');
INSERT INTO `£Ô£žb` VALUES ('€¢');
INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ');
INSERT INTO `£Ô£¹b` VALUES ('íÜ');
INSERT INTO `£Ô£±£°a` VALUES ('Ž±'),('Ž¶'),('Ž»');
INSERT INTO `£Ô£±£°b` VALUES ('Ž±');
INSERT INTO `£Ô£±£±a` VALUES ('€¢'),('€«'),('€µ');
INSERT INTO `£Ô£±£±b` VALUES ('€¢');
INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ');
INSERT INTO `£Ô£±£²b` VALUES ('íÜ');

#Test for innodb
SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`);
SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`);
SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`);
SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£Ža` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£Žb`);
SELECT `£Ã£±` FROM `£Ô£Ža` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£Žb` WHERE `£Ô£Ža`.`£Ã£±` = `£Ô£Žb`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£Ža` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£Žb` WHERE `£Ô£Ža`.`£Ã£±` = `£Ô£Žb`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`);
SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`);
SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`);
SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£ža` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£žb`);
SELECT `£Ã£±` FROM `£Ô£ža` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£žb` WHERE `£Ô£ža`.`£Ã£±` = `£Ô£žb`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£ža` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£žb` WHERE `£Ô£ža`.`£Ã£±` = `£Ô£žb`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`);
SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`);
SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`);
SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`);
SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`);
SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`);

DROP TABLE `£Ô£±a`;
DROP TABLE `£Ô£±b`;
DROP TABLE `£Ô£²a`;
DROP TABLE `£Ô£²b`;
DROP TABLE `£Ô£³a`;
DROP TABLE `£Ô£³b`;
DROP TABLE `£Ô£Ža`;
DROP TABLE `£Ô£Žb`;
DROP TABLE `£Ô£µa`;
DROP TABLE `£Ô£µb`;
DROP TABLE `£Ô£¶a`;
DROP TABLE `£Ô£¶b`;
DROP TABLE `£Ô£·a`;
DROP TABLE `£Ô£·b`;
DROP TABLE `£Ô£ža`;
DROP TABLE `£Ô£žb`;
DROP TABLE `£Ô£¹a`;
DROP TABLE `£Ô£¹b`;
DROP TABLE `£Ô£±£°a`;
DROP TABLE `£Ô£±£°b`;
DROP TABLE `£Ô£±£±a`;
DROP TABLE `£Ô£±£±b`;
DROP TABLE `£Ô£±£²a`;
DROP TABLE `£Ô£±£²b`;