mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +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:
@@ -122,3 +122,33 @@ DROP TABLE t1;
|
||||
set global sql_mode=default;
|
||||
SET SESSION enforce_storage_engine=NULL;
|
||||
SET GLOBAL 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 ENGINE=MyISAM;
|
||||
Warnings:
|
||||
Note 1266 Using storage engine MEMORY for table 't3'
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=MEMORY AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
|
||||
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;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(10) DEFAULT NULL,
|
||||
`c3` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t3;
|
||||
SET SESSION enforce_storage_engine=NULL;
|
||||
SET GLOBAL enforce_storage_engine=NULL;
|
||||
|
Reference in New Issue
Block a user