Files
turso/sqlite/parser
Jussi Saurio 13854a23a4 sqlite: add merged USING column expressions
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.
2026-10-07 06:55:08 +03:00
..
…

TODO