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

140 lines
8.5 KiB
Text
Raw Normal View History

--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 utf8 encoding
#
SET NAMES utf8;
SET character_set_database = utf8;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `a` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap;
CREATE TABLE `b` (`` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 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`;