v.20.3New Feature

Added isConstant Function for Constant Expression Checks

Added function isConstant. This function checks whether its argument is constant expression and returns 1 or 0. It is intended for development, debugging and demonstration purposes. #10198 (alexey-milovidov).
Added a new function isConstant that checks whether its argument is a constant expression and returns 1 if true, otherwise 0.

Why it matters

This function helps developers, debuggers, and users to identify if an expression is constant, aiding in query analysis, debugging, and demonstrations.

How to use it

Use the function isConstant by passing any expression as its argument. It will return 1 if the expression is constant, or 0 if it is not. Example:

SELECT isConstant(1 + 1); -- returns 1
SELECT isConstant(column_name); -- returns 0 if column_name is not constant