2
drop table if exists `T1`;
3
drop table if exists `T2`;
4
drop table if exists `T3`;
5
drop table if exists `T4`;
6
drop table if exists `T5`;
7
drop table if exists `T6`;
8
drop table if exists `T7`;
9
drop table if exists `T8`;
10
drop table if exists `T9`;
11
drop table if exists `T10`;
12
drop table if exists `T11`;
13
drop table if exists `T12`;
17
# Test CONVERT() function with Japanese character in utf8 encoding
21
SET character_set_database = utf8;
23
CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb;
24
CREATE TABLE `T2` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb;
25
CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb;
26
CREATE TABLE `T4` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam;
27
CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam;
28
CREATE TABLE `T6` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam;
29
CREATE TABLE `T7` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap;
30
CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap;
31
CREATE TABLE `T9` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap;
32
CREATE TABLE `T10` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb;
33
CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb;
34
CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb;
36
#Load the following data in each table
37
# jisx0201 hankaku-katakana data
39
# jisx0212 supplemental character data
41
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`;
42
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T2`;
43
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`;
44
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T4`;
45
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`;
46
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T6`;
47
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T7`;
48
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`;
49
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T9`;
50
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T10`;
51
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`;
52
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`;
55
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1`;
56
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1`;
57
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1`;
58
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T2`;
59
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T2`;
60
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T2`;
61
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`;
62
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T3`;
63
# The result will get garbled because jisx0212 is not included in sjis
64
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`;
67
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T4`;
68
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T4`;
69
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T4`;
70
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T5`;
71
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T5`;
72
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T5`;
73
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T6`;
74
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T6`;
75
# The result will get garbled because jisx0212 is not included in sjis
76
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T6`;
79
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T7`;
80
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T7`;
81
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T7`;
82
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T8`;
83
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T8`;
84
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T8`;
85
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T9`;
86
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T9`;
87
# The result will get garbled because jisx0212 is not included in sjis
88
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T9`;
91
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T10`;
92
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T10`;
93
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T10`;
94
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T11`;
95
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T11`;
96
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T11`;
97
SELECT `C1`, CONVERT(`C1` using ujis) FROM `T12`;
98
SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T12`;
99
# The result will get garbled because jisx0212 is not included in sjis
100
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T12`;