Bug #77558 Per datatype renderer
Submitted: 30 Jun 2015 8:42 Modified: 17 Jul 2015 11:13
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[30 Jun 2015 8:42] Daniël van Eeden
Description:
An "SELECT * FROM footable LIMIT 1\G" can be destructive to the terminal session if one or more columns contain binary data.

To make this safer and more useful it would be nice to be able to set a renderer per data type.
e.g.
[mysql]
renderer_type="blob=HEX,varbinary=HEX"
renderer_column_regex=".*photo=EXIF_SUMMARY"

How to repeat:
See description
[30 Jun 2015 8:53] Daniël van Eeden
This is how psql does it:
postgres=# CREATE TABLE t1 (ip cidr, foo bytea);
CREATE TABLE
postgres=# INSERT INTO t1 VALUES('127.0.0.1', E'\\001');
INSERT 0 1
postgres=# INSERT INTO t1 VALUES('127.0.0.2', E'\\002');
INSERT 0 1
postgres=# SELECT * FROM t1;
      ip      | foo  
--------------+------
 127.0.0.1/32 | \x01
 127.0.0.2/32 | \x02
(2 rows)

postgres=# SHOW bytea_output;                                                                           bytea_output 
--------------
 hex
(1 row)

postgres=# SET bytea_output=escape;
SET
postgres=# SELECT * FROM t1;
      ip      | foo  
--------------+------
 127.0.0.1/32 | \001
 127.0.0.2/32 | \002
(2 rows)
[18 Jun 2016 21:26] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0