Skip to content

varbinary fields are presented as unicode instead of hex #9554

@glennmatthews

Description

@glennmatthews

This may be related to #8893?

I'm noticing with Dolt 1.57.0 that varbinary fields are defaulting to being rendered as unicode strings (which naturally doesn't render very well when they are binary data rather than strings) instead of as hexadecimal as they are in MySQL.

MySQL:

mysql> select network from ipam_prefix limit 10;
+------------------+
| network          |
+------------------+
| 0x0A000000       |
| 0x0A000000       |
| 0x0A004000       |
| 0x0A008000       |
| 0x0A00C000       |
| 0x0A010000       |
| 0x0A010000       |
| 0x0A014000       |
| 0x0A018000       |
| 0x0A020000       |
+------------------+
10 rows in set (0.00 sec)
mysql> select HEX(network) from ipam_prefix limit 10;
+--------------+
| HEX(network) |
+--------------+
| 0A000000     |
| 0A000000     |
| 0A004000     |
| 0A008000     |
| 0A00C000     |
| 0A010000     |
| 0A010000     |
| 0A014000     |
| 0A018000     |
| 0A020000     |
+--------------+
10 rows in set (0.00 sec)

Dolt:

> SELECT network FROM ipam_prefix limit 10;
+------------------+
| network          |
+------------------+
�   �        |
| 
�              |
| 
               |
�            |
| 
 �              |
| 
               |
| 
�              |
�            |
| 
�              |
| 
�             |
+------------------+
10 rows in set (0.002 sec)
> SELECT HEX(network) FROM ipam_prefix limit 10;
+----------------------------------+
| HEX(network)                     |
+----------------------------------+
| 20010DB8000000028000000000000000 |
| 0A1DC000                         |
| 0A0E0000                         |
| 20010DB8000000020000000000000000 |
| 0A00C000                         |
| 0A180000                         |
| 0A108000                         |
| 20010DB8000000130000000000000000 |
| 0A068000                         |
| 0A1B8000                         |
+----------------------------------+
10 rows in set (0.001 sec)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcorrectnessWe don't return the same result as MySQLcustomer issuesqlIssue with SQL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions