v.21.11Improvements

Fixed error in mutations with nested subqueries and restrictions on replicated tables.

Fixed There is no query or query context has expired error in mutations with nested subqueries. Do not allow subqueries in mutation if table is replicated and allow_nondeterministic_mutations setting is disabled. #29495 (tavplubix).
Fixed the There is no query or query context has expired error occurring in mutations with nested subqueries and prevented the use of subqueries in mutations on replicated tables when the allow_nondeterministic_mutations setting is disabled.

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 enabling allow_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 if allow_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.