Commit e82f868
committed
fix: looseEqual(null, null) returned true, CTE inlining missed distinct/windows
Two SQL correctness bugs:
1. looseEqual() fell through to `return a === b` for nulls, so
null===null was true. This broke simple CASE: `CASE NULL WHEN NULL
THEN 'hit' END` incorrectly matched. Added null/undefined guard
at top of looseEqual — NULL is never equal to anything per SQL.
2. CTE inlining guard didn't check for distinct or window functions.
A CTE like `WITH t AS (SELECT DISTINCT ...)` would be inlined,
silently dropping the DISTINCT/window semantics. Added guards.1 parent 1a5edc2 commit e82f868
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
| 185 | + | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
0 commit comments