Bug #34040 Comments not terminated at end of line when pasted from BBEdit
Submitted: 24 Jan 2008 18:25 Modified: 25 Feb 2008 11:00
Reporter: Peter Ripley Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.12 OS:MacOS (10.5.2)
Assigned to: CPU Architecture:Any

[24 Jan 2008 18:25] Peter Ripley
Description:
When I paste an SQL statement that contains comments into the Query Browser query field, the comments are not terminated.

Specifically using either -- or # causes Query Browser to treat  the entire SQL statement as a comment from the point of the comment forward, instead of terminating the comment at a line break as expected.

This only happens when the comments are pasted in to the query field.  When they are keyed directly the comments are terminated at the line ending as expected.

I have produced this unexpected behavior only when pasting from BBEdit.  I believe that this might be an issue with the way that BBEdit handles cr/lf.  But have tried all 4 possible cr/lf settings in BBEdit with the same result

Mac [CR]
Unix [LF]
Windows [CRLF]
Unicode

How to repeat:
Copy the following text from BBEdit and paste in Query Browser's query field :

SELECT id,
2, -- some comment
3, -- another comment
FROM sometable

Notice that the entire 3rd and 4th lines are treated as comments.

Suggested fix:
WORK AROUNDS:

1. Use a different text editor: When I try the same text from Word (not a suitable workaround) or from SubEthaEdit (acceptable workaround). Query browser handles single line comments as expected.

2. Use a different comment style: comments of the style /* comment here */ are terminated as expected when pasted from BBEdit.

I am also going to direct the good folks at Bare Bones to look at this bug report.
[24 Jan 2008 18:27] Peter Ripley
Version of BBEdit is 8.7.2
[25 Jan 2008 11:00] Sveta Smirnova
Thank you for the report.

Could you please provide screenshot of MySQL Query Browser with just pasted problem query and save this query in BBEdit as text file and send us?
[26 Feb 2008 0: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".