Compare commits

..

1 Commits

Author SHA1 Message Date
Cursor Agent
57ed82e121 Fix: Handle unrecognized child type in VisitPrimary and remove no-op boolean expressions 2026-03-11 09:25:08 +00:00
2 changed files with 5 additions and 3 deletions

View File

@@ -330,6 +330,9 @@ func (v *filterExpressionVisitor) VisitPrimary(ctx *grammar.PrimaryContext) any
v.errors = append(v.errors, fmt.Sprintf("unsupported value type: %s", valCtx.GetText()))
return ""
}
} else {
// Child is neither KeyContext nor ValueContext, return empty condition
return ""
}
cond, err := v.conditionBuilder.ConditionFor(context.Background(), v.fullTextColumn, qbtypes.FilterOperatorRegexp, FormatFullTextSearch(searchText), v.builder, v.startNs, v.endNs)
if err != nil {

View File

@@ -259,15 +259,14 @@ func (c *conditionBuilder) ConditionFor(
// immidiately return
return condition, nil
case telemetrytypes.FieldContextResource, telemetrytypes.FieldContextAttribute:
buildExistCondition = buildExistCondition && true
// pass; buildExistCondition already has the correct value
case telemetrytypes.FieldContextBody:
// Querying JSON fields already account for Nullability of fields
// so additional exists checks are not needed
if querybuilder.BodyJSONQueryEnabled {
return condition, nil
}
buildExistCondition = buildExistCondition && true
// pass; buildExistCondition already has the correct value
}
if buildExistCondition {