vitessio/vitess · error

unsupported qualifier for '*' expression

Error message

unsupported qualifier for '*' expression

What it means

buildTablePlan rejects a StarExpr that carries a table qualifier (e.g. 'select t.* from t'). Only an unqualified '*' is supported in vreplication filter rules, since the plan builder maps the wildcard onto the single target table.

Source

Thrown at go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go:245

	case filter == ExcludeStr:
		return nil, nil
	}
	sel, fromTable, err := analyzeSelectFrom(query, parser)
	if err != nil {
		return nil, planError(err, query)
	}
	sendRule := &binlogdatapb.Rule{
		Match: fromTable,
	}

	if expr, ok := sel.SelectExprs.Exprs[0].(*sqlparser.StarExpr); ok {
		// If it's a "select *", we return a partial plan, and complete
		// it when we get back field info from the stream.
		if len(sel.SelectExprs.Exprs) != 1 {
			return nil, planError(errors.New("unsupported mix of '*' and columns"), sqlparser.String(sel))
		}
		if !expr.TableName.IsEmpty() {
			return nil, planError(errors.New("unsupported qualifier for '*' expression"), sqlparser.String(expr))
		}
		sendRule.Filter = query
		tablePlan := &TablePlan{
			TargetName:       tableName,
			SendRule:         sendRule,
			Lastpk:           lastpk,
			Stats:            stats,
			ConvertCharset:   rule.ConvertCharset,
			ConvertIntToEnum: rule.ConvertIntToEnum,
			CollationEnv:     collationEnv,
			WorkflowConfig:   workflowConfig,
		}

		return tablePlan, nil
	}

	tpb := &tablePlanBuilder{
		name: sqlparser.NewIdentifierCS(tableName),

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Replace 't.*' with bare '*' in the filter rule
  2. Or list the columns explicitly: 'select col1, col2 from t'
  3. Re-create the stream with the corrected filter rule

Example fix

// before
"filter": "select t.* from t"
// after
"filter": "select * from t"
Defensive patterns

Strategy: validation

Validate before calling

stmt, _ := parser.Parse(filterQuery)
sel := stmt.(*sqlparser.Select)
e0 := sel.SelectExprs.Exprs[0]
if star, ok := e0.(*sqlparser.StarExpr); ok && !star.TableName.IsEmpty() {
    return errors.New("qualified '*' not allowed in filter rule")
}

Prevention

When it happens

Trigger: A vreplication filter rule whose query uses qualified wildcards like 'select t.* from t' or 'select db.t.* from t'.

Common situations: Filter rules copied from application SQL that used qualified stars; multi-table queries adapted to a single-table rule.

Related errors


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