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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
SET @@character_set_server=latin5;
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251;
USE mysqltest1;
CREATE DATABASE mysqltest2;
SHOW CREATE DATABASE mysqltest1;
Database Create Database
mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp1251 */
SHOW CREATE DATABASE mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin5 */
CREATE TABLE mysqltest2.t1 (a char(10));
SHOW CREATE TABLE mysqltest2.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
DROP TABLE mysqltest2.t1;
ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
CREATE TABLE mysqltest2.t1 (a char(10));
SHOW CREATE TABLE mysqltest2.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin7
DROP DATABASE mysqltest2;
CREATE DATABASE mysqltest2 CHARACTER SET latin2;
CREATE TABLE mysqltest2.t1 (a char(10));
SHOW CREATE TABLE mysqltest2.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin2
DROP DATABASE mysqltest2;
USE mysqltest1;
CREATE TABLE t1 (a char(10));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
DROP TABLE t1;
CREATE TABLE t1 (a char(10)) DEFAULT CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a char(10))
DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) COLLATE latin1_german1_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
DROP TABLE t1;
create table t1 (a char) character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create table t1 (a char) character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
create database d1 default character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create database d1 default character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
DROP DATABASE mysqltest1;
CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
use mysqltest2;
ALTER DATABASE DEFAULT CHARACTER SET latin2;
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
drop database mysqltest2;
ALTER DATABASE DEFAULT CHARACTER SET latin2;
ERROR 3D000: No database selected
ALTER DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DEFAULT CHARACTER SET latin2;
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
ALTER DATABASE `` DEFAULT CHARACTER SET latin2;
ERROR 42000: Incorrect database name ''
USE test;
#
# End of 10.0 tests
#
#
# Start of 10.9 tests
#
#
# MDEV-7387 Alter table xxx CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1 should fail
# MDEV-28644 Unexpected error on ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4
#
CREATE DATABASE tmp DEFAULT CHARACTER SET latin5;
USE tmp;
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET utf8;
ERROR HY000: Conflicting declarations: 'CHARACTER SET DEFAULT (latin5)' and 'CHARACTER SET utf8mb3'
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET DEFAULT;
ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET DEFAULT (latin5)'
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET utf8;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET DEFAULT;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8);
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP DATABASE tmp;
USE test;
#
# End of 10.9 tests
#
|