nom-sql icon indicating copy to clipboard operation
nom-sql copied to clipboard

`is null` is not an equivalent of `= null`

Open nickelc opened this issue 7 years ago • 1 comments

i stumbled across this line.

would consumers ever need to know about "IS NULL" vs. "= NULL"?

select 1 from t where id is null
select 1 from t where id = null

The result of parsing these queries is the same but is null is not an equivalent of = null. The latter query actually returns "wrong" results. https://stackoverflow.com/questions/9581745/sql-is-null-and-null

nickelc avatar Sep 13 '18 19:09 nickelc

Thanks, I'll take a look at changing this. Should just be a matter of emitting an Operator::Is instead of Operator::Equals, I think.

ms705 avatar Sep 14 '18 16:09 ms705