Bug #34606 MySQL Query Browser crashes after copy-paste binary data in query field
Submitted: 15 Feb 2008 17:27 Modified: 26 May 2009 13:15
Reporter: Bernhard Häussner Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:5.0r12 OS:Linux (openSUSE 10.3 (X86-64))
Assigned to: CPU Architecture:Any
Tags: binary data, copypaste, history

[15 Feb 2008 17:27] Bernhard Häussner
Description:
After once inserting a query with binary data via copy-paste from some AES_ENCRYPT()-encrypted text, MySQL Query Browser crashes after entering your connection details:

amoebe@dhcppc3:~> /usr/bin/mysql-query-browser
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
/usr/bin/mysql-query-browser: line 103: 17936 Abgebrochen             $PRG-bin $args

(Abgebrochen means Aborted in english)

To fix this i have edited my /home/amoebe/.mysqlgui/query-browser/history.xml. I deleted the entries with empty <sql></sql>. 

Using QB again everything worked fine. 

I have used the following configuration:

amoebe@dhcppc3:~> rpm -q mysql-query-browser-5.0r12-56.2 -i
Name        : mysql-query-browser          Relocations: (not relocatable)
Version     : 5.0r12                            Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 56.2                          Build Date: Di 27 Nov 2007 19:39:44 CET
Install Date: Fr 15 Feb 2008 18:01:50 CET      Build Host: d27.suse.de
Group       : Productivity/Databases/Clients   Source RPM: mysql-gui-tools-5.0r12-56.2.src.rpm
Size        : 6515907                          License: GPL v2 or later
Signature   : DSA/SHA1, Di 27 Nov 2007 19:43:07 CET, Key ID a84edae89c800aca
Packager    : http://bugs.opensuse.org
URL         : http://www.mysql.com/products/tools/query-browser/
Summary     : A Graphical MySQL Query Shell
Description :
MySQL Query Browser is a GUI tool for executing SQL queries. It
displays the result in a list where you can edit its contents and save.
It has several auxiliary features to facilitate work, such as query
"bookmarking", query history, syntax highlighting, and online help.

It is part of the MySQL Developer Suite.
Distribution: openSUSE 10.3 (X86-64)

How to repeat:
SELECT AES_ENCRYPT('xxx','yyy');

then copy the field value and insert it into another query like
SELECT AES_DECRYPT('[paste here]','yyy');

execute, close QB and reopen. After connecting it should crash. 

Suggested fix:
It would be nice if you could include some testing to work around that, because empty history entries are nonsense and make QB crash. 

Maybe think about handling binary-data.
[15 Feb 2008 23:32] MySQL Verification Team
Thank you for the bug repiort.

[miguel@mira mysql-gui-tools-5.0]$ ./mysql-query-browser
/usr/share/themes/Nodoka/gtk-2.0/gtkrc:35: error: unexpected character `(', expected character `}'
Fontconfig warning: line 32: unknown element "cachedir"
Fontconfig warning: line 33: unknown element "cachedir"
Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 18: invalid match target "scan"
xmlEscapeEntities : char out of range
[miguel@mira mysql-gui-tools-5.0]$ ./mysql-query-browser
/usr/share/themes/Nodoka/gtk-2.0/gtkrc:35: error: unexpected character `(', expected character `}'
Fontconfig warning: line 32: unknown element "cachedir"
Fontconfig warning: line 33: unknown element "cachedir"
Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 18: invalid match target "scan"
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
./mysql-query-browser: line 103:  5336 Aborted                 $PRG-bin $args
[miguel@mira mysql-gui-tools-5.0]$
[26 May 2009 13:15] 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. Unfortunately you are using an unsupported platform. More informations about supported platforms you will find here:

http://www.mysql.com/support/supportedplatforms/tools.html

More informations about MySQL Workbench you will find here:

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