Skip to content

Commit 95289f1

Browse files
committed
fix nil pointer
1 parent 1c117ef commit 95289f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/memo/rel_props.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func (m *Memo) statsForRel(ctx *sql.Context, rel RelExpr) sql.Statistic {
360360
leftRows := n.Left.RelProps.GetStats().RowCount()
361361
if n.Injective && leftRows < card {
362362
injective = true
363-
if leftRows < smallestLeft.RowCount() {
363+
if smallestLeft == nil || leftRows < smallestLeft.RowCount() {
364364
smallestLeft = n.Left.RelProps.GetStats()
365365
}
366366
}

0 commit comments

Comments
 (0)