From 3f2c9f6191135be8d543e1cd99b9a231098f57e4 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Wed, 29 Mar 2023 18:33:26 +0800 Subject: [PATCH] fixup --- executor/prepared_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/executor/prepared_test.go b/executor/prepared_test.go index ff27336779eed..d357ed15cdf58 100644 --- a/executor/prepared_test.go +++ b/executor/prepared_test.go @@ -332,7 +332,7 @@ func TestInvalidRange(t *testing.T) { tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) // use TableDual directly instead of TableFullScan - var plan []interface{} + plan := make([]interface{}, 0, 1) for _, r := range tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Rows() { plan = append(plan, r[0]) } @@ -366,7 +366,7 @@ func TestIssue40093(t *testing.T) { tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) // RangeScan instead of FullScan - var plan []interface{} + plan := make([]interface{}, 0, 1) for _, r := range tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Rows() { plan = append(plan, r[0]) } @@ -409,7 +409,7 @@ func TestIssue38205(t *testing.T) { tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) // IndexJoin - var plan []interface{} + plan := make([]interface{}, 0, 1) for _, r := range tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Rows() { plan = append(plan, r[0]) } @@ -1430,7 +1430,7 @@ func TestPreparePlanCache4Function(t *testing.T) { tk.MustExec("set @a = 0, @b = 1, @c = 2, @d = null;") tk.MustQuery("execute stmt using @a, @b;").Check(testkit.Rows(" 2", "0 0", "1 1", "2 2")) tk.MustQuery("execute stmt using @c, @d;").Check(testkit.Rows(" 1", "0 2", "1 2", "2 0")) - tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("1")) + tk.MustQuery("select @@last_plan_from_cache;").Check(testkit.Rows("0")) } func TestPreparePlanCache4DifferentSystemVars(t *testing.T) {