Repository navigation
Commit 89fe8bd
extract(): keep all-NULL rows unlinked even with a pre-existing NULL lookup row
Follow-up to the #186 fix: skipping the all-NULL combination in the lookup
INSERT is not enough on its own. When extract() reuses a lookup table that
already contains an all-NULL row (e.g. one written by an older sqlite-utils
version or created manually), the IS-based foreign-key UPDATE would still
match that row and link all-NULL source rows to it.
The UPDATE now carries a trailing `WHERE NOT (<col> IS NULL AND ...)` so
all-NULL source rows are never assigned a foreign key and keep the NULL that
the freshly-added column starts with, regardless of the lookup table's
existing contents.
Adds test_extract_all_null_stays_null_with_preexisting_null_lookup_row.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>1 parent 2ba6eb1 commit 89fe8bd
2 files changed
Lines changed: 35 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2210 | 2210 | | |
2211 | 2211 | | |
2212 | 2212 | | |
2213 | | - | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2214 | 2217 | | |
2215 | | - | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2219 | 2222 | | |
2220 | 2223 | | |
2221 | 2224 | | |
| |||
2225 | 2228 | | |
2226 | 2229 | | |
2227 | 2230 | | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
2228 | 2237 | | |
2229 | 2238 | | |
2230 | 2239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
241 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
0 commit comments