This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204153 - mysql '--' (double dash) comments need a space to be valid
Summary: mysql '--' (double dash) comments need a space to be valid
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 7.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-24 12:12 UTC by nb_johan1
Modified: 2011-10-27 14:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nb_johan1 2011-10-24 12:12:37 UTC
When I presss Ctrl-Shift-C in an .sql file containing mysql code, the editor
generates '--' characters (2 dashes) before each selected sentence. 
In mysql this should be '-- ' (2 dashes and a space) to be valid.

Without the space, the following command would generate an error at the line of the comment.
$ mysql mydb < testcode.sql

I am not sure if there is a mechanism to detect if the .sql file contains mysql code, but I can propose two possible solutions:

1. Comment generation could be based on the first comment found in the document, starting from top. With this solution you can avoid detecting the sql syntax used.

2. The comments can be generated based on the driver of the selected connection on top of the edited document (there is a listbox next to the 'Connection:' label). (e.g. If the driver is for mysql then add a space after the dashes).


Related link about the required space:
http://dev.mysql.com/doc/refman/5.1/en/ansi-diff-comments.html
Comment 1 Jiri Rechtacek 2011-10-26 14:06:13 UTC
core-main/rev/5db7f55cf20f
Comment 2 Quality Engineering 2011-10-27 14:04:42 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/5db7f55cf20f
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #204153: mysql '--' (double dash) comments need a space to be valid