Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <disxiaofei@163.com>
  • Loading branch information
Yisaer committed Nov 28, 2022
1 parent 89f9eaa commit 4af70e7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions planner/core/find_best_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,11 +1062,14 @@ func (ds *DataSource) isPointGetPath(path *util.AccessPath) bool {
if len(path.Ranges) < 1 {
return false
}
if path.Index.HasPrefixIndex() {
return false
}
if !path.IsIntHandlePath && !path.Index.Unique {
return false
if path.Index != nil {
if path.Index.HasPrefixIndex() || !path.Index.Unique {
return false
}
} else {
if !path.IsIntHandlePath {
return false
}
}
idxColsLen := len(path.Index.Columns)
for _, ran := range path.Ranges {
Expand All @@ -1077,7 +1080,6 @@ func (ds *DataSource) isPointGetPath(path *util.AccessPath) bool {
allRangeIsPoint := true
for _, ran := range path.Ranges {
if !ran.IsPointNonNullable(ds.ctx) {
// unique indexes can have duplicated NULL rows so we cannot use PointGet if there is NULL
allRangeIsPoint = false
break
}
Expand Down

0 comments on commit 4af70e7

Please sign in to comment.