diff --git a/go/mysql/binlog_event_rbr.go b/go/mysql/binlog_event_rbr.go index 356aac1bf9d..3403be27579 100644 --- a/go/mysql/binlog_event_rbr.go +++ b/go/mysql/binlog_event_rbr.go @@ -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 @@ -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') } diff --git a/go/test/endtoend/vreplication/vreplication_test.go b/go/test/endtoend/vreplication/vreplication_test.go index 48f78a2809c..78c238cddd0 100644 --- a/go/test/endtoend/vreplication/vreplication_test.go +++ b/go/test/endtoend/vreplication/vreplication_test.go @@ -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