{"record":{"id":"e0c6296f7ee2321c","repo":"vitessio/vitess","slug":"err-e0c629","errorCode":null,"errorMessage":"err","messagePattern":"err","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtgate/planbuilder/operators/info_schema_planning.go","lineNumber":54,"sourceCode":"// what keyspace the query go to, because we don't see normalized literal values\ntype InfoSchemaRouting struct {\n\tSysTableTableSchema []sqlparser.Expr\n\tSysTableTableName   map[string]sqlparser.Expr\n\tTable               *QueryTable\n\n\tseenPredicates []sqlparser.Expr\n}\n\nfunc (isr *InfoSchemaRouting) UpdateRoutingParams(ctx *plancontext.PlanningContext, rp *engine.RoutingParameters) {\n\trp.SysTableTableSchema = nil\n\tfor _, expr := range isr.SysTableTableSchema {\n\t\teexpr, err := evalengine.Translate(expr, &evalengine.Config{\n\t\t\tCollation:     collations.SystemCollation.Collation,\n\t\t\tResolveColumn: NotImplementedSchemaInfoResolver,\n\t\t\tEnvironment:   ctx.VSchema.Environment(),\n\t\t})\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trp.SysTableTableSchema = append(rp.SysTableTableSchema, eexpr)\n\t}\n\n\trp.SysTableTableName = make(map[string]evalengine.Expr, len(isr.SysTableTableName))\n\tfor k, expr := range isr.SysTableTableName {\n\t\teexpr, err := evalengine.Translate(expr, &evalengine.Config{\n\t\t\tCollation:     collations.SystemCollation.Collation,\n\t\t\tResolveColumn: NotImplementedSchemaInfoResolver,\n\t\t\tEnvironment:   ctx.VSchema.Environment(),\n\t\t})\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\trp.SysTableTableName[k] = eexpr\n\t}\n}","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtgate/planbuilder/operators/info_schema_planning.go#L36-L72","documentation":"A panic in UpdateRoutingParams for information_schema queries: the planner translates SysTableTableSchema expressions with the evalengine and panics if Translate fails. Translation failures here mean an expression used against a system table (e.g. a predicate on TABLE_SCHEMA) could not be converted to an evaluatable expression, so routing params cannot be built.","triggerScenarios":"A query on an information_schema (or other system) table includes an expression in the schema/table-name routing filters that evalengine.Translate cannot handle with the given Config (system collation, NotImplementedSchemaInfoResolver column resolution).","commonSituations":"Queries against information_schema with unusual predicates or expressions on TABLE_SCHEMA/TABLE_NAME, unsupported functions or collation-sensitive expressions in those filters; typically surfaced when applications using ORMs introspect metadata through Vitess.","solutions":["Simplify predicates on system tables to plain string comparisons against TABLE_SCHEMA / TABLE_NAME literals","Use explicit string literals (no functions or complex expressions) for the schema/table names in WHERE clauses","Inspect the inner error (panic message carries it) for the unsupported construct and remove it","File a Vitess issue if a simple predicate still fails to translate"],"exampleFix":"// before\nSELECT * FROM information_schema.tables WHERE UPPER(table_schema) = DATABASE();\n// after\nSELECT * FROM information_schema.tables WHERE table_schema = 'mykeyspace';","handlingStrategy":"validation","validationCode":"// Prefer literal schema names in system-table predicates\n// Good: WHERE table_schema = 'ks'\n// Avoid: WHERE table_schema = DATABASE() or functions wrapping the column\nfunc schemaPredicateIsLiteral(where sqlparser.Expr) bool {\n  cmp, ok := where.(*sqlparser.ComparisonExpr)\n  if !ok { return false }\n  _, isCol := cmp.Left.(*sqlparser.ColName)\n  _, isLit := cmp.Right.(*sqlparser.Literal)\n  return isCol && isLit\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n  if r := recover(); r != nil {\n    log.Warn(\"info_schema routing translation panicked\", slog.Any(\"panic\", r))\n  }\n}()","preventionTips":["Use plain string literals when filtering information_schema by schema/table","Avoid functions and expressions around TABLE_SCHEMA in metadata queries","If an ORM introspects metadata, test those queries against Vitess before rollout","File a Vitess bug for any simple literal predicate that still panics"],"tags":["go","panic","routing","information-schema"],"backgroundTag":"sys-table-routing-panic","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}