vitessio/vitess · error

err

Error message

err

What it means

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.

Source

Thrown at go/vt/vtgate/planbuilder/operators/info_schema_planning.go:54

// what keyspace the query go to, because we don't see normalized literal values
type InfoSchemaRouting struct {
	SysTableTableSchema []sqlparser.Expr
	SysTableTableName   map[string]sqlparser.Expr
	Table               *QueryTable

	seenPredicates []sqlparser.Expr
}

func (isr *InfoSchemaRouting) UpdateRoutingParams(ctx *plancontext.PlanningContext, rp *engine.RoutingParameters) {
	rp.SysTableTableSchema = nil
	for _, expr := range isr.SysTableTableSchema {
		eexpr, err := evalengine.Translate(expr, &evalengine.Config{
			Collation:     collations.SystemCollation.Collation,
			ResolveColumn: NotImplementedSchemaInfoResolver,
			Environment:   ctx.VSchema.Environment(),
		})
		if err != nil {
			panic(err)
		}
		rp.SysTableTableSchema = append(rp.SysTableTableSchema, eexpr)
	}

	rp.SysTableTableName = make(map[string]evalengine.Expr, len(isr.SysTableTableName))
	for k, expr := range isr.SysTableTableName {
		eexpr, err := evalengine.Translate(expr, &evalengine.Config{
			Collation:     collations.SystemCollation.Collation,
			ResolveColumn: NotImplementedSchemaInfoResolver,
			Environment:   ctx.VSchema.Environment(),
		})
		if err != nil {
			panic(err)
		}

		rp.SysTableTableName[k] = eexpr
	}
}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Simplify predicates on system tables to plain string comparisons against TABLE_SCHEMA / TABLE_NAME literals
  2. Use explicit string literals (no functions or complex expressions) for the schema/table names in WHERE clauses
  3. Inspect the inner error (panic message carries it) for the unsupported construct and remove it
  4. File a Vitess issue if a simple predicate still fails to translate

Example fix

// before
SELECT * FROM information_schema.tables WHERE UPPER(table_schema) = DATABASE();
// after
SELECT * FROM information_schema.tables WHERE table_schema = 'mykeyspace';
Defensive patterns

Strategy: validation

Validate before calling

// Prefer literal schema names in system-table predicates
// Good: WHERE table_schema = 'ks'
// Avoid: WHERE table_schema = DATABASE() or functions wrapping the column
func schemaPredicateIsLiteral(where sqlparser.Expr) bool {
  cmp, ok := where.(*sqlparser.ComparisonExpr)
  if !ok { return false }
  _, isCol := cmp.Left.(*sqlparser.ColName)
  _, isLit := cmp.Right.(*sqlparser.Literal)
  return isCol && isLit
}

Try / catch

defer func() {
  if r := recover(); r != nil {
    log.Warn("info_schema routing translation panicked", slog.Any("panic", r))
  }
}()

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/e0c6296f7ee2321c. Report an issue: GitHub.