Bug #40773 Query Browser does not display BINARY column data correctly
Submitted: 17 Nov 2008 5:42 Modified: 19 Oct 2009 12:50
Reporter: Christopher Jerdonek Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.14 OS:Windows (XP SP3)
Assigned to: CPU Architecture:Any
Tags: BINARY, CHECKED, editor, hex, Hexadecimal, popup, query browser

[17 Nov 2008 5:42] Christopher Jerdonek
Description:
MySQL Query Browser doesn't seem to display column data for BINARY columns correctly -- in both the normal column view of the Resultset tab, and the Binary tab of the Field Viewer.

For example, consider the binary data 0xDDDD in a BINARY(2) column.

In the Binary tab of the Query Browser's Field Viewer, this shows up as "C3 9D" in the left pane rather than as "DD DD".

Moreover, the column view of the Resultset tab renders this as a string with one character rather than as string with two characters (the same character repeated twice).

How to repeat:
USE test;

CREATE TABLE `test`.`test_table` (
  `test_column` BINARY(2) NOT NULL DEFAULT 0
)
ENGINE = MyISAM;

INSERT INTO test_table VALUES (0x3434), (0xDDDD);

In Query Browser:

SELECT HEX(test_column), test_column FROM test_table;

In Query Browser, this will show up as (the "Y" is an approximation of the actual character shown):

+------------------+-------------+
| HEX(test_column) | test_column |
+------------------+-------------+
| 3434             | 44          |
| DDDD             | Y           |
+------------------+-------------+

If you right-click the "Y" cell and "View field in Pop-up Editor," the Binary tab will show this cell as "C3 9D" rather than "DD DD".

Thanks.
[17 Nov 2008 5:48] Christopher Jerdonek
How Query Browser displays 0xDDDD in column view and in Popup Editor

Attachment: query_browser_binary.png (image/png, text), 22.82 KiB.

[17 Nov 2008 7:44] Valeriy Kravchuk
Verified just as described. 

SHOW VARIABLES LIKE 'char%' returns all utf8 (only character-set_filesystem=binary) in my environment.
[9 Jan 2009 10:08] Christopher Jerdonek
To refine the suggestions above for correct behavior--

It might be better if the default column view of the Resultset tab also renders BINARY data as a string of hex characters (i.e. as if the HEX function were applied), and not just the left pane of the Binary Tab of Pop-up Editor.  This is because the current behavior displays BINARY data rendered as Latin1.

The problem with using Latin1 to render BINARY is that not every pair of hexadecimal digits has a corresponding Latin1 representation.  (This is even more true when we consider that not every Latin1 character has a printable representation.)

So I would recommend that hexadecimal digits be used in the Resultset tab as well.  Thanks.
[19 Oct 2009 12:50] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Query Browser into MySQL Workbench. We won't fix this anymore.

More informations about MySQL Workbench you will find here:

http://dev.mysql.com/workbench/