fix: stop three recurring errors on doc delete (#17685) (#17686)

Follow-up to #17526 ("Refactor: merge dataset scope graph"), which introduced two code paths that touch Infinity columns the deployed schema does not declare. This PR makes the runtime robust against the old schema while also adding the new column to the new schema so freshly created tables are correct.
This commit is contained in:
S
2026-08-16 06:55:51 +05:30
committed by GitHub
parent 554fb1133a
commit c6ba54bc72
14 changed files with 1140 additions and 35 deletions

View File

@@ -379,3 +379,24 @@ func TestLoadFieldMapping_EmptyNameDefaultsToInfinityMappingJSON(t *testing.T) {
t.Errorf("empty name + no file should yield empty maps; got a2a=%v r2a=%v", a2a, r2a)
}
}
func TestBuildFilterFromCondition_UnconstrainedFilter(t *testing.T) {
clmns := map[string]struct {
Type string
Default interface{}
}{
"id": {"Varchar", ""},
}
// empty condition yields "1=1"
if got := buildFilterFromCondition(map[string]interface{}{}, clmns); got != "1=1" {
t.Errorf("empty condition: got %q, want '1=1'", got)
}
// condition with nil or empty string values yields "1=1"
cond := map[string]interface{}{
"source_id": "",
"nil_field": nil,
}
if got := buildFilterFromCondition(cond, clmns); got != "1=1" {
t.Errorf("non-empty condition with blank values: got %q, want '1=1'", got)
}
}