Skip to content

Commit

Permalink
Fix test data generation
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Jan 12, 2025
1 parent a8253ca commit c9e28e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/test/endtoend/vreplication/multi_tenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,11 @@ func (mtm *multiTenantMigration) insertSomeData(t *testing.T, tenantId int64, ke
defer closeConn()
idx := mtm.getLastID(tenantId)
for i := idx + 1; i <= idx+numRows; i++ {
// The source table has a PK on id only, so we have to make the id value
// unique rather than relying on the combination of (id, tenant_id) for
// our uniqueness.
execQueryWithRetry(t, vtgateConn,
fmt.Sprintf("insert into %s.t1(id, tenant_id) values(%d, %d)", keyspace, i, tenantId), queryTimeout)
fmt.Sprintf("insert into %s.t1(id, tenant_id) values(%d, %d)", keyspace, i+(tenantId*1e4), tenantId), queryTimeout)
}
mtm.setLastID(tenantId, idx+numRows)
}
Expand Down

0 comments on commit c9e28e9

Please sign in to comment.