Error when dolt_diff_stat filter names a missing table - #2001
Conversation
Match Dolt: when a table_name filter is present and that table exists on neither the from nor the to catalog, return SQLITE_ERROR with "table not found: <name>" instead of an empty result set. dolt_diff_summary keeps the empty-result behavior, which is also what Dolt does for summary. A table that exists on only one side (added or dropped) still produces stats.
Compare DoltLite against Dolt for: - missing table filter (error) - missing filter over a real data change (error) - filter name absent on both sides after drop + empty commit (error) - bad from/to refs (error) - dolt_diff_summary missing filter (empty success on both) Uses the existing oracle_error exit-code contract so crashes are not scored as matching Dolt rejections.
DoltLite source coverage
Merged 165 pooled raw profiles from the distributed Linux correctness jobs. Per-file coverage (91 files)
|
DoltLite performance vs PR base
blobpk details
compositepk details
int details
textpk details
vc details
All relative performance gates passed. |
|
SummaryCoverage spans normal and edge-case table comparison behavior, including created, dropped, renamed, modified, and multi-table data, as well as invalid or incomplete references and missing or unusual table filters. It also checks error recovery, isolation between concurrent or repeated queries, stable snapshots, and compatibility of summary results, with all exercised behaviors healthy. Safe to merge — the exercised comparison, validation, error-handling, state-isolation, and snapshot behaviors show no PR-attributable regressions or failures. Any environment limitation is not a product failure and is a flag for later rather than a merge blocker. Tests run by Ito
Tip Reply with @itoqa to send us feedback on this test run. |

Summary
Match Dolt's
dolt_diff_statbehavior for an unknown table filter.Dolt (
getDiffStatNodeFromDeltaindolt_diff_stat.go):DoltLite previously accepted the filter blindly, then produced no rows when both catalog lookups missed — status 0, empty result. That looked like a valid empty diff.
Fix
After loading both catalogs in
dstFilter, if a table filter is set and the name is absent from both sides, setzErrMsgtotable not found: %sand returnSQLITE_ERROR.Not changed:
dolt_diff_summarystill returns empty for a missing filter name (matches live Dolt).Test plan
test/doltlite_diff.sh— 42/42, including newdiff_stat_no_such_tablerows_deleted(exists on from side only)dolt_diff_stat(..., 'doesnotexist')→table not found: doesnotexist