Page MenuHomePhabricator

Since MySQL 8.0.19, the MySQL client displays "VARBINARY" columns, including PHIDs, in hex
Open, WishlistPublic

Description

Recent versions of the MySQL CLI client show many Phabricator tables like this:

mysql> select * from edge;
+----------------------------------------------------------------+------+----------------------------------------------------------------+-------------+-----+--------+
| src                                                            | type | dst                                                            | dateCreated | seq | dataID |
+----------------------------------------------------------------+------+----------------------------------------------------------------+-------------+-----+--------+
| 0x504849442D50524F4A2D63797878756D7274796873767079333666747A76 |   13 | 0x504849442D555345522D346834633370786D6F6B6A767972767A64666361 |  1610739241 |   0 |   NULL |
| 0x504849442D50524F4A2D63797878756D7274796873767079333666747A76 |   60 | 0x504849442D555345522D346834633370786D6F6B6A767972767A64666361 |  1610739241 |   0 |   NULL |
+----------------------------------------------------------------+------+----------------------------------------------------------------+-------------+-----+--------+
2 rows in set (0.01 sec)

This is undesirable. Older versions of the client show this:

mysql> select * from edge;
+--------------------------------+------+--------------------------------+-------------+-----+--------+
| src                            | type | dst                            | dateCreated | seq | dataID |
+--------------------------------+------+--------------------------------+-------------+-----+--------+
| PHID-PROJ-cyxxumrtyhsvpy36ftzv |   13 | PHID-USER-4h4c3pxmokjvyrvzdfca |  1610739241 |   0 |   NULL |
| PHID-PROJ-cyxxumrtyhsvpy36ftzv |   60 | PHID-USER-4h4c3pxmokjvyrvzdfca |  1610739241 |   0 |   NULL |
+--------------------------------+------+--------------------------------+-------------+-----+--------+
2 rows in set (0.01 sec)

You can set this in my.cnf to get the old behavior:

[mysql]
skip_binary_as_hex

See the documentation for --binary-as-hex for context:

https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html#option_mysql_binary-as-hex

It may be appropriate to specify this flag in, e.g., bin/storage shell, although it likely did not exist until recentish versions of MySQL.

Generally, there's probably not much to be done about this and this is more of an informational task than an actionable one.

Event Timeline

epriestley triaged this task as Wishlist priority.Jan 27 2021, 10:38 PM
epriestley created this task.