Bug 36594

Summary: Syntax error in SQL on "--" comment
Product: LibreOffice Reporter: Andreas Becker <atayoohoo>
Component: BaseAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: erack, jengab, lionel
Priority: medium    
Version: 3.4.0 Beta2   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Andreas Becker 2011-04-25 14:31:43 UTC
The -- comment is supposed to comment the rest of the line, but it works only if a complete line is commented.
Example:

> -- comment
> SELECT * from tbl

works, but

> SELECT * from tbl -- comment
produces a syntax error.

The syntax highlighting displays "-- comment" as a comment in both cases.

How to get to the SQL editor: lobase → Queries → Create Query in SQL View.
Comment 1 ribotb 2011-06-18 04:35:32 UTC
Hi,

I can't confirm with LibO 341 under Windows 7 SP1. It works.

Bernard Ribot
Comment 2 Gabor Jenei 2011-08-15 03:16:14 UTC
On Debian 6 32bit with version 3.5 it's confirmed
Comment 3 Eike Rathke 2011-09-02 16:36:41 UTC
Fixed on master http://cgit.freedesktop.org/libreoffice/core/commit/?id=bc0a497f08d52450fd74c6372c9f6780f6715e40

Note that preserving comments is a bit ugly if the original query consisted of more than one lines. All comments are appended to the the resulting one-line query.
Comment 4 Lionel Elie Mamane 2012-01-11 13:47:40 UTC
*** Bug 42711 has been marked as a duplicate of this bug. ***
Comment 5 Lionel Elie Mamane 2012-01-11 13:56:03 UTC
(In reply to comment #3)

> Note that preserving comments is a bit ugly if the original query consisted of
> more than one lines. All comments are appended to the the resulting one-line
> query.

With current libreoffice-3-5, comments seem to be discarded. When I create a query in SQL view with comments, then go to design view and back to SQL view, all comments have disappeared. However, the code introduced in c0a497f08d52450fd74c6372c9f6780f6715e40 seems not to have been touched. Any explanation / idea?