Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask database name #6791

Merged
merged 12 commits into from
Oct 5, 2020
Prev Previous commit
Next Next commit
Added Test for ReserveExecute Method
Signed-off-by: GuptaManan100 <[email protected]>
GuptaManan100 committed Sep 28, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 1017a96dfefae96363cf9c983a15e307d6d2f695
9 changes: 9 additions & 0 deletions go/vt/vttablet/tabletserver/tabletserver_test.go
Original file line number Diff line number Diff line change
@@ -2252,6 +2252,15 @@ func TestDatabaseNameReplaceByKeyspaceName(t *testing.T) {
_, err = tsv.Commit(ctx, &target, transactionID)
require.NoError(t, err)
}

// Test ReserveExecute
res, rID, _, err := tsv.ReserveExecute(ctx, &target, nil, executeSQL, nil, 0, &querypb.ExecuteOptions{IncludedFields: querypb.ExecuteOptions_ALL})
require.NoError(t, err)
for _, field := range res.Fields {
require.Equal(t, "keyspaceName", field.Database)
}
err = tsv.Release(ctx, &target, 0, rID)
require.NoError(t, err)
}

func setupTabletServerTest(t *testing.T, keyspaceName string) (*fakesqldb.DB, *TabletServer) {