Description
For a conditional expression, we can not partially fold the constant inside it's children. For example if c1 or c2 is not null, the last branch should be never hit.
SELECT COALESCE(c1, c2, 1/0);
Besides, for CaseWhen and If, we should mark it as foldable if it's children are foldable. It is safe since the both non-codegen and codegen code path have already respected the evaluation order.