Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Apr 8, 2024
1 parent 4d9525b commit 7b9fc33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/test/endtoend/vreplication/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
// All standard user tables should have a primary key and at least one secondary key.
initialProductSchema = `
create table product(pid int, description varbinary(128), date1 datetime not null default '0000-00-00 00:00:00', date2 datetime not null default '2021-00-01 00:00:00', primary key(pid), key(date1,date2)) CHARSET=utf8mb4;
create table customer(cid int, name varchar(128) collate utf8mb4_bin, meta json default null, typ enum('individual','soho','enterprise'), sport set('football','cricket','baseball'),
create table customer(cid int auto_increment, name varchar(128) collate utf8mb4_bin, meta json default null, typ enum('individual','soho','enterprise'), sport set('football','cricket','baseball'),
ts timestamp not null default current_timestamp, bits bit(2) default b'11', date1 datetime not null default '0000-00-00 00:00:00',
date2 datetime not null default '2021-00-01 00:00:00', dec80 decimal(8,0), blb blob, primary key(cid,typ), key(name)) CHARSET=utf8mb4;
create table customer_seq(id int, next_id bigint, cache bigint, primary key(id)) comment 'vitess_sequence';
Expand Down
8 changes: 8 additions & 0 deletions go/test/endtoend/vreplication/resharding_workflows_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ func testMoveTablesV2Workflow(t *testing.T) {

testVSchemaForSequenceAfterMoveTables(t)

// Confirm that the auto_increment clause on customer.cid was removed.
cs, err := vtgateConn.ExecuteFetch("show create table customer", 1, false)
require.NoError(t, err)
require.Len(t, cs.Rows, 1)
require.Len(t, cs.Rows[0], 2) // Table and "Create Table"
csddl := strings.ToLower(cs.Rows[0][1].ToString())
require.False(t, strings.Contains(csddl, "auto_increment"), "customer table still has auto_increment clause: %s", csddl)

createMoveTablesWorkflow(t, "Lead,Lead-1")
output, err = vc.VtctldClient.ExecuteCommandWithOutput(listAllArgs...)
require.NoError(t, err)
Expand Down

0 comments on commit 7b9fc33

Please sign in to comment.