v.25.5Improvement

Proper implementation of ASTSelectWithUnionQuery::clone() method now takes

Proper implementation of ASTSelectWithUnionQuery::clone() method now takes into account is_normalized field as well. This might help with #77569. #79909 (Nikita Mikhaylov).
Improved cloning of ASTSelectWithUnionQuery now correctly handles the is_normalized field.

Why it matters

This update ensures that when an abstract syntax tree (AST) of a SELECT query with a UNION is cloned, the normalization state (is_normalized) is preserved. It resolves inconsistencies and potential bugs related to query normalization during cloning, addressing issues like #77569.

How to use it

No explicit user action is required. The improved cloning behavior is integrated internally and automatically applied when AST objects with unions are cloned in query processing.