v.20.7New Feature

Add allow_non_metadata_alters setting to restrict ALTER queries that modify disk data

Add setting allow_non_metadata_alters which restricts to execute ALTER queries which modify data on disk. Disabled be default. Closes #11547. #12635 (alesapin).
Introduces the allow_non_metadata_alters setting to control execution of ALTER queries that modify data on disk.

Why it matters

This feature restricts ALTER queries which affect data on disk, enhancing safety by preventing potentially unsafe or unintended data modifications through ALTER statements. It helps users avoid accidental changes to stored data structures or content, improving stability and data integrity.

How to use it

Users can enable or disable this restriction by setting allow_non_metadata_alters to true or false. By default, it is disabled (set to false), blocking ALTER queries that modify data on disk. To allow such queries, set the setting to true either in the server configuration or per session.