From e1409774cbea882ecbc492df42b25c5085fe2b3c Mon Sep 17 00:00:00 2001 From: you06 Date: Tue, 12 Jan 2021 19:24:02 +0800 Subject: [PATCH 1/9] add case Signed-off-by: you06 --- session/pessimistic_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index b8271eb18b2d5..4a2a871034879 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -2451,3 +2451,37 @@ func (s *testPessimisticSuite) TestIssue21498(c *C) { tk.MustQuery("select * from t1").Check(testkit.Rows("5 12 100")) } } + +func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { + tk := testkit.NewTestKitWithInit(c, s.store) + //tk2 := testkit.NewTestKitWithInit(c, s.store) + + tk.MustExec("create table t (id int primary key, v int, index iv (v), vv int)") + tk.MustExec("insert into t values(1, 1, 1), (2, 2, 2)") + + tk.MustExec("set tidb_enable_amend_pessimistic_txn = 1") + //tk.MustExec("begin pessimistic") + tk.MustExec("prepare select_stmt from 'select * from t where v = ?'") + tk.MustExec("prepare select_update_stmt from 'select * from t where v = ? for update'") + tk.MustExec("prepare update_stmt from 'update t set vv = 3 where v = ?'") + tk.MustExec("set @v = 1") + // generate plan cache + tk.MustQuery("execute select_stmt using @v").Check(testkit.Rows("1 1 1")) + tk.MustQuery("execute select_update_stmt using @v").Check(testkit.Rows("1 1 1")) + tk.MustExec("execute update_stmt using @v") + + //tk2.MustExec("alter table t drop index iv") + //tk2.MustExec("update t set v = 3 where v = 2") + + tk.MustExec("set @v = 2") + //tk.MustQuery("execute select_stmt using @v").Check(testkit.Rows("2 2 2")) + //tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) + // current read should update cache since schema is changed + //tk.MustQuery("execute select_update_stmt using @v").Check(testkit.Rows("1 2 2")) + //tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + tk.MustExec("execute update_stmt using @v") + //tk.CheckExecResult(0, 0) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) + + //tk.MustExec("commit") +} From 996274ab24b0e61b0597f92076964204ebfef500 Mon Sep 17 00:00:00 2001 From: you06 Date: Tue, 12 Jan 2021 20:43:54 +0800 Subject: [PATCH 2/9] add logs Signed-off-by: you06 --- executor/compiler.go | 4 ++++ planner/core/common_plans.go | 14 ++++++++++++++ planner/optimize.go | 3 +++ session/pessimistic_test.go | 5 +++-- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/executor/compiler.go b/executor/compiler.go index bb0f5274a159e..4cae1f76eb27e 100644 --- a/executor/compiler.go +++ b/executor/compiler.go @@ -16,6 +16,9 @@ package executor import ( "context" + "github.com/pingcap/tidb/util/logutil" + "go.uber.org/zap" + "github.com/opentracing/opentracing-go" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" @@ -60,6 +63,7 @@ func (c *Compiler) Compile(ctx context.Context, stmtNode ast.StmtNode) (*ExecStm stmtNode = plannercore.TryAddExtraLimit(c.Ctx, stmtNode) finalPlan, names, err := planner.Optimize(ctx, c.Ctx, stmtNode, infoSchema) + logutil.BgLogger().Info("MYLOG Compile", zap.String("final plan", finalPlan.ExplainInfo()), zap.Error(err)) if err != nil { return nil, err } diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 6761b27baed1f..1f9a5b097c1ec 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -204,6 +204,8 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont prepared := preparedObj.PreparedAst vars.StmtCtx.StmtType = prepared.StmtType + logutil.BgLogger().Info("MYLOG optimize prepared plan, p1") + paramLen := len(e.PrepareParams) if paramLen > 0 { // for binary protocol execute, argument is placed in vars.PrepareParams @@ -234,6 +236,10 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont } } + logutil.BgLogger().Info("MYLOG optimize prepared plan, p2", + zap.Int64("prepare verion", prepared.SchemaVersion), + zap.Int64("schema version", is.SchemaMetaVersion())) + if prepared.SchemaVersion != is.SchemaMetaVersion() { // In order to avoid some correctness issues, we have to clear the // cached plan once the schema version is changed. @@ -250,6 +256,7 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont prepared.SchemaVersion = is.SchemaMetaVersion() } err := e.getPhysicalPlan(ctx, sctx, is, preparedObj) + logutil.BgLogger().Info("MYLOG optimize prepared plan, p3", zap.Error(err)) if err != nil { return err } @@ -278,6 +285,7 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, stmtCtx := sctx.GetSessionVars().StmtCtx prepared := preparedStmt.PreparedAst stmtCtx.UseCache = prepared.UseCache + logutil.Logger(ctx).Info("MYLOG getPhysicalPlan", zap.Bool("use cache", prepared.UseCache)) var cacheKey kvcache.Key if prepared.UseCache { cacheKey = NewPSTMTPlanCacheKey(sctx.GetSessionVars(), e.ExecID, prepared.SchemaVersion) @@ -300,6 +308,7 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, err := e.rebuildRange(plan) if err != nil { logutil.BgLogger().Debug("rebuild range failed", zap.Error(err)) + logutil.BgLogger().Info("MYLOG rebuild range failed", zap.Error(err)) goto REBUILD } if metrics.ResettablePlanCacheCounterFortTest { @@ -340,6 +349,7 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, err := e.rebuildRange(cachedVal.Plan) if err != nil { logutil.BgLogger().Debug("rebuild range failed", zap.Error(err)) + logutil.BgLogger().Info("MYLOG rebuild range failed", zap.Error(err)) goto REBUILD } err = e.setFoundInPlanCache(sctx, true) @@ -358,10 +368,14 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, } break } + + logutil.Logger(ctx).Info("MYLOG getPhysicalPlan cache key not exist") } } + logutil.Logger(ctx).Info("MYLOG getPhysicalPlan before rebuild") REBUILD: + logutil.Logger(ctx).Info("MYLOG getPhysicalPlan rebuild") stmt := TryAddExtraLimit(sctx, prepared.Stmt) p, names, err := OptimizeAstNode(ctx, sctx, stmt, is) if err != nil { diff --git a/planner/optimize.go b/planner/optimize.go index 7f0b126d75c16..82155875f134a 100644 --- a/planner/optimize.go +++ b/planner/optimize.go @@ -121,6 +121,7 @@ func Optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in } bestPlan, names, _, err := optimize(ctx, sctx, node, is) + logutil.BgLogger().Info("MYLOG got optimize", zap.String("final plan", bestPlan.ExplainInfo()), zap.Error(err)) if err != nil { return nil, nil, err } @@ -254,6 +255,7 @@ func optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in // Handle the execute statement. if execPlan, ok := p.(*plannercore.Execute); ok { err := execPlan.OptimizePreparedPlan(ctx, sctx, is) + logutil.BgLogger().Info("MYLOG optimize", zap.Error(err), zap.Stack("trace")) return p, p.OutputNames(), 0, err } @@ -419,6 +421,7 @@ func OptimizeExecStmt(ctx context.Context, sctx sessionctx.Context, } if execPlan, ok := p.(*plannercore.Execute); ok { err = execPlan.OptimizePreparedPlan(ctx, sctx, is) + logutil.BgLogger().Info("MYLOG optimize exec") return execPlan.Plan, err } err = errors.Errorf("invalid result plan type, should be Execute") diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index 4a2a871034879..00ebb424bacd7 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -2460,7 +2460,7 @@ func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { tk.MustExec("insert into t values(1, 1, 1), (2, 2, 2)") tk.MustExec("set tidb_enable_amend_pessimistic_txn = 1") - //tk.MustExec("begin pessimistic") + tk.MustExec("begin pessimistic") tk.MustExec("prepare select_stmt from 'select * from t where v = ?'") tk.MustExec("prepare select_update_stmt from 'select * from t where v = ? for update'") tk.MustExec("prepare update_stmt from 'update t set vv = 3 where v = ?'") @@ -2479,9 +2479,10 @@ func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { // current read should update cache since schema is changed //tk.MustQuery("execute select_update_stmt using @v").Check(testkit.Rows("1 2 2")) //tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + time.Sleep(time.Second) tk.MustExec("execute update_stmt using @v") //tk.CheckExecResult(0, 0) tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) - //tk.MustExec("commit") + tk.MustExec("commit") } From 04ad7bb082f9eb6f59f2aa30d5ebf12bd508becb Mon Sep 17 00:00:00 2001 From: you06 Date: Wed, 13 Jan 2021 19:18:59 +0800 Subject: [PATCH 3/9] add case and fix plan cache Signed-off-by: you06 --- executor/prepared.go | 1 + planner/core/cache.go | 1 + planner/core/common_plans.go | 18 +++++------------- planner/core/planbuilder.go | 5 +++++ session/pessimistic_test.go | 30 +++++++++++++++--------------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/executor/prepared.go b/executor/prepared.go index 8bc1753c181f9..62f27ee0aa944 100644 --- a/executor/prepared.go +++ b/executor/prepared.go @@ -219,6 +219,7 @@ func (e *PrepareExec) Next(ctx context.Context, req *chunk.Chunk) error { VisitInfos: destBuilder.GetVisitInfo(), NormalizedSQL: normalized, SQLDigest: digest, + ForUpdateRead: destBuilder.GetIsForUpdateRead(), } return vars.AddPreparedStmt(e.ID, preparedObj) } diff --git a/planner/core/cache.go b/planner/core/cache.go index d2c8a0b2ee7a3..feb9f4207278e 100644 --- a/planner/core/cache.go +++ b/planner/core/cache.go @@ -198,4 +198,5 @@ type CachedPrepareStmt struct { NormalizedPlan string SQLDigest string PlanDigest string + ForUpdateRead bool } diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 1f9a5b097c1ec..d11215e034cb2 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -24,6 +24,7 @@ import ( "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" + "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/kv" @@ -204,8 +205,6 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont prepared := preparedObj.PreparedAst vars.StmtCtx.StmtType = prepared.StmtType - logutil.BgLogger().Info("MYLOG optimize prepared plan, p1") - paramLen := len(e.PrepareParams) if paramLen > 0 { // for binary protocol execute, argument is placed in vars.PrepareParams @@ -236,9 +235,10 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont } } - logutil.BgLogger().Info("MYLOG optimize prepared plan, p2", - zap.Int64("prepare verion", prepared.SchemaVersion), - zap.Int64("schema version", is.SchemaMetaVersion())) + // check with latest schema if the plan uses forUpdateRead + if preparedObj.ForUpdateRead { + is = domain.GetDomain(sctx).InfoSchema() + } if prepared.SchemaVersion != is.SchemaMetaVersion() { // In order to avoid some correctness issues, we have to clear the @@ -256,7 +256,6 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont prepared.SchemaVersion = is.SchemaMetaVersion() } err := e.getPhysicalPlan(ctx, sctx, is, preparedObj) - logutil.BgLogger().Info("MYLOG optimize prepared plan, p3", zap.Error(err)) if err != nil { return err } @@ -285,7 +284,6 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, stmtCtx := sctx.GetSessionVars().StmtCtx prepared := preparedStmt.PreparedAst stmtCtx.UseCache = prepared.UseCache - logutil.Logger(ctx).Info("MYLOG getPhysicalPlan", zap.Bool("use cache", prepared.UseCache)) var cacheKey kvcache.Key if prepared.UseCache { cacheKey = NewPSTMTPlanCacheKey(sctx.GetSessionVars(), e.ExecID, prepared.SchemaVersion) @@ -308,7 +306,6 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, err := e.rebuildRange(plan) if err != nil { logutil.BgLogger().Debug("rebuild range failed", zap.Error(err)) - logutil.BgLogger().Info("MYLOG rebuild range failed", zap.Error(err)) goto REBUILD } if metrics.ResettablePlanCacheCounterFortTest { @@ -349,7 +346,6 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, err := e.rebuildRange(cachedVal.Plan) if err != nil { logutil.BgLogger().Debug("rebuild range failed", zap.Error(err)) - logutil.BgLogger().Info("MYLOG rebuild range failed", zap.Error(err)) goto REBUILD } err = e.setFoundInPlanCache(sctx, true) @@ -368,14 +364,10 @@ func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, } break } - - logutil.Logger(ctx).Info("MYLOG getPhysicalPlan cache key not exist") } } - logutil.Logger(ctx).Info("MYLOG getPhysicalPlan before rebuild") REBUILD: - logutil.Logger(ctx).Info("MYLOG getPhysicalPlan rebuild") stmt := TryAddExtraLimit(sctx, prepared.Stmt) p, names, err := OptimizeAstNode(ctx, sctx, stmt, is) if err != nil { diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index d71f156e94694..dff2ce436cef8 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -524,6 +524,11 @@ func (b *PlanBuilder) GetVisitInfo() []visitInfo { return b.visitInfo } +// GetIsForUpdateRead gets if the PlanBuilder use forUpdateRead +func (b *PlanBuilder) GetIsForUpdateRead() bool { + return b.isForUpdateRead +} + // GetDBTableInfo gets the accessed dbs and tables info. func (b *PlanBuilder) GetDBTableInfo() []stmtctx.TableEntry { var tables []stmtctx.TableEntry diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index 00ebb424bacd7..ba44efc21a913 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -2454,35 +2454,35 @@ func (s *testPessimisticSuite) TestIssue21498(c *C) { func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { tk := testkit.NewTestKitWithInit(c, s.store) - //tk2 := testkit.NewTestKitWithInit(c, s.store) + tk2 := testkit.NewTestKitWithInit(c, s.store) + tk.MustExec("use test") + tk2.MustExec("use test") tk.MustExec("create table t (id int primary key, v int, index iv (v), vv int)") tk.MustExec("insert into t values(1, 1, 1), (2, 2, 2)") tk.MustExec("set tidb_enable_amend_pessimistic_txn = 1") - tk.MustExec("begin pessimistic") - tk.MustExec("prepare select_stmt from 'select * from t where v = ?'") - tk.MustExec("prepare select_update_stmt from 'select * from t where v = ? for update'") + tk.MustExec("prepare update_stmt from 'update t set vv = 3 where v = ?'") tk.MustExec("set @v = 1") // generate plan cache - tk.MustQuery("execute select_stmt using @v").Check(testkit.Rows("1 1 1")) - tk.MustQuery("execute select_update_stmt using @v").Check(testkit.Rows("1 1 1")) tk.MustExec("execute update_stmt using @v") - //tk2.MustExec("alter table t drop index iv") - //tk2.MustExec("update t set v = 3 where v = 2") + tk.MustExec("begin pessimistic") + tk2.MustExec("alter table t drop index iv") + tk2.MustExec("update t set v = 3 where v = 2") tk.MustExec("set @v = 2") - //tk.MustQuery("execute select_stmt using @v").Check(testkit.Rows("2 2 2")) - //tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) - // current read should update cache since schema is changed - //tk.MustQuery("execute select_update_stmt using @v").Check(testkit.Rows("1 2 2")) - //tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) - time.Sleep(time.Second) tk.MustExec("execute update_stmt using @v") - //tk.CheckExecResult(0, 0) + tk.CheckExecResult(0, 0) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("set @v = 3") + tk.MustExec("execute update_stmt using @v") + tk.CheckExecResult(1, 0) tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) tk.MustExec("commit") + + tk.MustQuery("select * from t").Check(testkit.Rows("1 1 3", "2 3 3")) } From aad17ee592aaac2aa13e1802908115eb1bfff475 Mon Sep 17 00:00:00 2001 From: you06 Date: Wed, 13 Jan 2021 19:26:29 +0800 Subject: [PATCH 4/9] remove debug logs Signed-off-by: you06 --- executor/compiler.go | 4 ---- planner/optimize.go | 3 --- 2 files changed, 7 deletions(-) diff --git a/executor/compiler.go b/executor/compiler.go index 4cae1f76eb27e..bb0f5274a159e 100644 --- a/executor/compiler.go +++ b/executor/compiler.go @@ -16,9 +16,6 @@ package executor import ( "context" - "github.com/pingcap/tidb/util/logutil" - "go.uber.org/zap" - "github.com/opentracing/opentracing-go" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" @@ -63,7 +60,6 @@ func (c *Compiler) Compile(ctx context.Context, stmtNode ast.StmtNode) (*ExecStm stmtNode = plannercore.TryAddExtraLimit(c.Ctx, stmtNode) finalPlan, names, err := planner.Optimize(ctx, c.Ctx, stmtNode, infoSchema) - logutil.BgLogger().Info("MYLOG Compile", zap.String("final plan", finalPlan.ExplainInfo()), zap.Error(err)) if err != nil { return nil, err } diff --git a/planner/optimize.go b/planner/optimize.go index 82155875f134a..7f0b126d75c16 100644 --- a/planner/optimize.go +++ b/planner/optimize.go @@ -121,7 +121,6 @@ func Optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in } bestPlan, names, _, err := optimize(ctx, sctx, node, is) - logutil.BgLogger().Info("MYLOG got optimize", zap.String("final plan", bestPlan.ExplainInfo()), zap.Error(err)) if err != nil { return nil, nil, err } @@ -255,7 +254,6 @@ func optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in // Handle the execute statement. if execPlan, ok := p.(*plannercore.Execute); ok { err := execPlan.OptimizePreparedPlan(ctx, sctx, is) - logutil.BgLogger().Info("MYLOG optimize", zap.Error(err), zap.Stack("trace")) return p, p.OutputNames(), 0, err } @@ -421,7 +419,6 @@ func OptimizeExecStmt(ctx context.Context, sctx sessionctx.Context, } if execPlan, ok := p.(*plannercore.Execute); ok { err = execPlan.OptimizePreparedPlan(ctx, sctx, is) - logutil.BgLogger().Info("MYLOG optimize exec") return execPlan.Plan, err } err = errors.Errorf("invalid result plan type, should be Execute") From 1d6a1e5641e7c8986edd32db0e9275d2c462be85 Mon Sep 17 00:00:00 2001 From: you06 Date: Fri, 15 Jan 2021 15:49:35 +0800 Subject: [PATCH 5/9] fix binary protocol Signed-off-by: you06 --- planner/core/common_plans.go | 8 ++----- planner/optimize.go | 13 +++++++++++ session/pessimistic_test.go | 42 +++++++++++++++++++++++++++++------- session/session.go | 16 ++++++++++++-- 4 files changed, 63 insertions(+), 16 deletions(-) diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index d11215e034cb2..435f5c1d73f6f 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -24,7 +24,6 @@ import ( "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" - "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/kv" @@ -235,11 +234,6 @@ func (e *Execute) OptimizePreparedPlan(ctx context.Context, sctx sessionctx.Cont } } - // check with latest schema if the plan uses forUpdateRead - if preparedObj.ForUpdateRead { - is = domain.GetDomain(sctx).InfoSchema() - } - if prepared.SchemaVersion != is.SchemaMetaVersion() { // In order to avoid some correctness issues, we have to clear the // cached plan once the schema version is changed. @@ -1320,6 +1314,8 @@ func IsPointUpdateByAutoCommit(ctx sessionctx.Context, p Plan) (bool, error) { if _, isFastSel := updPlan.SelectPlan.(*PointGetPlan); isFastSel { return true, nil } + + logutil.BgLogger().Info("MYLOG IsPointUpdateByAutoCommit p3") return false, nil } diff --git a/planner/optimize.go b/planner/optimize.go index 7f0b126d75c16..3c535fd16dad1 100644 --- a/planner/optimize.go +++ b/planner/optimize.go @@ -30,6 +30,7 @@ import ( "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/planner/cascades" + "github.com/pingcap/tidb/planner/core" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/privilege" "github.com/pingcap/tidb/sessionctx" @@ -236,6 +237,18 @@ func optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in } sctx.GetSessionVars().RewritePhaseInfo.DurationRewrite = time.Since(beginRewrite) + if execPlan, ok := p.(*plannercore.Execute); ok { + execID := execPlan.ExecID + if execPlan.Name != "" { + execID = sctx.GetSessionVars().PreparedStmtNameToID[execPlan.Name] + } + if preparedPointer, ok := sctx.GetSessionVars().PreparedStmts[execID]; ok { + if preparedObj, ok := preparedPointer.(*core.CachedPrepareStmt); ok && preparedObj.ForUpdateRead { + is = domain.GetDomain(sctx).InfoSchema() + } + } + } + sctx.GetSessionVars().StmtCtx.Tables = builder.GetDBTableInfo() activeRoles := sctx.GetSessionVars().ActiveRoles // Check privilege. Maybe it's better to move this to the Preprocess, but diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index ba44efc21a913..4efdf9af26119 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -21,6 +21,8 @@ import ( "sync/atomic" "time" + "github.com/pingcap/tidb/types" + . "github.com/pingcap/check" "github.com/pingcap/errors" "github.com/pingcap/failpoint" @@ -2455,34 +2457,58 @@ func (s *testPessimisticSuite) TestIssue21498(c *C) { func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { tk := testkit.NewTestKitWithInit(c, s.store) tk2 := testkit.NewTestKitWithInit(c, s.store) + tk3 := testkit.NewTestKitWithInit(c, s.store) + ctx := context.Background() + tk.MustExec("use test") tk2.MustExec("use test") + tk3.MustExec("use test") - tk.MustExec("create table t (id int primary key, v int, index iv (v), vv int)") - tk.MustExec("insert into t values(1, 1, 1), (2, 2, 2)") + tk.MustExec("drop table if exists t") + tk.MustExec("create table t (id int primary key, v int, unique index iv (v), vv int)") + tk.MustExec("insert into t values(1, 1, 1), (2, 2, 2), (4, 4, 4)") tk.MustExec("set tidb_enable_amend_pessimistic_txn = 1") + tk2.MustExec("set tidb_enable_amend_pessimistic_txn = 1") - tk.MustExec("prepare update_stmt from 'update t set vv = 3 where v = ?'") + //generate plan cache + tk.MustExec("prepare update_stmt from 'update t set vv = vv + 1 where v = ?'") tk.MustExec("set @v = 1") - // generate plan cache tk.MustExec("execute update_stmt using @v") + stmtID, _, _, err := tk2.Se.PrepareStmt("update t set vv = vv + 1 where v = ?") + c.Assert(err, IsNil) + _, err = tk2.Se.ExecutePreparedStmt(ctx, stmtID, []types.Datum{types.NewDatum(1)}) + c.Assert(err, IsNil) + tk.MustExec("begin pessimistic") - tk2.MustExec("alter table t drop index iv") - tk2.MustExec("update t set v = 3 where v = 2") + tk2.MustExec("begin pessimistic") + + tk3.MustExec("alter table t drop index iv") + tk3.MustExec("update t set v = 3 where v = 2") + tk3.MustExec("update t set v = 5 where v = 4") tk.MustExec("set @v = 2") tk.MustExec("execute update_stmt using @v") tk.CheckExecResult(0, 0) tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) - tk.MustExec("set @v = 3") tk.MustExec("execute update_stmt using @v") tk.CheckExecResult(1, 0) tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) + _, err = tk2.Se.ExecutePreparedStmt(ctx, stmtID, []types.Datum{types.NewDatum(4)}) + c.Assert(err, IsNil) + tk2.CheckExecResult(0, 0) + tk2.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + _, err = tk2.Se.ExecutePreparedStmt(ctx, stmtID, []types.Datum{types.NewDatum(5)}) + c.Assert(err, IsNil) + tk2.CheckExecResult(1, 0) + // FIXME: should hit plan cache here + tk2.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + tk.MustExec("commit") + tk2.MustExec("commit") - tk.MustQuery("select * from t").Check(testkit.Rows("1 1 3", "2 3 3")) + tk.MustQuery("select * from t").Check(testkit.Rows("1 1 3", "2 3 3", "4 5 5")) } diff --git a/session/session.go b/session/session.go index 0c28697a906c0..41bf126cc1b52 100644 --- a/session/session.go +++ b/session/session.go @@ -1573,7 +1573,12 @@ func (s *session) cachedPlanExec(ctx context.Context, stmtID uint32, prepareStmt *plannercore.CachedPrepareStmt, args []types.Datum) (sqlexec.RecordSet, error) { prepared := prepareStmt.PreparedAst // compile ExecStmt - is := infoschema.GetInfoSchema(s) + var is infoschema.InfoSchema + if prepareStmt.ForUpdateRead { + is = domain.GetDomain(s).InfoSchema() + } else { + is = infoschema.GetInfoSchema(s) + } execAst := &ast.ExecuteStmt{ExecID: stmtID} if err := executor.ResetContextOfStmt(s, execAst); err != nil { return nil, err @@ -1614,9 +1619,16 @@ func (s *session) cachedPlanExec(ctx context.Context, s.PrepareTSFuture(ctx) stmtCtx.Priority = kv.PriorityHigh resultSet, err = runStmt(ctx, s, stmt) + case nil: + // cache is invalid + if prepareStmt.ForUpdateRead { + s.PrepareTSFuture(ctx) + } + resultSet, err = runStmt(ctx, s, stmt) default: + err = errors.Errorf("invalid cached plan type %T", prepared.CachedPlan) prepared.CachedPlan = nil - return nil, errors.Errorf("invalid cached plan type") + return nil, err } return resultSet, err } From b18384fd3aa41ee66ce6056800bb507d493bbebe Mon Sep 17 00:00:00 2001 From: you06 Date: Thu, 21 Jan 2021 23:20:25 +0800 Subject: [PATCH 6/9] fix plan cache not hit Signed-off-by: you06 --- planner/core/common_plans.go | 10 ++++++++-- planner/core/optimizer.go | 4 ++++ planner/optimize.go | 1 + session/pessimistic_test.go | 3 +-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 435f5c1d73f6f..ae3e549910142 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -275,7 +275,8 @@ func (e *Execute) setFoundInPlanCache(sctx sessionctx.Context, opt bool) error { } func (e *Execute) getPhysicalPlan(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema, preparedStmt *CachedPrepareStmt) error { - stmtCtx := sctx.GetSessionVars().StmtCtx + sessVars := sctx.GetSessionVars() + stmtCtx := sessVars.StmtCtx prepared := preparedStmt.PreparedAst stmtCtx.UseCache = prepared.UseCache var cacheKey kvcache.Key @@ -375,6 +376,12 @@ REBUILD: e.Plan = p _, isTableDual := p.(*PhysicalTableDual) if !isTableDual && prepared.UseCache && !stmtCtx.OptimDependOnMutableConst { + // rebuild key to exclude kv.TiFlash when stmt is not read only + if _, isolationReadContainTiFlash := sessVars.IsolationReadEngines[kv.TiFlash]; isolationReadContainTiFlash && !IsReadOnly(stmt, sessVars) { + delete(sessVars.IsolationReadEngines, kv.TiFlash) + cacheKey = NewPSTMTPlanCacheKey(sctx.GetSessionVars(), e.ExecID, prepared.SchemaVersion) + sessVars.IsolationReadEngines[kv.TiFlash] = struct{}{} + } cached := NewPSTMTPlanCacheValue(p, names, stmtCtx.TblInfo2UnionScan, tps) preparedStmt.NormalizedPlan, preparedStmt.PlanDigest = NormalizePlan(p) stmtCtx.SetPlanDigest(preparedStmt.NormalizedPlan, preparedStmt.PlanDigest) @@ -1315,7 +1322,6 @@ func IsPointUpdateByAutoCommit(ctx sessionctx.Context, p Plan) (bool, error) { return true, nil } - logutil.BgLogger().Info("MYLOG IsPointUpdateByAutoCommit p3") return false, nil } diff --git a/planner/core/optimizer.go b/planner/core/optimizer.go index a81b0f3896d18..67ef1639ef398 100644 --- a/planner/core/optimizer.go +++ b/planner/core/optimizer.go @@ -27,6 +27,7 @@ import ( "github.com/pingcap/tidb/planner/property" "github.com/pingcap/tidb/privilege" "github.com/pingcap/tidb/sessionctx" + "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/types" utilhint "github.com/pingcap/tidb/util/hint" "github.com/pingcap/tidb/util/set" @@ -39,6 +40,9 @@ var OptimizeAstNode func(ctx context.Context, sctx sessionctx.Context, node ast. // AllowCartesianProduct means whether tidb allows cartesian join without equal conditions. var AllowCartesianProduct = atomic.NewBool(true) +// IsReadOnly check whether the ast.Node is a read only statement. +var IsReadOnly func(node ast.Node, vars *variable.SessionVars) bool + const ( flagGcSubstitute uint64 = 1 << iota flagPrunColumns diff --git a/planner/optimize.go b/planner/optimize.go index 3c535fd16dad1..ddf419c2ca348 100644 --- a/planner/optimize.go +++ b/planner/optimize.go @@ -579,4 +579,5 @@ func setFoundInBinding(sctx sessionctx.Context, opt bool) error { func init() { plannercore.OptimizeAstNode = Optimize + plannercore.IsReadOnly = IsReadOnly } diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index 4efdf9af26119..5e91597a2880b 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -2504,8 +2504,7 @@ func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { _, err = tk2.Se.ExecutePreparedStmt(ctx, stmtID, []types.Datum{types.NewDatum(5)}) c.Assert(err, IsNil) tk2.CheckExecResult(1, 0) - // FIXME: should hit plan cache here - tk2.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + tk2.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) tk.MustExec("commit") tk2.MustExec("commit") From 6fb982d43521e13426508e611d36b67ae2e2bcd5 Mon Sep 17 00:00:00 2001 From: you06 Date: Sat, 30 Jan 2021 17:36:25 +0800 Subject: [PATCH 7/9] format imports Signed-off-by: you06 --- session/pessimistic_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index 6ad6f6a51edd4..ce02318fe8416 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -21,8 +21,6 @@ import ( "sync/atomic" "time" - "github.com/pingcap/tidb/types" - . "github.com/pingcap/check" "github.com/pingcap/errors" "github.com/pingcap/failpoint" @@ -35,6 +33,7 @@ import ( "github.com/pingcap/tidb/store/tikv" "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/tablecodec" + "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/testkit" ) From 6876428fe91761674a71fdcac591c94b6b1bcf78 Mon Sep 17 00:00:00 2001 From: you06 Date: Thu, 18 Mar 2021 15:49:33 +0800 Subject: [PATCH 8/9] fix default config change Signed-off-by: you06 --- go.sum | 47 ------------------------------------- session/pessimistic_test.go | 7 ++++++ 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/go.sum b/go.sum index ed705264b9304..b113092f5d972 100644 --- a/go.sum +++ b/go.sum @@ -5,27 +5,22 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0 h1:9/vpR43S4aJaROxqQHQ3nH9lfyKKV0dC3vOmnw8ebQQ= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0 h1:RPUcBvDeYgQFMfQu1eBMq6piD1SXmLH+vK3qjewZPus= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -52,14 +47,11 @@ github.com/HdrHistogram/hdrhistogram-go v0.9.0 h1:dpujRju0R4M/QZzcnR1LH1qm+TVG3U github.com/HdrHistogram/hdrhistogram-go v0.9.0/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4= github.com/Jeffail/gabs/v2 v2.5.1 h1:ANfZYjpMlfTTKebycu4X1AgkVWumFVDYQl7JwOr4mDk= github.com/Jeffail/gabs/v2 v2.5.1/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -129,10 +121,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -169,11 +159,9 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.11.1 h1:stwUsXhUGliQs9t0ZS39BWCltFdOHgABiIlihop8AD4= @@ -182,7 +170,6 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsouza/fake-gcs-server v1.17.0 h1:OeH75kBZcZa3ZE+zz/mFdJ2btt9FgqfjI7gIh9+5fvk= github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= @@ -205,19 +192,15 @@ github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/overalls v0.0.0-20180201144345-22ec1a223b7c/go.mod h1:UqxAgEOt89sCiXlrc/ycnx00LVvUO/eS8tMUkWX4R7w= @@ -243,13 +226,11 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= @@ -377,11 +358,9 @@ github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -392,12 +371,10 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= @@ -405,11 +382,8 @@ github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 h1:QASJXOGm2RZ5Ardbc86qNFvby9AqkLDibfChMtAg5QM= github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.0.2 h1:v0NxxQ7fSFz/u1NQydPo6EGdq7va0J1BtsZmae6kzUg= github.com/mgechev/revive v1.0.2/go.mod h1:rb0dQy1LVAxW9SWy5R3LPUjevzUbUS316U5MFySA2lo= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -437,7 +411,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= @@ -451,7 +424,6 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/pborman/getopt v0.0.0-20180729010549-6fdd0a2c7117/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.3.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= @@ -535,11 +507,9 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 h1:HQagqIiBmr8YXawX/le3+O26N+vPPC1PtjaF3mwnook= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -547,14 +517,10 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44 h1:tB9NOR21++IjLyVx3/PCPhWMwqGNCMQEH96A6dMZ/gc= github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v2.19.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.20.12+incompatible h1:6VEGkOXP/eP4o2Ilk8cSsX0PhOEfX6leqAnD+urrp9M= @@ -563,7 +529,6 @@ github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= @@ -604,7 +569,6 @@ github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05 github.com/swaggo/http-swagger v0.0.0-20200308142732-58ac5e232fba/go.mod h1:O1lAbCgAAX/KZ80LM/OXwtWFI/5TvZlwxSg8Cq08PV0= github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= github.com/swaggo/swag v1.6.3/go.mod h1:wcc83tB4Mb2aNiL/HP4MFeQdpHUrca+Rp/DRNgWAUio= -github.com/swaggo/swag v1.6.6-0.20200529100950-7c765ddd0476 h1:UjnSXdNPIG+5FJ6xLQODEdk7gSnJlMldu3sPAxxCO+4= github.com/swaggo/swag v1.6.6-0.20200529100950-7c765ddd0476/go.mod h1:xDhTyuFIujYiN3DKWC/H/83xcfHp+UE/IzWWampG7Zc= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= @@ -635,9 +599,7 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2tfCQDUqRd8fI= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/unrolled/render v1.0.1/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM= -github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/negroni v0.3.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= @@ -667,7 +629,6 @@ go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b h1:3kC4J3eQF6p1UEfQ go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -718,7 +679,6 @@ golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxT golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299 h1:zQpM52jfKHG6II1ISZY1ZcpygvuSFZpLwfluuF89XOg= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= @@ -734,7 +694,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -778,14 +737,12 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -849,7 +806,6 @@ golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -910,7 +866,6 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0 h1:yzlyyDW/J0w8yNFJIhiAJy4kq74S+1DOLdawELNxFMA= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0 h1:TgDr+1inK2XVUKZx3BYAqQg/GwucGdBkzZjWaTg/I+A= @@ -934,7 +889,6 @@ google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4S5cnCrr5SwzvlrPRmqqCuJDB8UTs= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -990,7 +944,6 @@ gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/session/pessimistic_test.go b/session/pessimistic_test.go index 891924e6eaa55..90146de91594d 100644 --- a/session/pessimistic_test.go +++ b/session/pessimistic_test.go @@ -28,6 +28,7 @@ import ( "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/kv" + plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/store/tikv" @@ -2461,6 +2462,12 @@ func (s *testPessimisticSuite) TestIssue21498(c *C) { } func (s *testPessimisticSuite) TestPlanCacheSchemaChange(c *C) { + orgEnable := plannercore.PreparedPlanCacheEnabled() + defer func() { + plannercore.SetPreparedPlanCache(orgEnable) + }() + plannercore.SetPreparedPlanCache(true) + tk := testkit.NewTestKitWithInit(c, s.store) tk2 := testkit.NewTestKitWithInit(c, s.store) tk3 := testkit.NewTestKitWithInit(c, s.store) From d939a0054ec1b8a6a5b37da75a08b65f05f2377f Mon Sep 17 00:00:00 2001 From: you06 Date: Thu, 18 Mar 2021 15:50:41 +0800 Subject: [PATCH 9/9] update go.mod Signed-off-by: you06 --- go.sum | 1 + 1 file changed, 1 insertion(+) diff --git a/go.sum b/go.sum index b113092f5d972..afba8ee639f1b 100644 --- a/go.sum +++ b/go.sum @@ -521,6 +521,7 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44 h1:tB9NOR21++IjLyVx3/PCPhWMwqGNCMQEH96A6dMZ/gc= github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v2.19.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.20.12+incompatible h1:6VEGkOXP/eP4o2Ilk8cSsX0PhOEfX6leqAnD+urrp9M=