Description:
mysqldump has two options which currently cannot be used together, although they might be usefully used. They are:
--hex-blob Dump binary strings (BINARY, VARBINARY, BLOB) in
hexadecimal format.
-T, --tab=name Creates tab separated textfile for each table to given
path. (creates .sql and .txt files). NOTE: This only
works if mysqldump is run on the same machine as the
mysqld daemon.
--tab causes the server to write the file directly by using SELECT * FROM .. INTO OUTFILE ...
However, then the capability of producing a human-readable dump with blob data is completely lost.
How to repeat:
use test;
drop table if exists `t1`;
create table `t1`(`a` blob)engine=myisam;
insert into `t1` set `a`=0x1234567890;
mysqldump --hex-blob --tab=/tmp test t1
view t1.txt and note the file is written directly:
E:\mysql-5.1.22-rc-win32\bin>type e:\tmp\t1.txt
↕4VxÉ
Suggested fix:
would be nice to have it written like this:
0x1234567890
This would mean mysqldump would need to examine the columns for the table, and construct the correct SELECT .. INTO OUTFILE query. Something like:
SELECT CONCAT('0x',HEX(`a`)) FROM `t1` INTO OUTFILE '/tmp/t1.txt';
Description: mysqldump has two options which currently cannot be used together, although they might be usefully used. They are: --hex-blob Dump binary strings (BINARY, VARBINARY, BLOB) in hexadecimal format. -T, --tab=name Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon. --tab causes the server to write the file directly by using SELECT * FROM .. INTO OUTFILE ... However, then the capability of producing a human-readable dump with blob data is completely lost. How to repeat: use test; drop table if exists `t1`; create table `t1`(`a` blob)engine=myisam; insert into `t1` set `a`=0x1234567890; mysqldump --hex-blob --tab=/tmp test t1 view t1.txt and note the file is written directly: E:\mysql-5.1.22-rc-win32\bin>type e:\tmp\t1.txt ↕4VxÉ Suggested fix: would be nice to have it written like this: 0x1234567890 This would mean mysqldump would need to examine the columns for the table, and construct the correct SELECT .. INTO OUTFILE query. Something like: SELECT CONCAT('0x',HEX(`a`)) FROM `t1` INTO OUTFILE '/tmp/t1.txt';