Skip to content

Commit

Permalink
Improve table plan builder errors
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <mattalord@gmail.com>
  • Loading branch information
mattlord committed Aug 13, 2024
1 parent f2d5d1c commit 9cf65db
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func buildReplicatorPlan(source *binlogdatapb.BinlogSource, colInfoMap map[strin
}
tablePlan, err := buildTablePlan(tableName, rule, colInfos, lastpk, stats, source, collationEnv, parser)
if err != nil {
return nil, err
return nil, vterrors.Wrapf(err, "failed to build table replication plan for %s table", tableName)
}
if tablePlan == nil {
// Table was excluded.
Expand Down Expand Up @@ -598,7 +598,7 @@ func (tpb *tablePlanBuilder) analyzePK(cols []*ColumnInfo) error {
// TODO(shlomi): at some point in the futue we want to make this check stricter.
// We could be reading a generated column c1 which in turn selects some other column c2.
// We will want t oensure that `c2` is found in select list...
return fmt.Errorf("primary key column %v not found in select list", col)
return fmt.Errorf("primary key column %v not found in table's select filter or the TableMap event within the GTID", col)
}
if cexpr.operation != opExpr {
return fmt.Errorf("primary key column %v is not allowed to reference an aggregate expression", col)
Expand Down

0 comments on commit 9cf65db

Please sign in to comment.