$ super -s -c "values exists(values null);"
false
Details
Repro is with super commit 1b7ad2a.
The SQL equivalent returns true, since EXISTS tests whether a subquery/expression produces any row, and a NULL value is still a row (its value being NULL is irrelevant to whether it exists.)
$ psql postgres -c "SELECT EXISTS (SELECT NULL);"
exists
--------
t
(1 row)
Interestingly, using this exact same SQL with super does currently return true.
$ super -version
Version: v0.3.0-129-g1b7ad2acf
$ super -c "SELECT EXISTS (SELECT NULL);"
{"exists( select \n)":true}
We expect that as users learn SuperSQL they'll evolve/extend their legacy SQL queries into pipe-based equivalents, so this apparent different handling of the null in the values-based equivalent seems like a bug.
Details
Repro is with super commit 1b7ad2a.
The SQL equivalent returns
true, sinceEXISTStests whether a subquery/expression produces any row, and aNULLvalue is still a row (its value beingNULLis irrelevant to whether it exists.)Interestingly, using this exact same SQL with
superdoes currently returntrue.We expect that as users learn SuperSQL they'll evolve/extend their legacy SQL queries into pipe-based equivalents, so this apparent different handling of the
nullin thevalues-based equivalent seems like a bug.