1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-8577: With enforce-storage-engine mysql_upgrade corrupts the schema:

ALTER TABLE should either bypass enforce-storage-engine, or mysql_upgrade
should refuse to run

Allow user to alter contents of existing table without enforcing
storage engine. However, enforce storage engine on ALTER TABLE
x ENGINE=y;
This commit is contained in:
Jan Lindström
2015-09-12 13:16:05 +03:00
parent 1e9ab68e4a
commit 9b577edd50
5 changed files with 144 additions and 2 deletions

View File

@ -87,3 +87,25 @@ disconnect con1;
set global sql_mode=default;
SET SESSION enforce_storage_engine=NULL;
SET GLOBAL enforce_storage_engine=NULL;
#
# MDEV-8577: With enforce-storage-engine mysql_upgrade corrupts the schema:
# ALTER TABLE should either bypass enforce-storage-engine, or mysql_upgrade
# should refuse to run
#
CREATE TABLE t3 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
INSERT INTO t3 values (NULL, 'test');
SET SESSION enforce_storage_engine=Memory;
ALTER TABLE t3 ENGINE=MyISAM;
SHOW CREATE TABLE t3;
DROP TABLE t3;
SET SESSION enforce_storage_engine=NULL;
CREATE TABLE t3 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
INSERT INTO t3 values (NULL, 'test');
SET SESSION enforce_storage_engine=Memory;
ALTER TABLE t3 ADD COLUMN c3 INT;
SHOW CREATE TABLE t3;
DROP TABLE t3;
SET SESSION enforce_storage_engine=NULL;
SET GLOBAL enforce_storage_engine=NULL;