From 34a0edd04e3dff08e888277daed412f55f4d95a5 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Tue, 25 May 2021 17:08:26 +0800 Subject: [PATCH] address comment --- executor/point_get.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/executor/point_get.go b/executor/point_get.go index 2642fa6a574cc..ddfa32f180dc5 100644 --- a/executor/point_get.go +++ b/executor/point_get.go @@ -369,6 +369,10 @@ func (e *PointGetExecutor) get(ctx context.Context, key kv.Key) ([]byte, error) // fallthrough to snapshot get. } + // Global temporary table is always empty, so no need to send the request. + if e.tblInfo.TempTableType == model.TempTableGlobal { + return nil, nil + } lock := e.tblInfo.Lock if lock != nil && (lock.Tp == model.TableLockRead || lock.Tp == model.TableLockReadOnly) { if e.ctx.GetSessionVars().EnablePointGetCache { @@ -380,10 +384,6 @@ func (e *PointGetExecutor) get(ctx context.Context, key kv.Key) ([]byte, error) return val, nil } } - // Global temporary table is always empty, so no need to send the request. - if e.tblInfo.TempTableType == model.TempTableGlobal { - return nil, nil - } // if not read lock or table was unlock then snapshot get return e.snapshot.Get(ctx, key) }