简体   繁体   中英

error while changing table engine to InnoDB

I am changing table engine from MyISAM to InnoDB:

use db;
alter table table engine=innodb;

But, I've faced a very strange problem.

I can change engine of all tables, but except certain tables, whose names end with _1 .

For example, I can change tables test_2 , test_xy , but I can't change a table test_1 . When I try to do it the following error occurs:

ERROR 1005 (HY000): Can't create table 'db.#sql-3d9_348' (errno: 139)

The above is not only one. I have learning_1 , learning_2 , learning_xy and so many pairs like that.

I don't know why this happens. Because _1 is not a special strings such as backtick, quotes, dollar sign, number sign or something. And I don't think it is related with a length of db, table name. Also, not related with table size.

Is there a know bug or issue in altering table engine with a certain table name?

I have no idea why _1 is an issue, but maybe this is a workaround

use db;
RENAME TABLE test_1 TO test1;
alter table test1 engine=innodb;
RENAME TABLE test1 TO test_1;

Of course I would suggest a backup before doing anything

It's my fault.

It is not related with _1 , but it is related with the number of columns.

Tables with _1 at the end of the name have 1,001 columns.

It is too big for InnoDB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM