Bug #41331 SHOW VARIABLES should report values used by Falcon instead of ignored values
Submitted: 9 Dec 2008 15:58 Modified: 26 May 2010 17:50
Reporter: John Embretsen Email Updates:
Status: Unsupported Impact on me:
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.9-bzr OS:Any
Assigned to: Lars-Erik Bjørk CPU Architecture:Any

[9 Dec 2008 15:58] John Embretsen
The SHOW VARIABLES command should report values that are actually used by the MySQL Server / storage engine, not values that are supplied e.g. as command-line options but ignored by the server.

One particular example of this issue is the falcon_page_size variable. I don't know if other variables could be affected.

The falcon_page_size variable's value can only be set at the moment when Falcon is initialized, see Bug#41014. If a server administrator shuts down the server (or simply does a bootstrap) and later restarts it with a different value (e.g. including the option --falcon-page-size=2K (default is 4K)), SHOW VARIABLES will report the latter but Falcon will use the original value (which is stored in the tablespace header).

(This bug is similar to Bug#34486).

How to repeat:
The following shows how to demonstrate this behavior based on a source build including Falcon, using a minimal number of server options.

1. Compile the source as you normally do. Let's call the top-level directory "SRCDIR".

2. Initialize the database/server using default page-size setting:

   ./scripts/mysql_install_db \
       --no-defaults \
       --srcdir=${SRCDIR} \

3. Start mysqld using custom page-size setting:

   ./sql/mysqld \
       --no-defaults \
       --basedir=${SRCDIR} \
       --language=${SRCDIR}/sql/share/english \

4. Connect to the server:

   ./client/mysql -u root -h

5. Retreive the value of the falcon-page-size option from SHOW VARIABLES:

   mysql> use test;
   Database changed

   mysql> SHOW VARIABLES LIKE '%falcon_page_size%';
   | Variable_name    | Value |
   | falcon_page_size | 2048  |
   1 row in set (0.00 sec)

(If you don't set a custom page-size value, it would have reported 4096, which is the default).

6. Create a table with an index exceeding the Maximum Index Key Length for a page-size of 2K (utf8 max length is 4 bytes, 4*140 = 560, max index key length for 2K page-size is 540, thus a 140 character column should suffice):

   mysql> CREATE TABLE t1(a VARCHAR(140) CHARACTER SET utf8, KEY(a)) ENGINE=falcon;

The CREATE TABLE statement succeeds without warnings, which shows that the value reported by SHOW VARIABLES is not in use.

Suggested fix:
Primarily, have SHOW VARIABLES report the value that is actually used by the server / Falcon.

Secondarily, give the user a warning or error message upon startup if an included server option is being ignored (a fix which probably deserves a separate bug report).