Skip to content

Commit

Permalink
Merge pull request #17 from YANGGMM/fix-2092-2
Browse files Browse the repository at this point in the history
fix dump blob data
  • Loading branch information
YANGGMM authored Jan 22, 2024
2 parents 9f04411 + 506098d commit 92aa10a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 1 addition & 6 deletions cmd/mo-dump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,7 @@ func showInsert(r *sql.Rows, args []any, cols []*Column, tbl string, bufPool *sy
if ret == nil {
curBuf.WriteString("NULL")
}
for _, b := range ret {
if b == zeroByte || b == lineByte || b == carriageByte || b == tabularByte {
curBuf.WriteString(fmt.Sprintf("%X", zeroByte))
}
curBuf.WriteString(fmt.Sprintf("%X", b))
}
curBuf.WriteString(fmt.Sprintf("%X", ret))
} else {
curBuf.WriteString(convertValue(v, cols[i].Type))
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/mo-dump/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const (
//default Field delimiter (set to ',')
defaultFieldDelimiter rune = ','
blobPrefix = "0x"
zeroByte = '\x00'
lineByte = '\n'
carriageByte = '\r'
tabularByte = '\t'
// zeroByte = '\x00'
// lineByte = '\n'
// carriageByte = '\r'
// tabularByte = '\t'
)

const (
Expand Down

0 comments on commit 92aa10a

Please sign in to comment.