v.21.11Improvements
Fixed error in mutations with nested subqueries and restrictions on replicated tables.
FixedThere is no query or query context has expirederror in mutations with nested subqueries. Do not allow subqueries in mutation if table is replicated andallow_nondeterministic_mutationssetting is disabled. #29495 (tavplubix).
Why it matters
This feature addresses the issue where mutations involving nested subqueries could fail with a context expiration error, ensuring more stable mutation operations. Additionally, it enforces safer mutation practices by disallowing subqueries in mutations on replicated tables unless explicitly permitted by enablingallow_nondeterministic_mutations, thereby preventing potential replication inconsistencies.How to use it
To avoid the mutation errors, ensure that mutations with nested subqueries are used cautiously. For replicated tables, subqueries in mutations are disabled by default ifallow_nondeterministic_mutations is set to 0 (disabled). To allow such mutations, set allow_nondeterministic_mutations=1 in the server or session settings before running the mutation query.