Bug #25757 QB executes old text, when deleted right-left selection
Submitted: 22 Jan 2007 16:54 Modified: 30 Jan 2007 14:43
Reporter: Yahoo Serious (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.9 OS:Windows (Windows 2000, XP SP2)
Assigned to: Mike Lischke CPU Architecture:Any

[22 Jan 2007 16:54] Yahoo Serious
Description:
QB seems to execute old text...

How to repeat:
- Open QB
- Paste this text in query-edit-window:
SELECT SELECT * FROM mysql.db d;
- remove the first "SELECT "
- execute
>> Note error

- Open QB
- Paste this text in query-edit-window:
EXPLAIN EXTENDED SELECT SELECT * FROM mysql.db d;
- remove the first "SELECT "
- execute
>> Note error

(NB: Ctrl-Z & Ctrl-Y & Ctrl-E do not reproduce this)

Suggested fix:
Fix it...
[22 Jan 2007 17:16] MySQL Verification Team
Thank you for the bug report. Please explain: - remove the first "SELECT "
I did selecting SELECT and then tab-back or will del key at left position
and I wasn't able to repeat. Also which error message. Thanks in advance.
[23 Jan 2007 13:48] Yahoo Serious
Okay, my analysis was wrong: this one is very tricky!

It turns out, it does not matter what you delete, but how you selected it!
If you select one of those "SELECT "-s, either one, starting at the right position, moving to the left (either with mouse or keyboard it seems), the executed text is the old one.

I can reproduce it with a legal query:
  SELECT *, Host FROM mysql.db d;
Remove ", Host" after right-to-left selection and execute.  The result will have another Host-column at the right end, just like you did not remove the text!

The mentioned error-message are the ones for the previous text, so that would be:
---
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT *, User , Db , Host  FROM mysql.db d' at line 1
---

And:
---
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM mysql.db d' at line 1
---
[26 Jan 2007 15:33] Valeriy Kravchuk
Verified just as described on XP SP2. Right-to-left selection is essential! Weird bug.
[30 Jan 2007 14:43] Mike Lischke
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html