Bug #33397 ALTER TABLE into non-existing Falcon tablespace causes vague error.
Submitted: 20 Dec 2007 12:58 Modified: 5 Oct 2008 14:38
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S2 (Serious)
Version:6.0.5-alpha-debug-log OS:Any
Assigned to: Sergey Vojtovich CPU Architecture:Any
Triage: D4 (Minor)

[20 Dec 2007 12:58] Philip Stoev
Description:
ALTER TABLE ... TABLESPACE fails with a vague error on a Falcon table and a non-existing tablespace.

How to repeat:
mysql> create table t1 (f1 integer) engine=falcon;
mysql> alter table t1 tablespace nosuchtablespace;
ERROR 1005 (HY000): Can't create table 'test.#sql-6e79_7' (errno: 156)
[20 Dec 2007 13:35] Miguel Solorzano
Thank you for the bug report.
[20 Dec 2007 14:53] Philip Stoev
More related errors:

mysql> create table t1 (f1 integer) engine=falcon tablespace nosuchspace;
ERROR 1005 (HY000): Can't create table 'db2.t1' (errno: 156)

mysql> create table t12345 (f1 integer) engine=falcon TABLESPACE nosuchspace PARTITION BY HASH(f1) PARTITIONS 2;
ERROR 1005 (HY000): Can't create table 'db2.t12345' (errno: 1)
[7 Jan 2008 12:50] Philip Stoev
If the ALTER fails due to non existing tablespace (e.g. a typo in the tablespace name), *all further alters* will fail due to bug #33400. The difference being that no malicious user action is required because Falcon creates the required circumstances.

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)
[7 Jan 2008 15:27] Philip Stoev
As per Omer's request I filed a new bug #33723 about the fact that future ALTER TABLES can not proceed. Thus this bug remains only about the error message, since it was triaged as such. I am also restoring the original bug title.
[16 Feb 2008 11:26] Philip Stoev
A second ALTER into the same tablespace causes an assertion - bug #34617
[23 Apr 2008 9:23] 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/45868

ChangeSet@1.2641, 2008-04-23 13:21:28+05:00, svoj@mysql.com +6 -0
  BUG#33397 - ALTER TABLE into non-existing Falcon tablespace causes
              vague error.
  
  Creating or altering a table to non-existing tablespace returns
  non-informative error message.
  
  With this fix error message states that the tablespace doesn't
  exist.
  
  No test case needed for this fix - it is already covered by existing
  tests.
[23 Apr 2008 9:31] Ingo Strüwing
Approving the changes in handler.cc.
[19 Jun 2008 13:58] John Embretsen
Added separate test case for this bug, see http://lists.mysql.com/commits/48170.
[5 Aug 2008 16:45] Sergey Vojtovich
Was pushed to 6.0.6.
[5 Oct 2008 14:38] Jon Stephens
Documented in the 6.0.6 changelog as follows:

        An ALTER TABLE ... TABLESPACE statement referencing a
        nonexistent tablespace on a Falcon table failed with an inappropriate
        error message the first time it was executed. A second attempt to
        execute the statement led to a crash of the MySQL server.