Skip to content

Commit

Permalink
Merge #41079
Browse files Browse the repository at this point in the history
41079: roachtest: fix schemachange/mixed/tpcc for 19.1 r=lucy-zhang a=lucy-zhang

`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`.

See #40935 (comment).

Release justification: Fixes a test.

Release note: None

Co-authored-by: Lucy Zhang <lucy-zhang@users.noreply.github.com>
  • Loading branch information
craig[bot] and lucy-zhang committed Sep 25, 2019
2 parents fe735c9 + 2c744d4 commit d714f55
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 d714f55

Please sign in to comment.