Commit 5ef9bb4
feat(vdbe): seek an INNER/LEFT rowid-join with a compound ON clause (B5b-2c)
The live inner-cursor seek (B5b-2a/2b) no longer requires the ipk equality to
be the entire `ON`. The `ON` is split into its top-level `AND` conjuncts and the
first conjunct that binds the inner table's INTEGER PRIMARY KEY to a plain outer
column drives the rowid seek (in either operand order); the full `ON` is still
re-evaluated against the assembled row after the seek, so any additional
conjunct (`… AND t.name = o.y`) simply filters the seeked row. This rides the
same superset invariant as the single-equality case and introduces no new
comparison semantics — the seek key still coerces through `to_i64` exactly as
the tree-walker's rowid seek does.
Deliberately does not extend to a secondary-index seek: `index_seek_rowids`
compares raw keys with the index collation and skips the comparison-affinity
that `o.x = t.k` applies, so routing it could silently drop a matching row
(a false negative that would not fall back) — that needs the tree-walker's
affinity machinery first and is left for a later step.
Verified VDBE-vs-tree-walker and vs sqlite3 3.50.4 (`tests/vdbe_live_cursor.rs`).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3be9101 commit 5ef9bb4
3 files changed
Lines changed: 72 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1195 | 1195 | | |
1196 | 1196 | | |
1197 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1198 | 1204 | | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1202 | 1211 | | |
1203 | 1212 | | |
1204 | 1213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2070 | 2070 | | |
2071 | 2071 | | |
2072 | 2072 | | |
2073 | | - | |
2074 | | - | |
2075 | | - | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
2076 | 2078 | | |
2077 | 2079 | | |
2078 | 2080 | | |
2079 | 2081 | | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | | - | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | 2082 | | |
2089 | 2083 | | |
2090 | 2084 | | |
| |||
2146 | 2140 | | |
2147 | 2141 | | |
2148 | 2142 | | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
2153 | 2150 | | |
2154 | | - | |
2155 | | - | |
2156 | | - | |
2157 | | - | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
2158 | 2161 | | |
2159 | | - | |
2160 | | - | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
2161 | 2190 | | |
2162 | 2191 | | |
2163 | 2192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
0 commit comments