ms705 / nom-sql

Rust SQL parser written using nom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

nickelc opened this issue · 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

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.