v.23.11Improvement
Fixed Query String Handling and Added OrNull Variants in formatQuery Functions
Fixed handling of non-const query strings in functionsformatQuery/formatQuerySingleLine. Also addedOrNullvariants of both functions that return a NULL when a query cannot be parsed instead of throwing an exception. #56327 (Robert Schulze).
Why it matters
This feature enhances robustness and flexibility when formatting queries by fixing issues with non-constant query strings. TheOrNull variants provide a safer way to handle queries that may fail to parse, returning NULL instead of throwing an exception, which improves error handling and prevents query interruptions.How to use it
Use the existing functions<code>formatQuery</code> and <code>formatQuerySingleLine</code> as usual. To avoid exceptions on parse errors, switch to the new <code>formatQueryOrNull</code> and <code>formatQuerySingleLineOrNull</code> functions, which will return NULL if the query cannot be parsed.