Bug #59366 # Single line commenting in snippets comments multiple lines instead
Submitted: 8 Jan 2011 11:32 Modified: 27 May 2011 21:47
Reporter: Igor Shevtsov Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.31 OS:Windows (Windows 7)
Assigned to: CPU Architecture:Any
Tags: # commenting, commenting, regression

[8 Jan 2011 11:32] Igor Shevtsov
Description:
Hi, 
We use Workbench 5.2.31 connected through SSH tunnel to the remote MySQL linux based server.
I had a snippet stored in SQL Editor which supposed to Edit specific row in the table and worked fine under the earlier Workbench versions.
The query had two comments in the middle to change the logic slightly when needed.
multiple line comment and single line comment like 

UPDATE table
set col1 = 10, col2 = NULL
/*
Multiple 
line comment here
*/
# Single comment here
WHERE id = 1

After Workbench update to 5.2.31 the query updated the whole table. WHERE clause didn't work. It looks like the end line character of the '# Single comment' line was lost or wasn't interpreted properly, which commented the rest of the query and caused a major disaster. 
Thanks.
Igor 

How to repeat:
1.Create snippet like

UPDATE table
set col1 = 10, col2 = NULL
/*
Multiple 
line comment here
*/
# Single comment here
WHERE id = 1

2. Run it on your table
[8 Jan 2011 16:43] Valeriy Kravchuk
Was this snippet created in some previous version of MySQL Workbench? I can not repeat this with a snippet created in 5.2.31.
[8 Jan 2011 16:55] Igor Shevtsov
Most likely it was created in 5.2.29 or 5.2.30.
Inside of the snippet window comments have different coloring and I was able to run it in the previous versions without any problem.

This is the report from our provider:
"The client that submitted this statement does not appear to be converting to appropriate newline characters for mysql resulting in everything after '# pending' being treated as a comment. It is also possible that this may be a side affect of the current version of MySQL which happens to be 5.0.45. Newer versions are available if you would like to consider upgrading." 
Thanks.
[27 Apr 2011 21:47] Armando Lopez Valencia
Hello Igor.
We are looking at your defect but we need a little more of information in order to reproduce it.
Can you please send us the entry of the executed query that you get on the "Output" tab with the "Actions" option selected on the dropdown?
Thanks in advance.
[27 May 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".