mariadb/mysql-test/suite/jp/t/jp_union_ujis.test
shuichi@mysql.com 18609a1e99 Added test data, test case and test result files for Japanese characters test.
I have put the tests into a separate "suite", the first one actually.
Currently this can only be run by the Perl version of mysql-test-run
that is not quite finished. It should, or at least will, be able to
be run with the line

  ./mysql-test-run.pl --suite=jp
2005-01-07 00:48:38 -08:00

129 lines
6.1 KiB
Text
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--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 UNION with Japanese characters in ujis encoding
#
SET NAMES ujis;
SET character_set_database = ujis;
#InnoDB
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = innodb;
INSERT INTO `` VALUES('ア'),('ア'),('あ'),('あ'),('龔'),('龔');
INSERT INTO `` VALUES('イ'),('イ'),('い'),('い'),('龖'),('龖');
INSERT INTO `` VALUES('ウ'),('ウ'),('う'),('う'),('龗'),('龗');
SELECT * FROM `` UNION DISTINCT SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL SELECT * FROM `` ORDER BY ``;
(SELECT * FROM ``) UNION (SELECT * FROM ``) UNION (SELECT 'う') ORDER BY ``;
(SELECT 'う' AS ``) UNION (SELECT * FROM ``) UNION (SELECT * FROM ``) ORDER BY ``;
SELECT ``, COUNT(*) FROM `` GROUP BY `` UNION
SELECT ``, COUNT(*) FROM `` GROUP BY `` ORDER BY ``;
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` UNION ALL
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION SELECT REPEAT(``,5) FROM `` ORDER BY ``;
DROP TABLE `` ;
DROP TABLE `` ;
DROP TABLE `` ;
#MyISAM
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = MYISAM;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = MYISAM;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = MYISAM;
INSERT INTO `` VALUES('ア'),('ア'),('あ'),('あ'),('龔'),('龔');
INSERT INTO `` VALUES('イ'),('イ'),('い'),('い'),('龖'),('龖');
INSERT INTO `` VALUES('ウ'),('ウ'),('う'),('う'),('龗'),('龗');
SELECT * FROM `` UNION DISTINCT SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL SELECT * FROM `` ORDER BY ``;
(SELECT * FROM ``) UNION (SELECT * FROM ``) UNION (SELECT 'う') ORDER BY ``;
(SELECT 'う' AS ``) UNION (SELECT * FROM ``) UNION (SELECT * FROM ``) ORDER BY ``;
SELECT ``, COUNT(*) FROM `` GROUP BY `` UNION
SELECT ``, COUNT(*) FROM `` GROUP BY `` ORDER BY ``;
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` UNION ALL
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION SELECT REPEAT(``,5) FROM `` ORDER BY ``;
DROP TABLE `` ;
DROP TABLE `` ;
DROP TABLE `` ;
#HEAP
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = HEAP;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = HEAP;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = HEAP;
INSERT INTO `` VALUES('ア'),('ア'),('あ'),('あ'),('龔'),('龔');
INSERT INTO `` VALUES('イ'),('イ'),('い'),('い'),('龖'),('龖');
INSERT INTO `` VALUES('ウ'),('ウ'),('う'),('う'),('龗'),('龗');
SELECT * FROM `` UNION DISTINCT SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL SELECT * FROM `` ORDER BY ``;
(SELECT * FROM ``) UNION (SELECT * FROM ``) UNION (SELECT 'う') ORDER BY ``;
(SELECT 'う' AS ``) UNION (SELECT * FROM ``) UNION (SELECT * FROM ``) ORDER BY ``;
SELECT ``, COUNT(*) FROM `` GROUP BY `` UNION
SELECT ``, COUNT(*) FROM `` GROUP BY `` ORDER BY ``;
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` UNION ALL
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION SELECT REPEAT(``,5) FROM `` ORDER BY ``;
DROP TABLE `` ;
DROP TABLE `` ;
DROP TABLE `` ;
#BDB
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = BDB;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = BDB;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = BDB;
INSERT INTO `` VALUES('ア'),('ア'),('あ'),('あ'),('龔'),('龔');
INSERT INTO `` VALUES('イ'),('イ'),('い'),('い'),('龖'),('龖');
INSERT INTO `` VALUES('ウ'),('ウ'),('う'),('う'),('龗'),('龗');
SELECT * FROM `` UNION DISTINCT SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL SELECT * FROM `` ORDER BY ``;
(SELECT * FROM ``) UNION (SELECT * FROM ``) UNION (SELECT 'う') ORDER BY ``;
(SELECT 'う' AS ``) UNION (SELECT * FROM ``) UNION (SELECT * FROM ``) ORDER BY ``;
SELECT ``, COUNT(*) FROM `` GROUP BY `` UNION
SELECT ``, COUNT(*) FROM `` GROUP BY `` ORDER BY ``;
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` UNION ALL
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL
SELECT * FROM `` UNION DISTINCT
SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION SELECT REPEAT(``,5) FROM `` ORDER BY ``;
DROP TABLE `` ;
DROP TABLE `` ;
DROP TABLE `` ;
# Test mixed strage engine
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = InnoDB;
CREATE TABLE `` (`` char(1), INDEX(``)) DEFAULT CHARSET = ujis engine = MyISAM;
INSERT INTO `` VALUES('ア'),('ア'),('あ'),('あ'),('龔'),('龔');
INSERT INTO `` VALUES('イ'),('イ'),('い'),('い'),('龖'),('龖');
SELECT * FROM `` UNION DISTINCT SELECT * FROM `` ORDER BY ``;
SELECT * FROM `` UNION ALL SELECT * FROM `` ORDER BY ``;
DROP TABLE ``;
DROP TABLE ``;