Skip to content

Commit

Permalink
opt: mark SimplifyRootOrdering as an essential rule
Browse files Browse the repository at this point in the history
The unoptimized query oracle, which disables rules, found a bug in the
execution engine that is only possible to hit if the
`SimplifyRootOrdering` rule is disabled (see cockroachdb#84191). Until the bug is
fixed, we mark the rule as essential so that it is not disabled by these
tests.

Fixes cockroachdb#84067

Release note: None
  • Loading branch information
mgartner committed Jul 11, 2022
1 parent 86e007d commit 37ed376
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/sql/opt/xform/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,10 @@ func (o *Optimizer) disableRules(probability float64) {
// supports distinct on an empty column set.
int(opt.EliminateDistinctNoColumns),
int(opt.EliminateEnsureDistinctNoColumns),
// TODO(#84191): Needed to remove the same column and direction
// appearing consecutively in ordering columns, which can cause
// incorrect results until #84191 is addressed.
int(opt.SimplifyRootOrdering),
)

for i := opt.RuleName(1); i < opt.NumRuleNames; i++ {
Expand Down

0 comments on commit 37ed376

Please sign in to comment.