Bug #34048 Falcon: after error with tablespace, I can't create table
Submitted: 24 Jan 2008 23:17 Modified: 16 Apr 2008 10:04
Reporter: Peter Gulutzan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.5-alpha-debug OS:Linux (SUSE 10 / 64-bit)
Assigned to: Assigned Account CPU Architecture:Any

[24 Jan 2008 23:17] Peter Gulutzan
Description:
I try to create a table with a nonexistent tablespace.
Error. Okay.

Then I try to create a table without a tablespace clause.
Error. Not okay.

This might be related to Bug#33723.

How to repeat:
mysql> create table t (s1 int) engine=falcon tablespace nonexistent;
ERROR 1005 (HY000): Can't create table 'd.t' (errno: 156)

mysql> create table t (s1 int) engine=falcon;
ERROR 1005 (HY000): Can't create table 'd.t' (errno: 156)
[25 Jan 2008 9:04] Sveta Smirnova
Thank you for the report.

Verified as described.
[30 Jan 2008 22:16] Hakan Küçükyılmaz
Latest mysql-6.0-falcon-team tree shows following assertion:

[23:12] root@(none)>create schema test; use test;
Query OK, 1 row affected (0.00 sec)

Database changed

[23:12] root@test>create table t (s1 int) engine=falcon tablespace nonexistent;
ERROR 1005 (HY000): Can't create table 'test.t' (errno: 156)

[23:12] root@test>create table t (s1 int) engine=falcon;
-- Assertion

(gdb) bt
#0  0x00002b7d40ab969b in raise () from /lib/libpthread.so.0
#1  0x000000000082cc5e in Error::debugBreak () at Error.cpp:92
#2  0x000000000082cd46 in Error::error (string=<value optimized out>) at Error.cpp:69
#3  0x000000000082cda6 in Error::assertionFailed (fileName=0x4 <Address 0x4 out of bounds>,
    line=1232) at Error.cpp:76
#4  0x00000000007f0e6d in StorageHandler::addTable (this=0x2aaaaf10c048, table=0x2aaaaf3439c0)
    at StorageHandler.cpp:621
#5  0x00000000007f2426 in StorageHandler::createTable (this=0x2aaaaf10c048,
    pathname=0x40880a40 "./test/t", tableSpaceName=0x0, tempTable=<value optimized out>)
    at StorageHandler.cpp:607
#6  0x00000000007ea418 in StorageInterface::create (this=0x12166a8,
    mySqlName=0x40880a40 "./test/t", form=0x4087f8e0, info=0x40880de0) at ha_falcon.cpp:694
#7  0x0000000000737b38 in ha_create_table (thd=0x123ed48, path=<value optimized out>,
    db=0x127dc38 "test", table_name=0x127d8b8 "t", create_info=0x40880de0,
    update_create_info=false) at handler.cc:2706
#8  0x00000000006ff583 in rea_create_table (thd=0x123ed48, path=0x40880a40 "./test/t",
    db=0x127dc38 "test", table_name=0x127d8b8 "t", create_info=0x40880de0,
    create_fields=@0x40881708, keys=0, key_info=0x127e060, file=0x127ddc0) at unireg.cc:473
#9  0x000000000074e40a in mysql_create_table_no_lock (thd=0x123ed48, db=0x127dc38 "test",
    table_name=0x127d8b8 "t", create_info=0x40880de0, alter_info=0x408816c0,
    internal_tmp_table=false, select_field_count=0) at sql_table.cc:3474
#10 0x000000000074e7f9 in mysql_create_table (thd=0x123ed48, db=0x127dc38 "test",
    table_name=0x127d8b8 "t", create_info=0x40880de0, alter_info=0x408816c0,
    internal_tmp_table=false, select_field_count=0) at sql_table.cc:3581
#11 0x00000000006560af in mysql_execute_command (thd=0x123ed48) at sql_parse.cc:2231

(gdb) f 4
#4  0x00000000007f0e6d in StorageHandler::addTable (this=0x2aaaaf10c048, table=0x2aaaaf3439c0)
    at StorageHandler.cpp:621
621             ASSERT(table->collision != table);
(gdb) p table->collision
$1 = (StorageTableShare *) 0x2aaaaf3439c0
(gdb) p table
$2 = (class StorageTableShare *) 0x2aaaaf3439c0
(gdb)

After restart, we get a inconsitent state:
[23:15] root@test>create table t (s1 int) engine=falcon;
ERROR 1050 (42S01): Table 't' already exists

[23:15] root@test>insert into t values (1);
ERROR 1146 (42S02): Table 'test.t' doesn't exist
[1 Feb 2008 0:56] zuo jianhua
Maybe registerTable called led to in StorageHandler::createTable(  ). move  line 606 tableShare->registerTable() to below storageTable->create(  ) line 715 in StorageInterface::create(  );
[16 Apr 2008 10:04] Sergey Vojtovich
Will be fixed by patch for BUG#33723.
[19 Jun 2008 14:03] John Embretsen
Added a separate test case for this bug, see http://lists.mysql.com/commits/48170