mirror of
https://github.com/allankoechke/turso.git
synced 2026-12-01 17:43:08 +00:00
In `t1 FULL JOIN t2 USING(a)`, a row can be missing from either table, so an unqualified `a` is t1.a when that is not NULL and t2.a otherwise. The value equals coalesce(t1.a, t2.a), but comparisons treat it like the column t1.a: it takes t1.a's affinity and collation. A user-written coalesce() has no affinity and can take its collation from any argument. With t1.a INTEGER and a row only in t2 whose a is the text '7', `a = 7` is true but `coalesce(t1.a, t2.a) = 7` is false. Add Expr::MergedColumn for this value, so code that handles user coalesce() calls cannot apply to it by accident. SQLite gets the same effect by marking its internal coalesce call with SQLITE_AFF_DEFER. Name binding creates the node in the next commits.
TODO