sqlgg icon indicating copy to clipboard operation
sqlgg copied to clipboard

track projection nullability through expressions

Open cyberhuman opened this issue 6 years ago • 2 comments

Since we now have a basic support for NULLs I imagine it must be pretty easy to propagate information about nullability through expressions. The rules are quite simple: other than functions/operators specifically operating on nulls, everything else should be nullable if one of the operands is nullable. NULLIF(X, Y) is always nullable IFNULL(Xn... ) and COALESCE(Xn...) are nullable if every Xn is nullable IS [NOT] DISTINCT FROM and <=> are not nullable all (?) aggregate functions except for COUNT() are nullable.

cyberhuman avatar Sep 20 '19 11:09 cyberhuman

The current state is all works as it needs besides <=>

jongleb avatar Sep 27 '24 13:09 jongleb

I like the OP "pretty easy" claim :joy_cat:

ygrek avatar Sep 27 '24 15:09 ygrek

t turned out that it wasn't just that, there were still small inaccuracies in the functions https://github.com/ygrek/sqlgg/pull/228

jongleb avatar Aug 20 '25 04:08 jongleb