MySQL Forums
Forum List  »  MyISAM

Unable to recreate table with engine other than MyISAM
Posted by: Chris Guin
Date: October 30, 2007 01:10PM

I am using MySQL as a backend to Django, which by default (and as far as I can tell, unalterably) creates tables using something other than MyISAM. As I understand it, to support full-text search, you have to change the table to be indexed into a MyISAM table. Therefore, I added some custom SQL to do an ALTER TABLE after Django has created the table in question.

This works fine the first time through, but when trying to recreate the database from scratch, something weird happens. The database is dropped and recreated correctly, but MySQL refuses to allow Django to create the table again. If I open up MySQL on the command line and try to create the table manually, it only allows me to do so if I specify the engine as MyISAM. Once the table is created this way, I can not use ALTER TABLE to change it to anything else. This, in spite of the fact that the table is newly created, empty, and has a single integer column (for testing purposes). The error I get when trying to create the table (without setting it to MyISAM) is:

[Error Code: 1005, SQL State: HY000] Can't create table '.\helical\agile_shadow_interaction.frm' (errno: 150)


When trying to alter the table to InnoDB, I get the following error:

[Error Code: 1025, SQL State: HY000] Error on rename of '.\helical\#sql-7d8_1' to '.\helical\agile_shadow_interaction' (errno: 150)


Even stranger, if I create a brand new test table with a different name, alter it to be MyISAM, drop it, and then recreate it, I have no problems. It's as though MySQL remembers that the table "agile_shadow_interaction" used to be MyISAM and refuses to let it be anything else. Any ideas as to how this can be remedied?

Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
Unable to recreate table with engine other than MyISAM
6046
October 30, 2007 01:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.