Skip to content

Commit cd43363

Browse files
tanjinxharshit-gangalClaude
authored
[slack-19.0]: [release-19.0] DML test fix for duplicate column value (vitessio#18132) (#780)
* [release-19.0] DML test fix for duplicate column value (vitessio#18132) * fix: enable Percona tools repository before ps80 setup Percona repository structure now requires the tools repository to be enabled before setting up ps80. This fixes the CI error: "Selected product uses 'ps-80 tools' repositories. But the 'tools' repository is disabled" Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> --------- Co-authored-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
1 parent a9c4771 commit cd43363

8 files changed

Lines changed: 55 additions & 14 deletions

File tree

.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ jobs:
101101
sudo apt-get install -y lsb-release gnupg2 curl
102102
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
103103
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
104-
sudo percona-release setup ps80
104+
# Enable tools repository first, then ps-80
105+
sudo percona-release enable-only tools release
106+
sudo percona-release enable ps-80 release
105107
sudo apt-get update
106108
107109
# Install everything else we need, and configure

.github/workflows/cluster_endtoend_xb_backup.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ jobs:
101101
sudo apt-get install -y lsb-release gnupg2 curl
102102
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
103103
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
104-
sudo percona-release setup ps80
104+
# Enable tools repository first, then ps-80
105+
sudo percona-release enable-only tools release
106+
sudo percona-release enable ps-80 release
105107
sudo apt-get update
106108
107109
# Install everything else we need, and configure

.github/workflows/cluster_endtoend_xb_recovery.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ jobs:
101101
sudo apt-get install -y lsb-release gnupg2 curl
102102
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
103103
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
104-
sudo percona-release setup ps80
104+
# Enable tools repository first, then ps-80
105+
sudo percona-release enable-only tools release
106+
sudo percona-release enable ps-80 release
105107
sudo apt-get update
106108
107109
# Install everything else we need, and configure

go/test/endtoend/vtgate/queries/dml/dml_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,40 +88,40 @@ func TestDeleteWithLimit(t *testing.T) {
8888
defer closer()
8989

9090
// initial rows
91-
mcmp.Exec("insert into s_tbl(id, num) values (1,10), (2,10), (3,10), (4,20), (5,5), (6,15), (7,17), (8,80)")
91+
mcmp.Exec("insert into s_tbl(id, col) values (1,10), (2,10), (3,10), (4,20), (5,5), (6,15), (7,17), (8,80)")
9292
mcmp.Exec("insert into order_tbl(region_id, oid, cust_no) values (1,1,4), (1,2,2), (2,3,5), (2,4,55)")
9393

9494
// check rows
95-
mcmp.AssertMatches(`select id, num from s_tbl order by id`,
95+
mcmp.AssertMatches(`select id, col from s_tbl order by id`,
9696
`[[INT64(1) INT64(10)] [INT64(2) INT64(10)] [INT64(3) INT64(10)] [INT64(4) INT64(20)] [INT64(5) INT64(5)] [INT64(6) INT64(15)] [INT64(7) INT64(17)] [INT64(8) INT64(80)]]`)
9797
mcmp.AssertMatches(`select region_id, oid, cust_no from order_tbl order by oid`,
9898
`[[INT64(1) INT64(1) INT64(4)] [INT64(1) INT64(2) INT64(2)] [INT64(2) INT64(3) INT64(5)] [INT64(2) INT64(4) INT64(55)]]`)
9999

100100
// delete with limit
101-
qr := mcmp.Exec(`delete from s_tbl order by num, id limit 3`)
101+
qr := mcmp.Exec(`delete from s_tbl order by col, id limit 3`)
102102
require.EqualValues(t, 3, qr.RowsAffected)
103103

104104
qr = mcmp.Exec(`delete from order_tbl where region_id = 1 limit 1`)
105105
require.EqualValues(t, 1, qr.RowsAffected)
106106

107107
// check rows
108-
mcmp.AssertMatches(`select id, num from s_tbl order by id`,
108+
mcmp.AssertMatches(`select id, col from s_tbl order by id`,
109109
`[[INT64(3) INT64(10)] [INT64(4) INT64(20)] [INT64(6) INT64(15)] [INT64(7) INT64(17)] [INT64(8) INT64(80)]]`)
110110
// 2 rows matches but limit is 1, so any one of the row can remain in table.
111111
mcmp.AssertMatchesAnyNoCompare(`select region_id, oid, cust_no from order_tbl order by oid`,
112112
`[[INT64(1) INT64(2) INT64(2)] [INT64(2) INT64(3) INT64(5)] [INT64(2) INT64(4) INT64(55)]]`,
113113
`[[INT64(1) INT64(1) INT64(4)] [INT64(2) INT64(3) INT64(5)] [INT64(2) INT64(4) INT64(55)]]`)
114114

115115
// delete with limit
116-
qr = mcmp.Exec(`delete from s_tbl where num < 20 limit 2`)
116+
qr = mcmp.Exec(`delete from s_tbl where col < 20 limit 2`)
117117
require.EqualValues(t, 2, qr.RowsAffected)
118118

119119
qr = mcmp.Exec(`delete from order_tbl limit 5`)
120120
require.EqualValues(t, 3, qr.RowsAffected)
121121

122122
// check rows
123-
// 3 rows matches `num < 20` but limit is 2 so any one of them can remain in the table.
124-
mcmp.AssertMatchesAnyNoCompare(`select id, num from s_tbl order by id`,
123+
// 3 rows matches `col < 20` but limit is 2 so any one of them can remain in the table.
124+
mcmp.AssertMatchesAnyNoCompare(`select id, col from s_tbl order by id`,
125125
`[[INT64(4) INT64(20)] [INT64(7) INT64(17)] [INT64(8) INT64(80)]]`,
126126
`[[INT64(3) INT64(10)] [INT64(4) INT64(20)] [INT64(8) INT64(80)]]`,
127127
`[[INT64(4) INT64(20)] [INT64(6) INT64(15)] [INT64(8) INT64(80)]]`)
@@ -133,7 +133,7 @@ func TestDeleteWithLimit(t *testing.T) {
133133
mcmp.Exec(`delete from order_tbl limit 5`)
134134

135135
// try with limit again on empty table.
136-
qr = mcmp.Exec(`delete from s_tbl where num < 20 limit 2`)
136+
qr = mcmp.Exec(`delete from s_tbl where col < 20 limit 2`)
137137
require.EqualValues(t, 0, qr.RowsAffected)
138138

139139
qr = mcmp.Exec(`delete from order_tbl limit 5`)

go/test/endtoend/vtgate/queries/dml/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func start(t *testing.T) (utils.MySQLCompare, func()) {
132132
_, _ = utils.ExecAllowError(t, mcmp.VtConn, "set workload = oltp")
133133

134134
tables := []string{
135-
"s_tbl", "num_vdx_tbl", "user_tbl", "order_tbl", "oevent_tbl", "oextra_tbl",
135+
"s_tbl", "num_vdx_tbl", "col_vdx_tbl", "user_tbl", "order_tbl", "oevent_tbl", "oextra_tbl",
136136
"auto_tbl", "oid_vdx_tbl", "unq_idx", "nonunq_idx", "u_tbl", "mixed_tbl", "lkp_map_idx", "j_tbl", "j_utbl",
137137
}
138138
for _, table := range tables {

go/test/endtoend/vtgate/queries/dml/sharded_schema.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ create table s_tbl
22
(
33
id bigint,
44
num bigint,
5+
col bigint,
6+
unique key (num),
57
primary key (id)
68
) Engine = InnoDB;
79

@@ -12,6 +14,14 @@ create table num_vdx_tbl
1214
primary key (num)
1315
) Engine = InnoDB;
1416

17+
create table col_vdx_tbl
18+
(
19+
col bigint,
20+
id bigint,
21+
keyspace_id varbinary(20),
22+
primary key (col, id)
23+
) Engine = InnoDB;
24+
1525
create table user_tbl
1626
(
1727
id bigint,

go/test/endtoend/vtgate/queries/dml/vschema.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@
99
"params": {
1010
"table": "num_vdx_tbl",
1111
"from": "num",
12-
"to": "keyspace_id"
12+
"to": "keyspace_id",
13+
"ignore_nulls": "true"
14+
},
15+
"owner": "s_tbl"
16+
},
17+
"col_vdx": {
18+
"type": "consistent_lookup",
19+
"params": {
20+
"table": "col_vdx_tbl",
21+
"from": "col,id",
22+
"to": "keyspace_id",
23+
"ignore_nulls": "true"
1324
},
1425
"owner": "s_tbl"
1526
},
@@ -63,6 +74,10 @@
6374
{
6475
"column": "num",
6576
"name": "num_vdx"
77+
},
78+
{
79+
"columns": ["col", "id"],
80+
"name": "col_vdx"
6681
}
6782
]
6883
},
@@ -74,6 +89,14 @@
7489
}
7590
]
7691
},
92+
"col_vdx_tbl": {
93+
"column_vindexes": [
94+
{
95+
"column": "col",
96+
"name": "hash"
97+
}
98+
]
99+
},
77100
"user_tbl": {
78101
"auto_increment": {
79102
"column": "id",

test/templates/cluster_endtoend_test.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ jobs:
103103
sudo apt-get install -y lsb-release gnupg2 curl
104104
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
105105
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
106-
sudo percona-release setup ps80
106+
# Enable tools repository first, then ps-80
107+
sudo percona-release enable-only tools release
108+
sudo percona-release enable ps-80 release
107109
sudo apt-get update
108110
109111
# Install everything else we need, and configure

0 commit comments

Comments
 (0)