diff --git a/executor/builder.go b/executor/builder.go index d4270397eecd0..f60a7a78f5a52 100644 --- a/executor/builder.go +++ b/executor/builder.go @@ -3527,10 +3527,14 @@ func getPartitionKeyColOffsets(keyColIDs []int64, pt table.PartitionedTable) []i keyColOffsets[i] = offset } - pe, err := pt.(interface { - PartitionExpr() (*tables.PartitionExpr, error) - }).PartitionExpr() - if err != nil { + t, ok := pt.(interface { + PartitionExpr() *tables.PartitionExpr + }) + if !ok { + return nil + } + pe := t.PartitionExpr() + if pe == nil { return nil }