From c9e28e9b17cb3fcae6c34727a680522f3b48236c Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sun, 12 Jan 2025 11:39:57 -0500 Subject: [PATCH] Fix test data generation Signed-off-by: Matt Lord --- go/test/endtoend/vreplication/multi_tenant_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/vreplication/multi_tenant_test.go b/go/test/endtoend/vreplication/multi_tenant_test.go index eaab232f3d0..2cd908b449f 100644 --- a/go/test/endtoend/vreplication/multi_tenant_test.go +++ b/go/test/endtoend/vreplication/multi_tenant_test.go @@ -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) }