[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 Created: 2015-08-07  Updated: 2015-09-12  Resolved: 2015-09-12

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 10.1
Fix Version/s: 10.1.8

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-8576 Bootstrap should ignore --enforce-sto... Closed
Relates
relates to MDEV-6858 enforce_storage_engine option Closed
Sprint: 10.1.8-1

 Description   

Currently if enforce_storage_engine is set, ALTER TABLE will switch the table to the enforced engine. It's a point of huge user errors, but even worse, it will make mysql_upgrade create a mess – it will attempt to ALTER system tables, will convert them to the enforced engine, and it will break the instance.

I suppose it would be right if enforce_storage_engine did not affect ALTER TABLE – the point of this option is not to allow creating new "wrong" tables, while existing ones should, if needed, be converted manually and carefully, rather than automatically by an unrelated operation.

If it's technically impossible to skip enforcing for ALTER TABLE, at the very least mysql_upgrade should handle it correctly – either refuse to run with the option, or unset it before running and reset afterwards. But there will still be a lot of room for human mistakes.



 Comments   
Comment by Jan Lindström (Inactive) [ 2015-08-08 ]

Suggestion: Allow ALTER TABLE t2 ... with no ENGINE=x to bypass enforce-storage-engine i.e. retain used engine at create time but ALTER TABLE t1 ENGINE=x should not. Does this break mysql_upgrade ?

Comment by Jan Lindström (Inactive) [ 2015-08-08 ]

http://lists.askmonty.org/pipermail/commits/2015-August/008241.html

Comment by Jan Lindström (Inactive) [ 2015-09-12 ]

commit 9b577edd50e29452c0ac58d3c73a871dc20dc37a
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Sat Sep 12 13:16:05 2015 +0300

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;

Generated at Thu Feb 08 07:28:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.