Skip to content

Commit

Permalink
Error nits (send halp)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Dec 21, 2024
1 parent 64e0422 commit a230cb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions go/mysql/binlog/binlog_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ func ParseBinaryJSONDiff(data []byte) (sqltypes.Value, error) {
pos = readTo
value, err := ParseBinaryJSON(data[pos : pos+valueLen])
if err != nil {
return sqltypes.Value{}, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT,
"cannot read JSON diff value for path %s: %v", path, err)
return sqltypes.Value{}, vterrors.Wrapf(err,
"cannot read JSON diff value for path %q", path)
}
pos += valueLen
if value.Type() == json.TypeString {
Expand Down
3 changes: 2 additions & 1 deletion go/test/utils/binlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package utils

import (
"errors"
"fmt"
"os"
"strconv"
Expand Down Expand Up @@ -61,7 +62,7 @@ func SetBinlogRowImageOptions(mode string, partialJSON bool, cnfDir string) erro
}
if partialJSON {
if !CIDBPlatformIsMySQL8orLater() {
return fmt.Errorf("partial JSON values are only supported in MySQL 8.0 or later")
return errors.New("partial JSON values are only supported in MySQL 8.0 or later")
}
// We're testing partial binlog row images so let's also test partial
// JSON values in the images.
Expand Down

0 comments on commit a230cb1

Please sign in to comment.