polardbxengine/mysql-test/suite/jp/t/jp_convert_utf8.test

90 lines
4.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--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 ``;
--enable_warnings
#
# Test CONVERT() function with Japanese character in utf8 encoding
#
SET NAMES utf8;
SET character_set_database = utf8;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = innodb;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = myisam;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = MEMORY;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = MEMORY;
CREATE TABLE `` (`` char(20), INDEX(``)) DEFAULT CHARSET = utf8 engine = MEMORY;
#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_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE ``;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE ``;
#InnoDB
SELECT ``, CONVERT(`` using ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
SELECT ``, CONVERT(`` using sjis) FROM ``;
SELECT ``, CONVERT(`` using ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
SELECT ``, CONVERT(`` using sjis) FROM ``;
SELECT ``, CONVERT(`` using ujis) 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 ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
SELECT ``, CONVERT(`` using sjis) FROM ``;
SELECT ``, CONVERT(`` using ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
SELECT ``, CONVERT(`` using sjis) FROM ``;
SELECT ``, CONVERT(`` using ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
# The result will get garbled because jisx0212 is not included in sjis
SELECT ``, CONVERT(`` using sjis) FROM ``;
#MEMORY
SELECT ``, CONVERT(`` using ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
SELECT ``, CONVERT(`` using sjis) FROM ``;
SELECT ``, CONVERT(`` using ujis) FROM ``;
SELECT ``, CONVERT(`` using ucs2) FROM ``;
SELECT ``, CONVERT(`` using sjis) FROM ``;
SELECT ``, CONVERT(`` using ujis) 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 ``;