Bug #33723 ALTER TABLE into non-existing Falcon tablespace blocks further ALTERs
Submitted: 7 Jan 16:26 Modified: 5 Aug 18:44
Reporter: Philip Stoev
Status: Documenting
Category:Server: Falcon Severity:S3 (Non-critical)
Version:6.0.4-p2 OS:Any
Assigned to: Sergey Vojtovich Target Version:6.0.5
Triage: D2 (Serious)

[7 Jan 16: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 11:29] Miguel Solorzano
Thank you for the bug report.
[13 Feb 22:07] James Day
The workarounds are:

1. mysqldump and reload of the whole server.
2. or use a different tablespace name.
[16 Feb 12:27] Philip Stoev
A second ALTER into the same tablespace causes an assertion - bug #34617
[16 Apr 11: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 12:05] Sergey Vojtovich
BUG#34048 and BUG#34617 were marked as duplicates.
[19 Jun 16:02] John H. Embretsen
Added a separate test case for this bug, see http://lists.mysql.com/commits/48170
[5 Aug 18:44] Sergey Vojtovich
Was pushed to 6.0.6.