diff --git a/src/Core/Settings.cpp b/src/Core/Settings.cpp index 6c269e22c35..17e2e1cc599 100644 --- a/src/Core/Settings.cpp +++ b/src/Core/Settings.cpp @@ -3640,6 +3640,11 @@ Given that, for example, dictionaries, can be out of sync across nodes, mutation ``` +)", 0) \ + DECLARE(Bool, validate_mutation_query, true, R"( +Validate mutation queries before accepting them. Mutations are executed in the background, and running an invalid query will cause mutations to get stuck, requiring manual intervention. + +Only change this setting if you encounter a backward-incompatible bug. )", 0) \ DECLARE(Seconds, lock_acquire_timeout, DBMS_DEFAULT_LOCK_ACQUIRE_TIMEOUT_SEC, R"( Defines how many seconds a locking request waits before failing. diff --git a/src/Core/SettingsChangesHistory.cpp b/src/Core/SettingsChangesHistory.cpp index 3fe3e960dc6..613b9e2281a 100644 --- a/src/Core/SettingsChangesHistory.cpp +++ b/src/Core/SettingsChangesHistory.cpp @@ -64,6 +64,7 @@ static std::initializer_listgetSettingsRef()[Setting::validate_mutation_query]) + // Make sure the mutation query is valid + prepareQueryAffectedQueryTree(commands, source.getStorage(), context); QueryPlan plan;