Skip to content

Commit

Permalink
roachtest: fix schemachange/mixed/tpcc for 19.1
Browse files Browse the repository at this point in the history
`schemachange/mixed/tpcc` uses `CREATE TABLE AS` in 19.2. This PR will have the
test correctly create a similar table in 19.1 without using `CREATE TABLE AS`.

Release justification: Fixes a test.

Release note: None
  • Loading branch information
lucy-zhang committed Sep 25, 2019
1 parent 9fd4ce1 commit 2c744d4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/cmd/roachtest/schemachange.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,16 @@ func makeMixedSchemaChanges(spec clusterSpec, warehouses int, length time.Durati
if t.IsBuildVersion(`v19.2.0`) {
if err := runAndLogStmts(ctx, t, c, "mixed-schema-changes-19.2", []string{
// CREATE TABLE AS with a specified primary key was added in 19.2.
`CREATE TABLE tpcc.orderpks (o_w_id, o_d_id, o_id, PRIMARY KEY(o_w_id, o_d_id, o_id)) AS select o_w_id, o_d_id, o_id from tpcc.order;`,
`CREATE TABLE tpcc.orderpks (o_w_id, o_d_id, o_id, PRIMARY KEY(o_w_id, o_d_id, o_id)) AS select o_w_id, o_d_id, o_id FROM tpcc.order;`,
}); err != nil {
return err
}
} else {
if err := runAndLogStmts(ctx, t, c, "mixed-schema-changes-19.1", []string{
`CREATE TABLE tpcc.orderpks (o_w_id, o_d_id, o_id, PRIMARY KEY(o_w_id, o_d_id, o_id));`,
// We can't populate the table with CREATE TABLE AS, so just
// insert the rows. AOST is used to reduce contention.
`INSERT INTO tpcc.orderpks SELECT o_w_id, o_d_id, o_id FROM tpcc.order AS OF SYSTEM TIME '-1s';`,
}); err != nil {
return err
}
Expand Down

0 comments on commit 2c744d4

Please sign in to comment.