Bug #37030 Can't find a Falcon TableSpace if no Falcon Tables are using that TableSpace.
Submitted: 28 May 2008 9:37 Modified: 11 Jun 2008 18:42
Reporter: Santo Leto Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.4-alpha, 6.0-falcon bk OS:Any
Assigned to: CPU Architecture:Any
Tags: falcon tablespaces

[28 May 2008 9:37] Santo Leto
Description:
Can't find a Falcon TableSpace if no Falcon Tables are using that TableSpace.

How to repeat:
Test Script:

CREATE TABLESPACE `falcon_tablespace_fr_4` ADD DATAFILE 'falcon_tablespace_fr_4' EXTENT_SIZE = 1M INITIAL_SIZE = 1M ENGINE = FALCON;
SELECT DISTINCT `tablespace` FROM `information_schema`.`FALCON_TABLES`;

DROP DATABASE IF EXISTS `falcon_database_fr`;
CREATE DATABASE IF NOT EXISTS `falcon_database_fr`;
CREATE TABLE `falcon_database_fr`.`falcon_table_fr` 
TABLESPACE `falcon_tablespace_fr_4`
ENGINE = FALCON
IGNORE AS SELECT * FROM `mysql`.`user`;

SELECT DISTINCT `tablespace` FROM `information_schema`.`FALCON_TABLES`;

Script Output:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 6.0.4-alpha-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
mysql> CREATE TABLESPACE `falcon_tablespace_fr_4` ADD DATAFILE 'falcon_tablespace_fr_4' EXTENT_SIZE = 1M INITIAL_SIZE = 1M ENGINE = FALCON;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT DISTINCT `tablespace` FROM `information_schema`.`FALCON_TABLES`;
+--------------------+
| tablespace         |
+--------------------+
| FALCON_USER        |
| falcon_tablespace1 |
| pippotest          |
+--------------------+
3 rows in set (0.00 sec)

## I would see `falcon_tablespace_fr_4`..

mysql>
mysql> DROP DATABASE IF EXISTS `falcon_database_fr`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE DATABASE IF NOT EXISTS `falcon_database_fr`;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE TABLE `falcon_database_fr`.`falcon_table_fr`
    -> TABLESPACE `falcon_tablespace_fr_4`
    -> ENGINE = FALCON
    -> IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 5 rows affected (0.19 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql>
mysql> SELECT DISTINCT `tablespace` FROM `information_schema`.`FALCON_TABLES`;
+------------------------+
| tablespace             |
+------------------------+
| FALCON_USER            |
| falcon_tablespace1     |
| pippotest              |
| falcon_tablespace_fr_4 |
+------------------------+
4 rows in set (0.00 sec)

GUI Notes:

The User creates a Falcon TableSpace using a 'TableSpaces Editor'. Then he opens the 'Create Table Wizard' to create a Falcon Table.
Instead of writing the tablespace name in the 'TableSpace' field of the 'Create Table Wizard' he would click on a button to open a list - where all tablespaces are listed - and select the tablespace just created with the 'TableSpace Editor'.
[28 May 2008 21:28] Hakan Küçükyılmaz
Verified as described with latest Falcon sources:

6.0.6-alpha-debug
[23:28] root@test>CREATE TABLESPACE `falcon_tablespace_fr_4` ADD DATAFILE
    -> 'falcon_tablespace_fr_4' EXTENT_SIZE = 1M INITIAL_SIZE = 1M ENGINE =
    -> FALCON;
Query OK, 0 rows affected (0.01 sec)

[23:29] root@test>SELECT DISTINCT `tablespace` FROM
    -> `information_schema`.`FALCON_TABLES`;
Empty set (0.00 sec)

[23:29] root@test>DROP DATABASE IF EXISTS `falcon_database_fr`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

[23:29] root@test>CREATE DATABASE IF NOT EXISTS `falcon_database_fr`;
Query OK, 1 row affected (0.00 sec)

[23:29] root@test>CREATE TABLE `falcon_database_fr`.`falcon_table_fr`
    -> TABLESPACE `falcon_tablespace_fr_4`
    -> ENGINE = FALCON
    -> IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 6 rows affected (0.02 sec)
Records: 6  Duplicates: 0  Warnings: 0

[23:29] root@test>SELECT DISTINCT `tablespace` FROM
    -> `information_schema`.`FALCON_TABLES`;
+------------------------+
| tablespace             |
+------------------------+
| falcon_tablespace_fr_4 |
+------------------------+
1 row in set (0.01 sec)
[4 Jun 2008 17:01] Ann Harrison
This bug should be against the tablespace editor.  The query
described in the bug will never report a tablespace with no
tables because there will never be a row in the TABLES table
for the absence of a table.

There is a TABLESPACES Information Schema table that does
have the necessary information.
[4 Jun 2008 18:27] Santo Leto
This is the good solution I was waiting for.

But `information_schema`.`tablespaces` is not included in version 6.0.4-alpha (the latest version available in binary format); this is the reason because I opened the bug.

In fact, in 6.0.4-alpha (if I am not mistaken, but please advice) there is no possibility to know which tablespaces have been created because the table TABLESPACES wasn't added in information_schema yet.

mysql> show tables like 'table%';
+---------------------------------------+
| Tables_in_information_schema (table%) |
+---------------------------------------+
| TABLES                                |
| TABLE_CONSTRAINTS                     |
| TABLE_PRIVILEGES                      |
+---------------------------------------+
3 rows in set (0.00 sec)

So, to list tablespaces you are forced to select over `information_schema`.`FALCON_TABLES`.
In other words, in version 6.0.4-alpha I can't find a falcon tablespace if no falcon tables are using that tablespace just because the only way to list tablespaces is executing the query

SELECT DISTINCT `tablespace` FROM `information_schema`.`FALCON_TABLES`;

but of course 'there will never be a row in the TABLES table for the absence of a table'.

I know that the query above is wrong; I have the same problem in the 'Metadata Catalog' included in our software. And this is a serious issue because I need to find information in an easy way to create a 'Metadata Catalog'. To list tablespaces I don't want to select over the table `FALCON_TABLES` but over a 'TABLESPACES' table.

If this has been fixed in 6.0.5, wow!, I will change the query executed by the 'Metadata Catalog' and by the 'TableSpace Editor' (and by the 'TableSpace List' used within the 'Create Table Wizard).

So, hope to find `information_schema`.`tablespaces` in 6.0.5-alpha or 6.0.6-alpha. I will test this when I will have a chance to download that versions.

Many Thanks.
[11 Jun 2008 18:42] Kevin Lewis
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html