{"record":{"id":"ee6c307d5a674543","repo":"vitessio/vitess","slug":"err-ee6c30","errorCode":null,"errorMessage":"err","messagePattern":"err","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtgate/planbuilder/operators/filter.go","lineNumber":117,"sourceCode":"func (f *Filter) GetOrdering(ctx *plancontext.PlanningContext) []OrderBy {\n\treturn f.Source.GetOrdering(ctx)\n}\n\nfunc (f *Filter) planOffsets(ctx *plancontext.PlanningContext) Operator {\n\tcfg := &evalengine.Config{\n\t\tResolveType: ctx.TypeForExpr,\n\t\tCollation:   ctx.SemTable.Collation,\n\t\tEnvironment: ctx.VSchema.Environment(),\n\t}\n\n\tpredicate := sqlparser.AndExpressions(f.Predicates...)\n\trewritten := useOffsets(ctx, predicate, f)\n\teexpr, err := evalengine.Translate(rewritten, cfg)\n\tif err != nil {\n\t\tif strings.HasPrefix(err.Error(), evalengine.ErrTranslateExprNotSupported) {\n\t\t\tpanic(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, \"%s: %s\", evalengine.ErrTranslateExprNotSupported, sqlparser.String(predicate)))\n\t\t}\n\t\tpanic(err)\n\t}\n\n\tf.PredicateWithOffsets = eexpr\n\treturn nil\n}\n\nfunc (f *Filter) ShortDescription() string {\n\treturn sqlparser.String(sqlparser.AndExpressions(f.Predicates...))\n}\n\nfunc (f *Filter) setTruncateColumnCount(offset int) {\n\tf.ResultColumns = offset\n}\n\nfunc (f *Filter) getTruncateColumnCount() int {\n\treturn f.ResultColumns\n}\n","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtgate/planbuilder/operators/filter.go#L99-L135","documentation":"This is the same code path as the UNIMPLEMENTED case, but for any other translation failure: if evalengine.Translate of the rewritten filter predicate fails with an error NOT prefixed by ErrTranslateExprNotSupported, planOffsets panics with the raw error. These are hard translation errors (malformed expression, unexpected AST node, internal type/encoding problems) rather than recognized unsupported constructs.","triggerScenarios":"evalengine.Translate returns a non-NotSupported error during filter offset planning - e.g. internal AST shapes the translator cannot handle, collation/environment issues, or bugs where useOffsets produced an invalid expression tree.","commonSituations":"Planner bugs with exotic queries (unions inside derived tables feeding filters); collation misconfiguration in the vschema; regression after upgrading Vitess where previously-working predicates hit a new code path.","solutions":["Capture the full panic/error message and query; reduce the query to a minimal reproducer","Rewrite the query to avoid the failing predicate shape (e.g. split the query, use a simpler WHERE clause, or restructure the join)","Report the reproducer to the Vitess project - a raw panic here indicates a planner/translator bug"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"defer func() {\n\tif r := recover(); r != nil {\n\t\terr = vterrors.Errorf(vtrpcpb.Code_INTERNAL, \"filter offset planning failed: %v\", r)\n\t}\n}()","preventionTips":["Catch raw evalengine.Translate failures in CI by running the full query suite against Vitess","Simplify predicates that involve unions in derived tables feeding filters","Pin known-good Vitess versions and read upgrade notes for filter planning changes"],"tags":["vitess","evalengine","internal-error","panic"],"backgroundTag":"internal-planner-panic","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}