Skip to content

Commit

Permalink
fix binary field converting
Browse files Browse the repository at this point in the history
  • Loading branch information
whhe committed May 30, 2023
1 parent 648e302 commit 12c0dbf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.oceanbase.oms.logmessage.DataMessage;

import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -66,7 +67,11 @@ private String getFieldStringValue(DataMessage.Record.Field field) {
if (field.getValue() == null) {
return null;
}
return field.getValue().toString(field.getEncoding());
String encoding = field.getEncoding();
if ("binary".equalsIgnoreCase(encoding)) {
return Arrays.toString(field.getValue().getBytes());
}
return field.getValue().toString(encoding);
}

public SourceInfo getSourceInfo() {
Expand Down

0 comments on commit 12c0dbf

Please sign in to comment.