Skip to content

Commit 157497f

Browse files
committed
Minor changes from self review
Signed-off-by: Matt Lord <mattalord@gmail.com>
1 parent 6616100 commit 157497f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

go/test/endtoend/vreplication/config_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ import (
4545
// default collation as it has to work across versions and the 8.0 default does not exist in 5.7.
4646
var (
4747
// All standard user tables should have a primary key and at least one secondary key.
48-
customerTypes = []string{"'individual'", "'soho'", "'enterprise'"}
48+
customerTypes = []string{"'individual'", "'soho'", "'enterprise'"}
49+
// We use utf8mb4_general_ci so that we can test with 5.7 and 8.0+.
4950
customerTableTemplate = `create table customer(cid int auto_increment, name varchar(128) collate utf8mb4_general_ci, meta json default null,
5051
industryCategory varchar(100) generated always as (json_extract(meta, _utf8mb4'$.industry')) virtual, typ enum(%s),
5152
sport set('football','cricket','baseball'), ts timestamp not null default current_timestamp, bits bit(2) default b'11', date1 datetime not null default '0000-00-00 00:00:00',

go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func (rs *rowStreamer) buildSelect(st *binlogdatapb.MinimalTable) (string, error
286286
indexHint = fmt.Sprintf(" force index (%s)", escapedPKIndexName)
287287
}
288288
buf.Myprintf(" from %v%s", sqlparser.NewIdentifierCS(rs.plan.Table.Name), indexHint)
289-
if len(rs.lastpk) != 0 { // We're in the copy phase and need to resume
289+
if len(rs.lastpk) != 0 { // We're in Nth copy phase cycle and need to resume
290290
if len(rs.lastpk) != len(rs.pkColumns) {
291291
return "", fmt.Errorf("cannot build a row streamer plan for the %s table as a lastpk value was provided and the number of primary key values within it (%v) does not match the number of primary key columns in the table (%d)",
292292
st.Name, rs.lastpk, rs.pkColumns)
@@ -310,14 +310,13 @@ func (rs *rowStreamer) buildSelect(st *binlogdatapb.MinimalTable) (string, error
310310
for i, pk := range rs.pkColumns[:lastcol] {
311311
buf.Myprintf("%v = ", sqlparser.NewIdentifierCI(rs.plan.Table.Fields[pk].Name))
312312
rs.lastpk[i].EncodeSQL(buf)
313-
// Only AND expressions are supported.
314313
buf.Myprintf(" and ")
315314
}
316315
buf.Myprintf("%v > ", sqlparser.NewIdentifierCI(rs.plan.Table.Fields[rs.pkColumns[lastcol]].Name))
317316
rs.lastpk[lastcol].EncodeSQL(buf)
318317
buf.Myprintf(")")
319318
}
320-
} else if len(rs.plan.whereExprsToPushDown) > 0 { // We're in the running/replicating phase
319+
} else if len(rs.plan.whereExprsToPushDown) > 0 { // We're in the first copy phase cycle
321320
buf.Myprintf(" where ")
322321
addPushdownExpressions()
323322
}

0 commit comments

Comments
 (0)