From ee74889775a2eac9d0768f2eabcec8640ac95fe3 Mon Sep 17 00:00:00 2001 From: Max Englander Date: Tue, 6 Sep 2022 09:34:38 -0400 Subject: [PATCH] tabletserver stream replace schema name bindvar: add e2e test Signed-off-by: Max Englander --- go/test/endtoend/vtgate/gen4/system_schema_test.go | 10 ++++++++++ go/vt/vttablet/tabletserver/query_executor_test.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/vtgate/gen4/system_schema_test.go b/go/test/endtoend/vtgate/gen4/system_schema_test.go index a935bbcb7be..5f9bec3287f 100644 --- a/go/test/endtoend/vtgate/gen4/system_schema_test.go +++ b/go/test/endtoend/vtgate/gen4/system_schema_test.go @@ -37,11 +37,21 @@ func TestDbNameOverride(t *testing.T) { conn, err := mysql.Connect(ctx, &vtParams) require.Nil(t, err) defer conn.Close() + + // Test query in OLTP workload (default). qr, err := conn.ExecuteFetch("SELECT distinct database() FROM information_schema.tables WHERE table_schema = database()", 1000, true) require.Nil(t, err) assert.Equal(t, 1, len(qr.Rows), "did not get enough rows back") assert.Equal(t, "vt_ks", qr.Rows[0][0].ToString()) + + // Test again in OLAP workload (default). + utils.Exec(t, conn, "SET workload=OLAP") + qr, err = conn.ExecuteFetch("SELECT distinct database() FROM information_schema.tables WHERE table_schema = database()", 1000, true) + + require.Nil(t, err) + assert.Equal(t, 1, len(qr.Rows), "did not get enough rows back") + assert.Equal(t, "vt_ks", qr.Rows[0][0].ToString()) } func TestInformationSchemaQuery(t *testing.T) { diff --git a/go/vt/vttablet/tabletserver/query_executor_test.go b/go/vt/vttablet/tabletserver/query_executor_test.go index 98b74faaaa3..526419c4f49 100644 --- a/go/vt/vttablet/tabletserver/query_executor_test.go +++ b/go/vt/vttablet/tabletserver/query_executor_test.go @@ -1348,7 +1348,7 @@ func newTestQueryExecutor(ctx context.Context, tsv *TabletServer, sql string, tx func newTestQueryExecutorStreaming(ctx context.Context, tsv *TabletServer, sql string, txID int64) *QueryExecutor { logStats := tabletenv.NewLogStats(ctx, "TestQueryExecutorStreaming") - plan, err := tsv.qe.GetStreamPlan(sql, false) + plan, err := tsv.qe.GetStreamPlan(sql) if err != nil { panic(err) }