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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1';
Warnings:
Warning 1911 Unknown option 'fkey'
Warning 1911 Unknown option 'dff'
Warning 1911 Unknown option 'tkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey`=vvv,
KEY `akey` (`a`) `dff`=vvv
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey1`='1v1'
drop table t1;
#reassiginig options in the same line
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1;
Warnings:
Warning 1911 Unknown option 'fkey'
Warning 1911 Unknown option 'dff'
Warning 1911 Unknown option 'tkey1'
Warning 1911 Unknown option 'tkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey`=vvv,
KEY `akey` (`a`) `dff`=vvv
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey1`=1v2 `tkey2`=2v1
#add option
alter table t1 tkey4=4v1;
Warnings:
Warning 1911 Unknown option 'tkey4'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey`=vvv,
KEY `akey` (`a`) `dff`=vvv
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey1`=1v2 `tkey2`=2v1 `tkey4`=4v1
#remove options
alter table t1 tkey3=DEFAULT tkey4=DEFAULT;
Warnings:
Warning 1911 Unknown option 'tkey3'
Warning 1911 Unknown option 'tkey4'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey`=vvv,
KEY `akey` (`a`) `dff`=vvv
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey1`=1v2 `tkey2`=2v1
drop table t1;
create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1;
Warnings:
Warning 1911 Unknown option 'fkey1'
Warning 1911 Unknown option 'kkey1'
Warning 1911 Unknown option 'TKEY1'
Warning 1911 Unknown option 'tkey2'
Warning 1911 Unknown option 'tkey3'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v1,
KEY `akey` (`a`) `kkey1`=v1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#change field with option with the same value
alter table t1 change a a int `FKEY1`='v1';
Warnings:
Warning 1911 Unknown option 'FKEY1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `FKEY1`='v1',
KEY `akey` (`a`) `kkey1`=v1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#change field with option with a different value
alter table t1 change a a int fkey1=v2;
Warnings:
Warning 1911 Unknown option 'fkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
KEY `akey` (`a`) `kkey1`=v1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#new column no options
alter table t1 add column b int;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`b` int(11) DEFAULT NULL,
KEY `akey` (`a`) `kkey1`=v1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#new key with options
alter table t1 add key bkey (b) kkey2=v1;
Warnings:
Warning 1911 Unknown option 'kkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`b` int(11) DEFAULT NULL,
KEY `akey` (`a`) `kkey1`=v1,
KEY `bkey` (`b`) `kkey2`=v1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#new column with options
alter table t1 add column c int fkey1=v1 fkey2=v2;
Warnings:
Warning 1911 Unknown option 'fkey1'
Warning 1911 Unknown option 'fkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL `fkey1`=v1 `fkey2`=v2,
KEY `akey` (`a`) `kkey1`=v1,
KEY `bkey` (`b`) `kkey2`=v1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#new key no options
alter table t1 add key ckey (c);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL `fkey1`=v1 `fkey2`=v2,
KEY `akey` (`a`) `kkey1`=v1,
KEY `bkey` (`b`) `kkey2`=v1,
KEY `ckey` (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#drop column
alter table t1 drop b;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`c` int(11) DEFAULT NULL `fkey1`=v1 `fkey2`=v2,
KEY `akey` (`a`) `kkey1`=v1,
KEY `ckey` (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#add column with options after delete
alter table t1 add column b int fkey2=v1;
Warnings:
Warning 1911 Unknown option 'fkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`c` int(11) DEFAULT NULL `fkey1`=v1 `fkey2`=v2,
`b` int(11) DEFAULT NULL `fkey2`=v1,
KEY `akey` (`a`) `kkey1`=v1,
KEY `ckey` (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
#add key
alter table t1 add key bkey (b) kkey2=v2;
Warnings:
Warning 1911 Unknown option 'kkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `fkey1`=v2,
`c` int(11) DEFAULT NULL `fkey1`=v1 `fkey2`=v2,
`b` int(11) DEFAULT NULL `fkey2`=v1,
KEY `akey` (`a`) `kkey1`=v1,
KEY `ckey` (`c`),
KEY `bkey` (`b`) `kkey2`=v2
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey2`=2v1 `tkey3`=3v1
drop table t1;
create table t1 (a int) tkey1=100;
Warnings:
Warning 1911 Unknown option 'tkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `tkey1`=100
drop table t1;
#error on unknown option
SET SQL_MODE='';
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1;
ERROR HY000: Unknown option 'fkey'
SET @@SQL_MODE=@OLD_SQL_MODE;
#
# End of 5.5 tests
#
#
# MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning on unsupported TRANSACTIONAL=1
#
create table t0 (a int) transactional=0 engine=aria;
create table t1 (a int) transactional=1 engine=aria;
create table t2 (a int) transactional=default engine=aria;
show create table t0;
Table Create Table
t0 CREATE TABLE `t0` (
`a` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 TRANSACTIONAL=0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
alter table t0 engine=myisam;
alter table t1 engine=myisam;
alter table t2 engine=myisam;
show create table t0;
Table Create Table
t0 CREATE TABLE `t0` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 /* TRANSACTIONAL=0 */
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 /* TRANSACTIONAL=1 */
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
alter table t0 engine=myisam transactional=0;
ERROR HY000: Unknown option 'transactional'
alter table t1 engine=myisam transactional=1;
ERROR HY000: Unknown option 'transactional'
alter table t2 engine=myisam transactional=default;
ERROR HY000: Unknown option 'transactional'
set sql_mode=IGNORE_BAD_TABLE_OPTIONS;
alter table t0 engine=myisam transactional=0;
Warnings:
Warning 1911 Unknown option 'transactional'
alter table t1 engine=myisam transactional=1;
Warnings:
Warning 1911 Unknown option 'transactional'
alter table t2 engine=myisam transactional=default;
Warnings:
Warning 1911 Unknown option 'transactional'
show create table t0;
Table Create Table
t0 CREATE TABLE `t0` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci TRANSACTIONAL=0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci TRANSACTIONAL=1
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t0,t1,t2;
create table t1 (a int) foo=bar;
Warnings:
Warning 1911 Unknown option 'foo'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `foo`=bar
set sql_mode=default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci /* `foo`=bar */
alter table t1 engine=aria bar=foo;
ERROR HY000: Unknown option 'bar'
alter table t1 engine=aria;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 /* `foo`=bar */
drop table t1;
#
# End of 10.5 tests
#
|