简体   繁体   English

将表引擎更改为InnoDB时出错

[英]error while changing table engine to InnoDB

I am changing table engine from MyISAM to InnoDB: 我将表引擎从MyISAM更改为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 . 我可以更改所有表的引擎,但某些表的名称以_1结尾的除外。

For example, I can change tables test_2 , test_xy , but I can't change a table test_1 . 例如,我可以更改表test_2test_xy ,但不能更改表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. 我有learning_1learning_2learning_xy以及如此多的配对。

I don't know why this happens. 我不知道为什么会这样。 Because _1 is not a special strings such as backtick, quotes, dollar sign, number sign or something. 因为_1不是特殊的字符串,例如反引号,引号,美元符号,数字符号等。 And I don't think it is related with a length of db, table name. 而且我认为这与db的长度,表名无关。 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 我不知道为什么_1是一个问题,但是也许这是一种解决方法

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. 它与_1不相关,但与列数相关。

Tables with _1 at the end of the name have 1,001 columns. 名称末尾带有_1表具有1,001列。

It is too big for InnoDB 对于InnoDB来说太大了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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