Skip to content

Commit

Permalink
TableDual is reused in plan cache
Browse files Browse the repository at this point in the history
  • Loading branch information
eurekaka committed Sep 3, 2018
1 parent 7b2cf0f commit 0a603d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plan/find_best_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (ds *DataSource) findBestTask(prop *requiredProp) (t task, err error) {

for _, path := range ds.possibleAccessPaths {
// if we already know the range of the scan is empty, just return a TableDual
if len(path.ranges) == 0 {
if len(path.ranges) == 0 && !ds.ctx.GetSessionVars().StmtCtx.UseCache {
dual := PhysicalTableDual{}.init(ds.ctx, ds.stats)
dual.SetSchema(ds.schema)
return &rootTask{
Expand Down

0 comments on commit 0a603d1

Please sign in to comment.