@@ -117,22 +117,22 @@ mysql.time_zone_name Table is already up to date
117
117
mysql.time_zone_transition Table is already up to date
118
118
mysql.time_zone_transition_type Table is already up to date
119
119
mysql.user Table is already up to date
120
- create table t1 (a int);
120
+ create table t1 (a int) engine=myisam ;
121
121
create view v1 as select * from t1;
122
122
test.t1 OK
123
123
test.t1 Table is already up to date
124
124
test.t1 OK
125
125
test.t1 Table is already up to date
126
126
drop view v1;
127
127
drop table t1;
128
- create table `t``1`(a int);
129
- create table `t 1`(a int);
128
+ create table `t``1`(a int) engine=myisam ;
129
+ create table `t 1`(a int) engine=myisam ;
130
130
test.t 1 OK
131
131
test.t`1 OK
132
132
drop table `t``1`, `t 1`;
133
133
create database d_bug25347;
134
134
use d_bug25347;
135
- create table t_bug25347 (a int);
135
+ create table t_bug25347 (a int) engine=myisam ;
136
136
create view v_bug25347 as select * from t_bug25347;
137
137
insert into t_bug25347 values (1),(2),(3);
138
138
flush tables;
@@ -172,15 +172,15 @@ Table Op Msg_type Msg_text
172
172
test.v1 check status OK
173
173
information_schema.routines check note The storage engine for the table doesn't support check
174
174
drop view v1;
175
- CREATE TABLE t1(a INT);
176
- CREATE TABLE t2(a INT);
175
+ CREATE TABLE t1(a INT) engine=myisam ;
176
+ CREATE TABLE t2(a INT) engine=myisam ;
177
177
test.t1
178
178
Error : Incorrect information in file: './test/t1.frm'
179
179
error : Corrupt
180
180
test.t2 OK
181
181
DROP TABLE t1, t2;
182
182
End of 5.0 tests
183
- create table t1(a int);
183
+ create table t1(a int) engine=myisam ;
184
184
create view v1 as select * from t1;
185
185
show tables;
186
186
Tables_in_test
200
200
drop view v1, `v-1`;
201
201
drop table t1;
202
202
SET NAMES utf8;
203
- CREATE TABLE `#mysql50#@` (a INT);
203
+ CREATE TABLE `#mysql50#@` (a INT) engine=myisam ;
204
204
SHOW TABLES;
205
205
Tables_in_test
206
206
#mysql50#@
@@ -211,7 +211,7 @@ SHOW TABLES;
211
211
Tables_in_test
212
212
@
213
213
DROP TABLE `@`;
214
- CREATE TABLE `я` (a INT);
214
+ CREATE TABLE `я` (a INT) engine=myisam ;
215
215
SET NAMES DEFAULT;
216
216
mysqlcheck --default-character-set="latin1" --databases test
217
217
test.?
@@ -224,8 +224,8 @@ DROP TABLE `я`;
224
224
SET NAMES DEFAULT;
225
225
CREATE DATABASE `#mysql50#a@b`;
226
226
USE `#mysql50#a@b`;
227
- CREATE TABLE `#mysql50#c@d` (a INT);
228
- CREATE TABLE t1 (a INT);
227
+ CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam ;
228
+ CREATE TABLE t1 (a INT) engine=myisam ;
229
229
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
230
230
WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
231
231
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
@@ -254,12 +254,12 @@ USE test;
254
254
# Bug #31821: --all-in-1 and --fix-table-names don't work together
255
255
#
256
256
drop table if exists `#mysql50#t1-1`;
257
- create table `#mysql50#t1-1` (a int);
257
+ create table `#mysql50#t1-1` (a int) engine=myisam ;
258
258
show tables like 't1-1';
259
259
Tables_in_test (t1-1)
260
260
t1-1
261
261
drop table `t1-1`;
262
- create table `#mysql50#t1-1` (a int);
262
+ create table `#mysql50#t1-1` (a int) engine=myisam ;
263
263
show tables like 't1-1';
264
264
Tables_in_test (t1-1)
265
265
t1-1
@@ -268,3 +268,67 @@ End of 5.1 tests
268
268
#
269
269
# Bug #35269: mysqlcheck behaves different depending on order of parameters
270
270
#
271
+ #
272
+ # Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR
273
+ # ENGINES NOT SUPPORTING NATIVE
274
+ #
275
+ DROP TABLE IF EXISTS bug47205;
276
+ #
277
+ # Test 1: Check that ALTER TABLE ... rebuilds the table
278
+ CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
279
+ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
280
+ INSERT INTO bug47205 VALUES ("foobar");
281
+ FLUSH TABLE bug47205;
282
+ # Replace the FRM with a 5.0 FRM that will require upgrade
283
+ # Should indicate that ALTER TABLE ... FORCE is needed
284
+ CHECK TABLE bug47205 FOR UPGRADE;
285
+ Table Op Msg_type Msg_text
286
+ test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it!
287
+ # ALTER TABLE ... FORCE should rebuild the table
288
+ # and therefore output "affected rows: 1"
289
+ ALTER TABLE bug47205 FORCE;
290
+ affected rows: 1
291
+ info: Records: 1 Duplicates: 0 Warnings: 0
292
+ # Table should now be ok
293
+ CHECK TABLE bug47205 FOR UPGRADE;
294
+ Table Op Msg_type Msg_text
295
+ test.bug47205 check status OK
296
+ DROP TABLE bug47205;
297
+ #
298
+ # Test 2: InnoDB - REPAIR not supported
299
+ CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
300
+ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
301
+ FLUSH TABLE bug47205;
302
+ # Replace the FRM with a 5.0 FRM that will require upgrade
303
+ # Should indicate that ALTER TABLE .. FORCE is needed
304
+ CHECK TABLE bug47205 FOR UPGRADE;
305
+ Table Op Msg_type Msg_text
306
+ test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it!
307
+ # Running mysqlcheck to check and upgrade
308
+ test.bug47205
309
+ error : Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it!
310
+
311
+ Repairing tables
312
+ # Table should now be ok
313
+ CHECK TABLE bug47205 FOR UPGRADE;
314
+ Table Op Msg_type Msg_text
315
+ test.bug47205 check status OK
316
+ DROP TABLE bug47205;
317
+ #
318
+ # Test 3: MyISAM - REPAIR supported
319
+ # Use an old FRM that will require upgrade
320
+ # Should indicate that REPAIR TABLE is needed
321
+ CHECK TABLE bug47205 FOR UPGRADE;
322
+ Table Op Msg_type Msg_text
323
+ test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it!
324
+ # Running mysqlcheck to check and upgrade
325
+ test.bug47205
326
+ error : Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it!
327
+
328
+ Repairing tables
329
+ test.bug47205 OK
330
+ # Table should now be ok
331
+ CHECK TABLE bug47205 FOR UPGRADE;
332
+ Table Op Msg_type Msg_text
333
+ test.bug47205 check status OK
334
+ DROP TABLE bug47205;
0 commit comments