mysql binlog output file is ambiguous?

269 Views Asked by At

I use

mysqlbinlog -f -v --base64-output=DECODE-ROWS mysql-bin.00001 > res.000001

my table has a column is varbinary. So res.000001 like this

### UPDATE db.tbl
### WHERE
###   @1=967540772
###   @2='\x10\x00c\x01\x00%...'
### SET
###   @1=967540772
###   @2='\x10\x001\x00\x00,...'

I found binlog will convert invisible characters to hex( e.g. "\n", "\r"), normal characters will be printed directly( e.g."%", "a"). There is something wrong. If this column is "\x10", binlog will output"\x10" (we call case 1), if this column is the character these hex also is "0x10", binlog will output "\x10" TOO (we call case 2). So I can not talk the difference between these string.

In case 1, I think binlog should output "\x10" to escape backslash. Is this bug of mysql binlog?

0

There are 0 best solutions below