Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 12.3.3
-
None
-
MariaDB 12.3.3 on Linux x86_64
Description
MariaDB 12.3.3 allows an atomic RENAME TABLE to replace the CSV-backed mysql.general_log table with an InnoDB table. The rename succeeds and information_schema.TABLES reports InnoDB for the protected log-table identity.
This occurs when an atomic RENAME TABLE replaces a protected log table with a table using an ineligible storage engine.
Reproducer
Run the following as an administrative user. It disables general logging, performs the swap, records the installed engine, and immediately restores the original table and global setting.
CREATE DATABASE IF NOT EXISTS test; |
SET @saved_general_log=@@GLOBAL.general_log; |
SET GLOBAL general_log=OFF; |
DROP TABLE IF EXISTS test.log_candidate; |
DROP TABLE IF EXISTS test.log_moved; |
CREATE TABLE test.log_candidate (a INT) ENGINE=InnoDB; |
|
|
SELECT ENGINE AS original_engine |
FROM information_schema.TABLES |
WHERE TABLE_SCHEMA='mysql' AND TABLE_NAME='general_log'; |
|
|
RENAME TABLE |
mysql.general_log TO mysql.general_log_backup, |
test.log_candidate TO mysql.general_log; |
|
|
SELECT ENGINE AS installed_engine |
FROM information_schema.TABLES |
WHERE TABLE_SCHEMA='mysql' AND TABLE_NAME='general_log'; |
|
|
RENAME TABLE |
mysql.general_log TO test.log_moved, |
mysql.general_log_backup TO mysql.general_log; |
DROP TABLE test.log_moved; |
|
|
SELECT ENGINE AS restored_engine |
FROM information_schema.TABLES |
WHERE TABLE_SCHEMA='mysql' AND TABLE_NAME='general_log'; |
SET GLOBAL general_log=@saved_general_log; |
Observed result
The first rename succeeds and installs the InnoDB table as mysql.general_log:
original_engine
|
CSV
|
installed_engine
|
InnoDB
|
restored_engine
|
CSV
|
The inverse rename restores the original CSV table successfully.
Expected result
The first RENAME TABLE should fail and leave the CSV-backed mysql.general_log in place. MariaDB rejects InnoDB for this protected log-table identity through the engine-eligibility check used by CREATE and ALTER; changing the table's identity through RENAME should enforce the same invariant.
Attachments
Issue Links
- relates to
-
MDEV-22726 Add check to ensure one can't change general or slow log to a transactional engine
-
- Closed
-
-
MDEV-34928 CREATE TABLE does not check valid engine for log tables
-
- Closed
-