From e63dcb732a8dced16b68de861e6fba76e94eaf3d Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 24 Jul 2020 19:54:47 +0530 Subject: [PATCH] fix executor set test Signed-off-by: Harshit Gangal --- go/vt/vtgate/executor_set_test.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/go/vt/vtgate/executor_set_test.go b/go/vt/vtgate/executor_set_test.go index ec9e24402cd..8e509e5019a 100644 --- a/go/vt/vtgate/executor_set_test.go +++ b/go/vt/vtgate/executor_set_test.go @@ -41,9 +41,10 @@ func TestExecutorSet(t *testing.T) { executorEnv, _, _, _ := createExecutorEnv() testcases := []struct { - in string - out *vtgatepb.Session - err string + in string + out *vtgatepb.Session + err string + target string }{{ in: "set autocommit = 1", out: &vtgatepb.Session{Autocommit: true}, @@ -237,11 +238,13 @@ func TestExecutorSet(t *testing.T) { in: "set skip_query_plan_cache = 0", out: &vtgatepb.Session{Autocommit: true, Options: &querypb.ExecuteOptions{}}, }, { - in: "set sql_auto_is_null = 0", - out: &vtgatepb.Session{Autocommit: true, RowCount: -1}, + in: "set sql_auto_is_null = 0", + target: "TestExecutor", + out: &vtgatepb.Session{Autocommit: true, TargetString: "TestExecutor"}, }, { - in: "set sql_auto_is_null = 1", - out: &vtgatepb.Session{Autocommit: true, RowCount: -1}, + in: "set sql_auto_is_null = 1", + target: "TestExecutor", + out: &vtgatepb.Session{Autocommit: true, TargetString: "TestExecutor"}, }, { in: "set tx_read_only = 2", err: "unexpected value for tx_read_only: 2", @@ -287,7 +290,7 @@ func TestExecutorSet(t *testing.T) { }} for _, tcase := range testcases { t.Run(tcase.in, func(t *testing.T) { - session := NewSafeSession(&vtgatepb.Session{Autocommit: true}) + session := NewSafeSession(&vtgatepb.Session{Autocommit: true, TargetString: tcase.target}) _, err := executorEnv.Execute(context.Background(), "TestExecute", session, tcase.in, nil) if tcase.err == "" { utils.MustMatch(t, tcase.out, session.Session, "new executor")