Commit c3616bc
fix(driver-sql): an unknown $select column must not zero the result set
find() swallowed any "no such column" error into an empty array. A projected
$select naming a column the table lacks (e.g. a generic list view auto-
requesting status/due_date/image on an object without them) then made the
WHOLE query return zero rows — reading to the UI as "no records exist" while
the data was actually there: a silent data-loss footgun.
When the failure came from the projection, retry once with SELECT * so the
real rows still come back (the phantom field is simply absent from each row).
Non-projection errors (unknown table, etc.) still surface as before. The
engine's unknown-field filter is the first line of defense, but it only fires
when the object's schema is populated in the registry; this driver backstop
holds even when it isn't (notably the cloud multi-tenant runtime).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 05717ed commit c3616bc
2 files changed
Lines changed: 75 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
52 | 73 | | |
53 | 74 | | |
54 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
367 | 393 | | |
368 | 394 | | |
369 | 395 | | |
| |||
372 | 398 | | |
373 | 399 | | |
374 | 400 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | 401 | | |
394 | 402 | | |
395 | 403 | | |
396 | 404 | | |
397 | | - | |
| 405 | + | |
398 | 406 | | |
399 | 407 | | |
400 | | - | |
401 | | - | |
402 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
403 | 433 | | |
404 | | - | |
405 | 434 | | |
406 | 435 | | |
407 | 436 | | |
| |||
0 commit comments