Skip to content

Commit

Permalink
Minor changes after self review
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Sep 13, 2022
1 parent 7950f91 commit f2e94b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 1 addition & 10 deletions go/mysql/binlog_event_rbr.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,15 +652,6 @@ func CellValue(data []byte, pos int, typ byte, metadata uint16, field *querypb.F
frac0 := scale / 9 // number of 32 bits fractionals
frac0x := scale - frac0*9 // leftover fractionals

//if scale == 0 && intg0 == 0 {
// // When the field is a DECIMAL using a scale of 0, e.g.
// // DECIMAL(5,0), a binlogged value of 0 is almost treated
// // like the NULL byte and we get a 0 byte length value.
// // In this case let's return a byte value of 0.
// return sqltypes.MakeTrusted(querypb.Type_DECIMAL,
// []byte{'0'}), 4, nil
//}

l := intg0*4 + dig2bytes[intg0x] + frac0*4 + dig2bytes[frac0x]

// Copy the data so we can change it. Otherwise
Expand Down Expand Up @@ -721,7 +712,7 @@ func CellValue(data []byte, pos int, typ byte, metadata uint16, field *querypb.F
// When the field is a DECIMAL using a scale of 0, e.g.
// DECIMAL(5,0), a binlogged value of 0 is almost treated
// like the NULL byte and we get a 0 byte length value.
// In this case let's return a byte value of 0.
// In this case let's return the correct value of 0.
if txt.Len() == 0 {
txt.WriteRune('0')
}
Expand Down
2 changes: 2 additions & 0 deletions go/test/endtoend/vreplication/vreplication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ func insertInitialData(t *testing.T) {
})
}

// insertMoreCustomers creates additional customers.
// Note: this will only work when the customer sequence is in place.
func insertMoreCustomers(t *testing.T, numCustomers int) {
sql := "insert into customer (name) values "
i := 0
Expand Down

0 comments on commit f2e94b3

Please sign in to comment.