Skip to content

Commit

Permalink
planner: check nil pointer in rule_result_reorder to avoid panic (#48100
Browse files Browse the repository at this point in the history
) (#48116)

close #45044
  • Loading branch information
ti-chi-bot committed Dec 12, 2023
1 parent 126cf52 commit 266d8f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions planner/core/rule_result_reorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (rs *resultReorder) extractHandleCol(lp LogicalPlan) *expression.Column {
switch x := lp.(type) {
case *LogicalSelection, *LogicalLimit:
handleCol := rs.extractHandleCol(lp.Children()[0])
if handleCol == nil {
return nil // fail to extract handle column from the child, just return nil.
}
if x.Schema().Contains(handleCol) {
// some Projection Operator might be inlined, so check the column again here
return handleCol
Expand Down

0 comments on commit 266d8f7

Please sign in to comment.