v.21.7Improvement
Add support for if function with Decimal and Int types
Add support for functionifwithDecimalandInttypes on its branches. This closes #20549. This closes #10142. #25283 (alexey-milovidov).
Why it matters
This feature resolves issues where theif function could not process expressions with differing Decimal and Int types in its branches, enhancing type compatibility and function flexibility for users.How to use it
Users can now use theif function with branches returning Decimal or Int types transparently without additional type casting. Example usage:SELECT if(condition, decimal_value, int_value) FROM table