From 4f8f162ef530a60dc2ecb229ea3fbc3e91814344 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Tue, 10 Sep 2024 19:43:53 +0530 Subject: [PATCH] test: updated shard targeted ddl test Signed-off-by: Harshit Gangal --- go/test/endtoend/vtgate/misc_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/vtgate/misc_test.go b/go/test/endtoend/vtgate/misc_test.go index 9e16169ce5f..f15799a5e71 100644 --- a/go/test/endtoend/vtgate/misc_test.go +++ b/go/test/endtoend/vtgate/misc_test.go @@ -807,7 +807,13 @@ func TestDDLTargeted(t *testing.T) { utils.Exec(t, conn, "use `ks/-80`") utils.Exec(t, conn, `begin`) utils.Exec(t, conn, `create table ddl_targeted (id bigint primary key)`) - utils.Exec(t, conn, `commit`) + // implicit commit on ddl would have closed the open transaction + // so this execution should happen as autocommit. + utils.Exec(t, conn, `insert into ddl_targeted (id) values (1)`) + // this will have not impact and the row would have inserted. + utils.Exec(t, conn, `rollback`) + // validating the row + utils.AssertMatches(t, conn, `select id from ddl_targeted`, `[[INT64(1)]]`) } func TestLookupErrorMetric(t *testing.T) {