Bug #33723 ALTER TABLE into non-existing Falcon tablespace blocks further ALTERs
Submitted: 7 Jan 2008 15:26 Modified: 18 Oct 2008 15:11
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.4-p2 OS:Any
Assigned to: Sergey Vojtovich CPU Architecture:Any

[7 Jan 2008 15:26] Philip Stoev
Description:
After bug #33397 was filed and triaged, it turns out that an ALTER TABLE into a non-existing Falcon tablespace not only results in a vague error message, but also cause all further ALTER TABLE statements to fail.

As per Omer's request I am filing a new bug, leaving the original bug to deal with the error message only.

Please also see bug #33400.

How to repeat:
mysql> create table t1 (f1 integer) engine=falcon;
Query OK, 0 rows affected (0.41 sec)

mysql> alter table t1 tablespace nosuchspace;
ERROR 1005 (HY000): Can't create table 'test.#sql-1125_1' (errno: 156)

mysql> create tablespace space1 add datafile 'data1' engine=falcon;
Query OK, 0 rows affected (0.04 sec)

mysql> alter table t1 tablespace space1;
ERROR 1005 (HY000): Can't create table 'test.#sql-1125_1' (errno: 156)

Suggested fix:
Falcon ALTER failures should clean up the temporary table that has been created.
[8 Jan 2008 10:29] MySQL Verification Team
Thank you for the bug report.
[13 Feb 2008 21:07] James Day
The workarounds are:

1. mysqldump and reload of the whole server.
2. or use a different tablespace name.
[16 Feb 2008 11:27] Philip Stoev
A second ALTER into the same tablespace causes an assertion - bug #34617
[16 Apr 2008 9:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/45474

ChangeSet@1.2643, 2008-04-16 13:54:53+05:00, svoj@mysql.com +3 -0
  BUG#33723 - ALTER TABLE into non-existing Falcon tablespace blocks
              further ALTERs
  BUG#34048 - Falcon: after error with tablespace, I can't create table
  BUG#34617 - Falcon assertion in StorageHandler::addTable, line 622
  
  If Falcon fails to create a table for some reason (e.g. non-existent
  tablespace), it is not possible to create a table in the same database
  with the same name anymore (until server is restarted). Or assertion
  failure (=server crash) may occur for further create table statements.
  
  The above is true for ALTER TABLE as well, when it fails to create
  temporary table.
  
  The problem was that table share was not removed from table share
  hash on error.
[16 Apr 2008 10:05] Sergey Vojtovich
BUG#34048 and BUG#34617 were marked as duplicates.
[19 Jun 2008 14:02] John Embretsen
Added a separate test case for this bug, see http://lists.mysql.com/commits/48170
[5 Aug 2008 16:44] Sergey Vojtovich
Was pushed to 6.0.6.
[18 Oct 2008 15:11] Jon Stephens
Documented in the 6.0.6 changelog as follows:

        If CREATE TABLE or ALTER TABLE of a Falcon table failed, it was not
        possible to create another table in the same database having the same
        name unless the server was restarted. In some cases, subsequent CREATE
        TABLE statements could cause the server to crash.