Bug #12402 Variable names ending with numeric characters are processed incorrectly
Submitted: 5 Aug 2005 15:41 Modified: 23 Aug 2005 15:58
Reporter: Sebastian Kugler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.13 OS:Windows (Win XP SP2)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[5 Aug 2005 15:41] Sebastian Kugler
Description:
If you use the "Past Clipboard Content as PHP Code" function with a query containing the same variable two times, MySQL Query Browser adds two local params, adding a trailing "1" at the second occurrence. However, when parsing the query, the "1" is not recognised as belonging to the variable name, but to the query, so the query sent to the server will contain the value of the first variable, followed by the "1".

How to repeat:
Copy the following query to the clipboard
SELECT a FROM b WHERE c=$var AND d=$var 

Paste it into the query area using "Paste clipboard content as PHP code"

The $vars will be replaced by :var and :var1, Local Params will be added.

Set the :var to 1 and :var1 to 2 and execute the query.

The query being sent to the server will be
"SELECT a FROM b WHERE c=1 AND d=11"

instead of
"SELECT a FROM b WHERE c=1 AND d=2"
[23 Aug 2005 15:58] Vladimir Kolesnikov
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 bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html