Bug #6501 Fails to load "binary" queries
Submitted: 8 Nov 2004 18:56 Modified: 12 Nov 2004 2:03
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.1 OS:Linux (Debian/Linux)
Assigned to: Alfredo Kojima CPU Architecture:Any

[8 Nov 2004 18:56] [ name withheld ]
Description:
Fails to load script files. For example, the following does not load (silent fail),

# cat /tmp/c.sql

INSERT INTO `update_connections` VALUES ('127.0.0.1','i2…éCíý•Šg?ä`eG€ŽBáxt»','test','0.0.1','1.0',20041015233902),('127.0.0.1','œà’2n+ŒŽ2ìŸô€Ù«Â¢zci$4gÕ«KÛžµÀºÊžIÊ-ì4áób¡‡Qzïž6¥ØAêYÅ-C4âT/À~w5.©=]ë£óC~ð/ñKÕežÅXlŸªËŠÜÓ™cÍ£cÜàŒˆ7«6X•³A—ì?€ÜÞ68LGä¡sÌ_„¹„`š-\r\'Lj™ÿ-oLã“#ö¢]ŽÁ›ѯ’@ƒ2’„=‹ÊÁ)%bAõƺü§%ÀÜš+ôu­S ø.WÈ¿Ý)?^9\Z¥t ëÍ*ãY\nÅ¥H\'îÿŠDQ0àÈïÔ#ËƘ€(ñÈJBÌ’Ÿ','test','0.0.1','1.0',20041015234001);

This is all on one line, part of a result generated with mysqldump.

How to repeat:
Save the above into a file and try to load the script. The script will not load - fails silently.
[8 Nov 2004 18:57] [ name withheld ]
Same file as in report

Attachment: c.sql (text/x-sql), 424 bytes.

[8 Nov 2004 20:16] [ name withheld ]
The query is also attached in Files (c.sql)
[9 Nov 2004 12:46] MySQL Verification Team
Hi,

Thank you for the report. Could you also provide the structure of  the 'update_connections' table?
[10 Nov 2004 23:03] [ name withheld ]
Here's the structure of update_connections. But the problem with mysql-admin is that the file (see Files section), doesn't even open with Load Script. A blank script is displayed.

Oh, and the path is wrong for loaded scripts. If I Load Script /tmp/c.sql, the tab will display /c.sql. I think it should either be a full patch, or just the file name without the /

-- MySQL dump 9.11
--
-- Host: localhost    Database: site
-- ------------------------------------------------------
-- Server version       4.0.22-log

--
-- Table structure for table `update_connections`
--

CREATE TABLE `update_connections` (
  `ip` varchar(64) NOT NULL default '',
  `str` varchar(255) binary NOT NULL default '',
  `app` varchar(128) NOT NULL default '',
  `version` varchar(16) NOT NULL default '',
  `protocol` varchar(5) NOT NULL default '',
  `ts` timestamp(14) NOT NULL
) TYPE=HEAP ROW_FORMAT=DYNAMIC;
[12 Nov 2004 2:03] Alfredo Kojima
The text widget used to display text only supports UTF-8, so there's no way binary data could be displayed correctly. I have added a check to the script loader, so that it will ask for the file encoding if it's not UTF-8 and convert it. 

In this case (a binary string in the query) it will not load the file at all, but at least it will now display an error dialog stating why.