Tuesday, December 27, 2005

Lockout from DROP TABLE

This is a probably bug in MySQL! It took a little while to catch and it was pretty annoying. I moved over the 'data' directory from another machine and one of the databases had mixed MyISAM/InnoDB tables. The InnoDB tables did not have separate data files, hence I ended up with only .frm files. Since it was development stuff I didn't worry too much about it. My applications broke saying they couldn't read from the table. SHOW TABLES would show that table but all other operations failed. CREATE TABLE said that table already existed and DROP TABLE would say the table doesn't exist! Unless I had write access to my data directory, I'd be in a really painful situation!

Possible fixes:
  • Better error message
  • Allow DROP TABLE for zombie tables
  • Maybe a new CHECK DATABASE operation which checks all tables for such consistency issues.

  • This page is powered by Blogger. Isn't yours?