1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
--character_set sjis
SET NAMES sjis;
SET character_set_database = sjis;
--disable_warnings
drop table if exists `sP`;
drop table if exists `sQ`;
drop table if exists `sR`;
drop table if exists `sS`;
drop table if exists `sT`;
drop table if exists `sU`;
drop table if exists `sV`;
drop table if exists `sW`;
drop table if exists `sX`;
drop table if exists `sPO`;
drop table if exists `sPP`;
drop table if exists `sPQ`;
--enable_warnings
#
# Test CONVERT() function with Japanese character in sjis encoding
#
CREATE TABLE `sP` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `sQ` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `sR` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = innodb;
CREATE TABLE `sS` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `sT` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `sU` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = myisam;
CREATE TABLE `sV` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = heap;
CREATE TABLE `sW` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = heap;
CREATE TABLE `sX` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = heap;
CREATE TABLE `sPO` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = bdb;
CREATE TABLE `sPP` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis engine = bdb;
CREATE TABLE `sPQ` (`bP` char(20), INDEX(`bP`)) DEFAULT CHARSET = sjis 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_sjis.dat' INTO TABLE `sP`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sQ`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sR`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sS`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sT`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sU`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sV`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sW`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sX`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `sPO`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `sPP`;
LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `sPQ`;
#InnoDB
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sP`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sP`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sP`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sQ`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sQ`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sQ`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sR`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sR`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sR`;
#MyISAM
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sS`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sS`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sS`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sT`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sT`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sT`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sU`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sU`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sU`;
#Heap
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sV`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sV`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sV`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sW`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sW`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sW`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sX`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sX`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sX`;
#BDB
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sPO`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sPO`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sPO`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sPP`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sPP`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sPP`;
SELECT `bP`, CONVERT(`bP` using utf8) FROM `sPQ`;
SELECT `bP`, CONVERT(`bP` using ucs2) FROM `sPQ`;
SELECT `bP`, CONVERT(`bP` using ujis) FROM `sPQ`;
drop table `sP`;
drop table `sQ`;
drop table `sR`;
drop table `sS`;
drop table `sT`;
drop table `sU`;
drop table `sV`;
drop table `sW`;
drop table `sX`;
drop table `sPO`;
drop table `sPP`;
drop table `sPQ`;
|