Bug #81208 Workbench truncates hexadecimal values when showing CREATE VIEW code
Submitted: 27 Apr 2016 8:22 Modified: 19 May 2016 0:34
Reporter: q q Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.3.6.511 OS:Windows (7)
Assigned to: CPU Architecture:Any
Tags: ALTER VIEW, Hexadecimal, truncate

[27 Apr 2016 8:22] q q
Description:
When viewing the code for an existing VIEW, hexadecimal values are truncated (so are wrong), and the "0x" becomes "0X" (so the  VIEW doesn't save anyway). Both these issues have to be corrected by the user manually. If only the "0X" bug is corrected, the hex values saved will validate, but be wrong, leading to subsequent queries based on the VIEW providing incorrect data. It is for this latter reason that I've marked it as S2 Serious.

How to repeat:
(1) In Workbench, navigate to the schema test | Views.
(2) Right-click Views, Create Views...
(3) Edit the view so it reads:
CREATE VIEW `new_view` AS SELECT 0x1234 test1, 0x1234567890ABCDEF test2
(4) Click Apply
(5) Note that the review dialog shows the correct view:
USE `test`;
CREATE  OR REPLACE VIEW `new_view` AS SELECT 0x1234 test1, 0x1234567890ABCDEF test2;
(6) Click Apply
(7) Click Finish
(8) Note that the page now shows the incorrect view, with truncated hex values and capitalised "0X"s:
CREATE
    ALGORITHM = UNDEFINED
    DEFINER = `root`@`localhost`
    SQL SECURITY DEFINER
VIEW `test`.`new_view` AS
    SELECT 0X12 AS `test1`, 0X1234567890ABCD AS `test2`

Suggested fix:
Modify treatment of hex values when displaying them so that the correct values & formatting is retained.
[27 Apr 2016 8:55] MySQL Verification Team
Hello!

Thank you for the report.
Observed this with WB 6.3.6 on Win7.

Thanks,
Umesh
[19 May 2016 0:34] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.7 release, and here's the changelog entry:

When viewing the code for an existing view (SQL to create the view),
hexadecimal values were truncated.

Thank you for the bug report.