mariadb/mysql-test/suite/jp/t/jp_convert_ujis.test
unknown 888b665e6c 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

115 lines
5.2 KiB
Text
Executable file

--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 CONVERT() function with Japanese character in ujis encoding
#
SET NAMES ujis;
SET character_set_database = ujis;
CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb;
CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam;
CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap;
CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb;
CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb;
CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb;
#Load the following data in each table
# jisx0201 hankaku-katakana data
# jisx0208 data
# jisx0212 supplemental character data
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`;
#InnoDB
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`;
# The result will get garbled because jisx0212 is not included in sjis
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`;
#MyISAM
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`;
# The result will get garbled because jisx0212 is not included in sjis
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`;
#Heap
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`;
# The result will get garbled because jisx0212 is not included in sjis
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`;
#BDB
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`;
SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`;
# The result will get garbled because jisx0212 is not included in sjis
SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`;
drop table `£Ô£±`;
drop table `£Ô£²`;
drop table `£Ô£³`;
drop table `£Ô£´`;
drop table `£Ô£µ`;
drop table `£Ô£¶`;
drop table `£Ô£·`;
drop table `£Ô£¸`;
drop table `£Ô£¹`;
drop table `£Ô£±£°`;
drop table `£Ô£±£±`;
drop table `£Ô£±£²`;