Skip to content
Snippets Groups Projects
Commit 9c6c4483 authored by AKhatskevich's avatar AKhatskevich Committed by Kirill Yukhin
Browse files

sql: fix fk set null clause

After changing behavior of the `IS` operator (#b3a3ddb5),
`SET NULL` was rewritten to use `EQ` instead. Which doesn't respect
NULLs.

This commit fixes the null related behavior by emitting logical
constructions equivalent for this case to old `IS`.
The new expression works differently than old `IS` for nulls, however
the difference doesn't change anything, because matched rows are then
searched in a child table with `EQ` expression which do not match nulls.
Before:
`oldval` old_is `newval`
Now:
`oldval` is_null or (`newval` is_not_null and `oldval` eq `newval`)

Closes #3645
parent b9945325
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment