Bug #32941 feature to use --hex-blob and --tab together in mysqldump

Submitted: 3 Dec 2007 18:54
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[3 Dec 2007 18:54] Shane Bester
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';
[9 Mar 2021 3:29] Adam Coulter
Is anyone going to look at this?
[11 Mar 2021 0:39] Kenny Gryp
@Adam Coulter: Please try MySQL Shel Dump/Load. It creates tsv files and also ensures binary data is readable.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.