Add setting

This commit is contained in:
Christoph Wurm 2024-11-01 11:06:21 +00:00
parent b229fb1664
commit 9015454b37
3 changed files with 10 additions and 2 deletions

View File

@ -3640,6 +3640,11 @@ Given that, for example, dictionaries, can be out of sync across nodes, mutation
</profiles>
```
)", 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.

View File

@ -64,6 +64,7 @@ static std::initializer_list<std::pair<ClickHouseVersion, SettingsChangesHistory
},
{"24.11",
{
{"validate_mutation_query", false, true, "New setting to validate mutation queries by default."},
}
},
{"24.10",

View File

@ -53,6 +53,7 @@ namespace Setting
extern const SettingsBool allow_nondeterministic_mutations;
extern const SettingsUInt64 max_block_size;
extern const SettingsBool use_concurrency_control;
extern const SettingsBool validate_mutation_query;
}
namespace MergeTreeSetting
@ -1386,8 +1387,9 @@ void MutationsInterpreter::validate()
}
}
// Make sure the mutations query is valid
prepareQueryAffectedQueryTree(commands, source.getStorage(), context);
if (context->getSettingsRef()[Setting::validate_mutation_query])
// Make sure the mutation query is valid
prepareQueryAffectedQueryTree(commands, source.getStorage(), context);
QueryPlan plan;