Skip to content

Commit

Permalink
fix show executor unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Feb 22, 2021
1 parent 5b2fab5 commit 0b20eb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/vtgate/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ func TestExecutorShowColumns(t *testing.T) {

func TestExecutorShow(t *testing.T) {
executor, _, _, sbclookup := createLegacyExecutorEnv()
session := NewSafeSession(&vtgatepb.Session{TargetString: "@master"})
session := NewSafeSession(&vtgatepb.Session{TargetString: "TestExecutor"})

for _, query := range []string{"show vitess_keyspaces", "show keyspaces"} {
qr, err := executor.Execute(ctx, "TestExecute", session, query, nil)
Expand All @@ -459,6 +459,8 @@ func TestExecutorShow(t *testing.T) {
_, err = executor.Execute(ctx, "TestExecute", session, "show collation where `Charset` = 'utf8' and `Collation` = 'utf8_bin'", nil)
require.NoError(t, err)

_, err = executor.Execute(ctx, "TestExecute", session, "use @master", nil)
require.NoError(t, err)
_, err = executor.Execute(ctx, "TestExecute", session, "show tables", nil)
assert.EqualError(t, err, "keyspace not specified", "'show tables' should fail without a keyspace")
assert.Empty(t, sbclookup.Queries, "sbclookup unexpectedly has queries already")
Expand Down

0 comments on commit 0b20eb9

Please sign in to comment.