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

130 lines
6.1 KiB
Text
Raw Normal View History

--source include/have_ujis.inc
--disable_warnings
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD><D4A3><EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD><D4A3><EFBFBD>`;
drop table if exists `<60>ԣ<EFBFBD><D4A3><EFBFBD>`;
--enable_warnings
#
# Test UNION with Japanese characters in ujis encoding
#
SET NAMES ujis;
SET character_set_database = ujis;
#InnoDB
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = innodb;
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
(SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT '<27><>') ORDER BY `<60>ã<EFBFBD>`;
(SELECT '<27><>' AS `<60>ã<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) ORDER BY `<60>ã<EFBFBD>`;
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` UNION
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION SELECT REPEAT(`<60>ã<EFBFBD>`,5) FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
#MyISAM
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MYISAM;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MYISAM;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MYISAM;
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
(SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT '<27><>') ORDER BY `<60>ã<EFBFBD>`;
(SELECT '<27><>' AS `<60>ã<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) ORDER BY `<60>ã<EFBFBD>`;
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` UNION
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION SELECT REPEAT(`<60>ã<EFBFBD>`,5) FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
#HEAP
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = HEAP;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = HEAP;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = HEAP;
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
(SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT '<27><>') ORDER BY `<60>ã<EFBFBD>`;
(SELECT '<27><>' AS `<60>ã<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) ORDER BY `<60>ã<EFBFBD>`;
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` UNION
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION SELECT REPEAT(`<60>ã<EFBFBD>`,5) FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
#BDB
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = BDB;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = BDB;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = BDB;
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
(SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT '<27><>') ORDER BY `<60>ã<EFBFBD>`;
(SELECT '<27><>' AS `<60>ã<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) UNION (SELECT * FROM `<60>ԣ<EFBFBD>`) ORDER BY `<60>ã<EFBFBD>`;
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` UNION
SELECT `<60>ã<EFBFBD>`, COUNT(*) FROM `<60>ԣ<EFBFBD>` GROUP BY `<60>ã<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT
SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION SELECT REPEAT(`<60>ã<EFBFBD>`,5) FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
DROP TABLE `<60>ԣ<EFBFBD>` ;
# Test mixed strage engine
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = InnoDB;
CREATE TABLE `<60>ԣ<EFBFBD>` (`<60>ã<EFBFBD>` char(1), INDEX(`<60>ã<EFBFBD>`)) DEFAULT CHARSET = ujis engine = MyISAM;
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
INSERT INTO `<60>ԣ<EFBFBD>` VALUES('<27><>'),('<27><>'),('<27><>'),('<27><>'),('<27><><EFBFBD>'),('<27><><EFBFBD>');
SELECT * FROM `<60>ԣ<EFBFBD>` UNION DISTINCT SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
SELECT * FROM `<60>ԣ<EFBFBD>` UNION ALL SELECT * FROM `<60>ԣ<EFBFBD>` ORDER BY `<60>ã<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;
DROP TABLE `<60>ԣ<EFBFBD>`;