v.23.11Improvement

Fixed Query String Handling and Added OrNull Variants in formatQuery Functions

Fixed handling of non-const query strings in functions formatQuery/ formatQuerySingleLine. Also added OrNull variants of both functions that return a NULL when a query cannot be parsed instead of throwing an exception. #56327 (Robert Schulze).
Improved handling of non-const query strings in the functions formatQuery and formatQuerySingleLine, with new OrNull variants that return NULL on parse failure instead of raising exceptions.

Why it matters

This feature enhances robustness and flexibility when formatting queries by fixing issues with non-constant query strings. The OrNull 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.