Skip to content

Commit e9c2ecf

Browse files
author
James Cor
committed
clean up
1 parent c9f859b commit e9c2ecf

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

sql/analyzer/replace_sort.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ func replaceIdxSortHelper(ctx *sql.Context, scope *plan.Scope, node sql.Node, so
5757
return n, transform.NewTree, nil
5858
}
5959

60-
// TODO: need to check for indexOrder = None?
6160
// if the index is not reversible, do nothing
62-
if oi, ok := lookup.Index.(sql.OrderedIndex); ok && !oi.Reversible() {
61+
if oi, ok := lookup.Index.(sql.OrderedIndex); ok && (!oi.Reversible() || oi.Order() == sql.IndexOrderNone) {
6362
return n, transform.SameTree, nil
6463
}
6564
lookup = sql.NewIndexLookup(

sql/plan/join.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ type JoinNode struct {
291291
CommentStr string
292292
ScopeLen int
293293
UsingCols []string
294-
295294
IsReversed bool
296295
}
297296

sql/rowexec/merge_join.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ func newMergeJoinIter(ctx *sql.Context, b sql.NodeExecBuilder, j *plan.JoinNode,
8282
parentLen: len(row) - j.ScopeLen,
8383
leftRowLen: len(j.Left().Schema()),
8484
rightRowLen: len(j.Right().Schema()),
85-
86-
isReversed: j.IsReversed,
85+
isReversed: j.IsReversed,
8786
}
8887
return iter, nil
8988
}
@@ -116,6 +115,8 @@ type mergeJoinIter struct {
116115
// leftMatched indicates whether the current left in |i.fullRow|
117116
// has satisfied the join condition.
118117
leftMatched bool
118+
// isReversed indicates if this join is over two reversed indexes.
119+
isReversed bool
119120

120121
// lifecycle maintenance
121122
init bool
@@ -127,8 +128,6 @@ type mergeJoinIter struct {
127128
leftRowLen int
128129
rightRowLen int
129130
parentLen int
130-
131-
isReversed bool
132131
}
133132

134133
var _ sql.RowIter = (*mergeJoinIter)(nil)

0 commit comments

Comments
 (0)