Bug #31120 Entering slash followed by asterisk /* in query area closes MySQL Query Browser
Submitted: 20 Sep 2007 21:32 Modified: 26 May 2009 13:14
Reporter: Diego Medina Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.12 OS:Linux (Fedora 7 i686)
Assigned to: CPU Architecture:Any

[20 Sep 2007 21:32] Diego Medina
Description:
In the middle of this query, I can enter / , but when I press the asterisk it closes.

If I start MySQL query browser from shell, after it closes I get this error:

Gtk-ERROR **: Char offset 2 is off the end of the line
aborting...
/usr/bin/mysql-query-browser: line 103: 14169 Aborted                 $PRG-bin $args

How to repeat:
You do not have to create any table, just connect to a mysql server over TPC/ip and copy and pate this query.

select altkey_items.internal_part ,altkey_items.part_number , imp_items_data.quantity_on_hand ,  altkey_items.description, imp_items.altkey 

from

imp_items

left join imp_items as altkey_items

using(altkey)

left  join imp_items_data

	on altkey_items.internal_part=imp_items_data.item_id

where 

imp_items_data.quantity_on_hand > 0
and
imp_items.altkey > 1

/*imp_items.internal_part = '138085'*/

order by imp_items.altkey

limit 6

--En of query, ok, now enter /* at the beginning of the line on the previous line to "left  join imp_items_data"

so, that section of the query looks like 
...
using(altkey)

/*  <--this is the line that will cause MySQL Query Browser to close
left  join imp_items_data

	on altkey_items.internal_part=imp_items_data.item_id

where 

imp_items_data.quantity_on_hand > 0
and
...

Suggested fix:
N/A
[20 Sep 2007 21:40] Diego Medina
I just tried to have the same error happen by coping and pasting from the bug report and it did not happen, so let me try to create a text file (I think that the problem by be some special white space or something like that)
[20 Sep 2007 22:37] Diego Medina
ok, I found a way to duplicate this bug.

Create this table

CREATE TABLE `bug` (
  `spidersonyitem_id` int(11) NOT NULL auto_increment,
  `spidersonyitem_part_number` varchar(20) NOT NULL default '',
  `spidersonyitem_html` longtext NOT NULL,
  PRIMARY KEY  (`spidersonyitem_id`),
  UNIQUE KEY `spidersonyitem_part_number` (`spidersonyitem_part_number`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

Then run this sql

INSERT INTO `bug` VALUES (1,'more','select\n\r\non\r\n\r\nwhere'),(2,'',''),(3,'more2','nada\n\nmas\n\naca');

then, copy the content of row 1, field spidersonyitem_html and paste it on the query area of mysql-query-browser,

then try to enter /* so that the query looks like

select

/*
on

where

the program has to close now.

if you use the data on the second row, the error does not happen. (Note the \r on the first row.
[21 Sep 2007 10:04] MySQL Verification Team
Thank you for the bug report. I wasn't able to repeat the issue reported
on Fedora Core 6.
[21 Sep 2007 15:41] Diego Medina
Hi again,

I tried it on Fedora Core 6 and it also happened.

Maybe I was not clear on the steps.

After you run the insert statement.

*In the query area of mysql-query-browser, run this:

SELECT spidersonyitem_html FROM bug
where spidersonyitem_id = 1

*Right click on the result area on top of the spidersonyitem_html field and select "View field on pop up editor.

*Select all, then press ctrl+c (to copy)
*Click on to close the pop up editor and then paste the content of the clipboard on the query area.

*Then type

/* on the second line so that you can have

select

/*
on

where

as soon as you enter the asterisk, mysql-query will close

P.S. I am using gnome

I hope you can repeat it now.
[13 Dec 2007 5:33] Diego Medina
how can I provide you with more details so that you try again?
[1 Apr 2008 15:46] MySQL Verification Team
Thank you for the feedback. Verified with the last to repeat instructions.
[1 Apr 2008 16:30] Diego Medina
Thanks Miguel for verifying it! I thought that work on query browser was stopped.
[26 May 2009 13:14] 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/