Bug #37668 No error message if tables are created in Falcon tablespaces with special names
Submitted: 26 Jun 2008 13:59 Modified: 9 Jan 2009 13:54
Reporter: John Embretsen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.5, 6.0 bzr OS:Any
Assigned to: Sergey Vojtovich CPU Architecture:Any
Tags: F_TABLESPACE, falcon

[26 Jun 2008 13:59] John Embretsen
Description:
Currently Falcon gives no error message when a user creates a Falcon tablespace with the same name as a potential Falcon-internal tablespace and creates tables in it. 
It is not possible to drop such a table space (ERROR 303 (HY000): Unknown error 303).

Tablespaces used internally by Falcon include:

  FALCON_MASTER
  FALCON_TEMPORARY
  FALCON_BACKLOG

FALCON_MASTER is afaik. an "unnamed" tablespace [1]. It does not show itself in information_schema.falcon_tablespaces. Upon startup (clean database), the tablespaces FALCON_USER and FALCON_TEMPORARY are shown. Creating a tablespace called FALCON_MASTER manually is allowed, and the same goes for creating tables in that table space (no warnings). However, dropping the tablespace is not allowed.

Creating a user-defined tablespace with the same name as an internal Falcon table space may possibly lead to problems later in the game. If that is the case, a specific error message should be issued at create time.

See also:
  - Bug#36925 (Falcon: crash with tablespace after error)
  - Bug#33720 (Falcon allows FALCON_TEMPORARY to be manually specified as a tablespace)
  - Bug#35257 (Falcon: tablespace names are case sensitive)

[1]: http://dev.mysql.com/doc/refman/6.0/en/se-falcon-createdb.html

How to repeat:
use test;

-- create a regular user-defined tablespace
create tablespace myspace add datafile 'myspace.fts' engine=Falcon;
-- create a tablespace with special name
--   tablespace file falcon_master.fts already exists, so use a different one
create tablespace FALCON_MASTER add datafile 'falcon_master_test.fts' engine=Falcon;
-- create a table in each tablespace
create table t1 (s1 int) engine=Falcon tablespace FALCON_MASTER;
create table t2 (s1 int) engine=Falcon tablespace myspace;

-- check status
select * from information_schema.falcon_tables;
select * from information_schema.falcon_tablespaces;

-- drop the tables and tablespaces
drop table t1;
--   this results in unknown error (ERROR 303):
drop tablespace FALCON_MASTER Engine=Falcon;

drop table t2;
--   this succeeds:
drop tablespace myspace Engine=Falcon;

Suggested fix:
I cannot tell for sure if creating tablespaces with these special names should be disallowed. 
The user should at least be warned if there is a risk of doing so (and/or creating tables within such tablespaces), and should get a useful error message if this should not be allowed.
If creating such a tablespace is supposed to be allowed, then there is probably a bug in relation to dropping such a tablespace.
[26 Jun 2008 19:08] Sveta Smirnova
Thank you for the report.

Verified as described.
[2 Sep 2008 14:48] 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/53071

2806 Sergey Vojtovich	2008-09-02
      BUG#37668 - No error message if tables are created in Falcon
                  tablespaces with special names
      
      Creating Falcon tablespace with 'FALCON_MASTER' name was
      silently accepted. As 'FALCON_MASTER' is the name of falcon
      internal tablespace it must be rejected.
      
      With this fix an error is returned if user attempts to create
      tablespace with 'FALCON_MASTER' name.
[30 Sep 2008 9:59] Sergey Vojtovich
Was pushed to 6.0.8 Sep 20.
[9 Jan 2009 13:54] MC Brown
A note was added to the 6.0.8 changelog: 

It was possible to create a tasblespace using the name of one of the Falcon system tablespaces, FALCON_MASTER, FALCON_TEMPORARY, or FALCON_BACKLOG without an error message being raised. A suitable error is now produced when an attempt is made to create a table with the same name as a Falcon system tablespace.