Description:
information_schema.ENGINES is not refreshed after a SET GLOBAL storage_engine.
How to repeat:
Test Script:
SELECT CONNECTION_ID(), VERSION(), CURRENT_USER();
SHOW GLOBAL VARIABLES LIKE 'storage_engine';
SELECT `ENGINE`, `SUPPORT` FROM `INFORMATION_SCHEMA`.`ENGINES`;
SET GLOBAL storage_engine = 'InnoDB';
SHOW GLOBAL VARIABLES LIKE 'storage_engine';
SELECT `ENGINE`, `SUPPORT` FROM `INFORMATION_SCHEMA`.`ENGINES`;
DROP TABLE IF EXISTS `test`.`is_engine_bug`;
CREATE TABLE `test`.`is_engine_bug` (
`id` BIGINT NULL ,
`f1` TEXT NULL
);
SHOW TABLE STATUS FROM test LIKE 'is_engine_bug'\G
Script Output:
mysql> SELECT CONNECTION_ID(), VERSION(), CURRENT_USER();
+-----------------+-------------------------+----------------+
| CONNECTION_ID() | VERSION() | CURRENT_USER() |
+-----------------+-------------------------+----------------+
| 977 | 5.1.23-rc-community-log | root@localhost |
+-----------------+-------------------------+----------------+
1 row in set (0.00 sec)
mysql>
mysql> SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| storage_engine | MyISAM |
+----------------+--------+
1 row in set (0.00 sec)
mysql> SELECT `ENGINE`, `SUPPORT` FROM `INFORMATION_SCHEMA`.`ENGINES`;
+------------+---------+
| ENGINE | SUPPORT |
+------------+---------+
| EXAMPLE | YES |
| CSV | YES |
| MyISAM | DEFAULT |
| BLACKHOLE | YES |
| MRG_MYISAM | YES |
| InnoDB | YES |
| ARCHIVE | YES |
| MEMORY | YES |
| FEDERATED | YES |
+------------+---------+
9 rows in set (0.00 sec)
## Ok, they match
## Now we change from MyISAM to InnoDB
mysql> SET GLOBAL storage_engine = 'InnoDB';
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| storage_engine | InnoDB |
+----------------+--------+
1 row in set (0.00 sec)
mysql> SELECT `ENGINE`, `SUPPORT` FROM `INFORMATION_SCHEMA`.`ENGINES`;
+------------+---------+
| ENGINE | SUPPORT |
+------------+---------+
| EXAMPLE | YES |
| CSV | YES |
| MyISAM | DEFAULT |
| BLACKHOLE | YES |
| MRG_MYISAM | YES |
| InnoDB | YES |
| ARCHIVE | YES |
| MEMORY | YES |
| FEDERATED | YES |
+------------+---------+
9 rows in set (0.00 sec)
## They do not match !
## Just a check, MyISAM is used
mysql> DROP TABLE IF EXISTS `test`.`is_engine_bug`;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE `test`.`is_engine_bug` (
-> `id` BIGINT NULL ,
-> `f1` TEXT NULL
-> );
Query OK, 0 rows affected (0.08 sec)
mysql> SHOW TABLE STATUS FROM test LIKE 'is_engine_bug'\G
*************************** 1. row ***************************
Name: is_engine_bug
Engine: MyISAM
Version: 10
Row_format: Dynamic
Rows: 0
Avg_row_length: 0
Data_length: 0
Max_data_length: 281474976710655
Index_length: 1024
Data_free: 0
Auto_increment: NULL
Create_time: 2008-04-16 15:46:42
Update_time: 2008-04-16 15:46:42
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)
Further Consideration - Workaround:
# If we open a new connection, information_schema.engines is refreshed:
SELECT CONNECTION_ID(), VERSION(), CURRENT_USER;
SHOW GLOBAL VARIABLES LIKE 'storage_engine';
SELECT `ENGINE`, `SUPPORT` FROM `INFORMATION_SCHEMA`.`ENGINES`;
mysql> SELECT CONNECTION_ID(), VERSION(), CURRENT_USER;
+-----------------+-------------------------+----------------+
| CONNECTION_ID() | VERSION() | CURRENT_USER |
+-----------------+-------------------------+----------------+
| 978 | 5.1.23-rc-community-log | root@localhost |
+-----------------+-------------------------+----------------+
1 row in set (0.00 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| storage_engine | InnoDB |
+----------------+--------+
1 row in set (0.00 sec)
mysql> SELECT `ENGINE`, `SUPPORT` FROM `INFORMATION_SCHEMA`.`ENGINES`;
+------------+---------+
| ENGINE | SUPPORT |
+------------+---------+
| EXAMPLE | YES |
| CSV | YES |
| MyISAM | YES |
| BLACKHOLE | YES |
| MRG_MYISAM | YES |
| InnoDB | DEFAULT |
| ARCHIVE | YES |
| MEMORY | YES |
| FEDERATED | YES |
+------------+---------+
9 rows in set (0.00 sec)
mysql>