Skip to content

Commit

Permalink
executor/infoschema_reader.go: skip the unidentifiable table-attribut…
Browse files Browse the repository at this point in the history
…es (#34129) (#34271)

close #33665
  • Loading branch information
ti-srebot authored Apr 28, 2022
1 parent d08e21f commit 1315e32
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion executor/infoschema_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2792,6 +2792,15 @@ func (e *memtableRetriever) setDataForAttributes(ctx sessionctx.Context) error {
"end_key": "7480000000000000ff3a5f720000000000fa",
}),
},
{
ID: "invalidIDtest",
Labels: []label.Label{{Key: "merge_option", Value: "allow"}, {Key: "db", Value: "test"}, {Key: "table", Value: "test_label"}},
RuleType: "key-range",
Data: convert(map[string]interface{}{
"start_key": "7480000000000000ff395f720000000000fa",
"end_key": "7480000000000000ff3a5f720000000000fa",
}),
},
}
err = nil
})
Expand All @@ -2803,7 +2812,8 @@ func (e *memtableRetriever) setDataForAttributes(ctx sessionctx.Context) error {
skip := true
dbName, tableName, err := checkRule(rule)
if err != nil {
return err
logutil.BgLogger().Warn("check table-rule failed", zap.String("ID", rule.ID), zap.Error(err))
continue
}
if tableName != "" && dbName != "" && (checker == nil || checker.RequestVerification(ctx.GetSessionVars().ActiveRoles, dbName, tableName, "", mysql.SelectPriv)) {
skip = false
Expand Down

0 comments on commit 1315e32

Please sign in to comment.