Skip to content

Commit

Permalink
Add test for dropping non-existing sequence
Browse files Browse the repository at this point in the history
Signed-off-by: David Piegza <[email protected]>
  • Loading branch information
davidpiegza committed Aug 29, 2023
1 parent 287ee17 commit 524b6f4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions go/vt/vtgate/executor_vschema_ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,13 @@ func TestExecutorDropSequenceDDL(t *testing.T) {
_, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil)
require.NoError(t, err)

// Should fail adding a table on a sharded keyspace
ksSharded := "TestExecutor"
session = NewSafeSession(&vtgatepb.Session{TargetString: ksSharded})
// Should fail dropping a non-existing test sequence
session = NewSafeSession(&vtgatepb.Session{TargetString: ks})

stmt = "alter vschema add sequence sequence_table"
stmt = "alter vschema drop sequence test_seq"
_, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil)

wantErr := "add sequence table: unsupported on sharded keyspace TestExecutor"
wantErr := "vschema does not contain sequence test_seq in keyspace TestUnsharded"
if err == nil || err.Error() != wantErr {
t.Errorf("want error %v got %v", wantErr, err)
}
Expand Down

0 comments on commit 524b6f4

Please sign in to comment.