Skip to content

Commit

Permalink
planner: fix ExtractColumnsAndCorColumnsFromExpressions caller didn't…
Browse files Browse the repository at this point in the history
… update its may-expanded cache slice. (#58240)

ref #51664
  • Loading branch information
AilinKid authored Dec 13, 2024
1 parent c1083de commit 5e8d1b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/planner/core/collect_column_stats_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func (c *columnStatsUsageCollector) addPredicateColumn(col *expression.Column, n
}

func (c *columnStatsUsageCollector) addPredicateColumnsFromExpressions(list []expression.Expression, needFullStats bool) {
cols := expression.ExtractColumnsAndCorColumnsFromExpressions(c.cols[:0], list)
for _, col := range cols {
c.cols = expression.ExtractColumnsAndCorColumnsFromExpressions(c.cols[:0], list)
for _, col := range c.cols {
c.addPredicateColumn(col, needFullStats)
}
}
Expand All @@ -122,7 +122,8 @@ func (c *columnStatsUsageCollector) updateColMap(col *expression.Column, related
}

func (c *columnStatsUsageCollector) updateColMapFromExpressions(col *expression.Column, list []expression.Expression) {
c.updateColMap(col, expression.ExtractColumnsAndCorColumnsFromExpressions(c.cols[:0], list))
c.cols = expression.ExtractColumnsAndCorColumnsFromExpressions(c.cols[:0], list)
c.updateColMap(col, c.cols)
}

func (c *columnStatsUsageCollector) collectPredicateColumnsForDataSource(ds *logicalop.DataSource) {
Expand Down

0 comments on commit 5e8d1b8

Please sign in to comment.