PreviousNextTracker indexSee it online !

(12/231) 1531456 - # for comments in .sql (transact-sql) mode

Hi!

I edit MySQL dumps a lot and they containg #-comments,
that are not recognized by the mode. I'm not sure
whether the #-comment is SQL99 standard, but it would
be nice to include it too, I don't think it will break
anything?

Submitted esad_h - 2006-07-31 - 00:01:28z Assigned nobody
Priority 5 Category None
Status Open Group None
Resolution None Visibility No

Comments

2010-04-15 - 15:42:34z
I can confirm this behaviour. # are allowed as comments in mysql and I would also like this fix should be made. Although I can understand this being low priority... it would just be a bit of polish if it's easy to fix.
2010-04-15 - 15:53:45z
It would be great if the DTD schema for edit modes (i.e. xmode.dtd) allowed more than one 'lineComment'. So for example this outstanding bug regarding mysql syntax highlighting could be fixed by changing the current mysql.xml <PROPS> section from:

<PROPS>
<PROPERTY NAME="commentStart" VALUE="/*" />
<PROPERTY NAME="commentEnd" VALUE="*/" />
<PROPERTY NAME="lineComment" VALUE="--" />
</PROPS>

to:

<PROPS>
<PROPERTY NAME="commentStart" VALUE="/*" />
<PROPERTY NAME="commentEnd" VALUE="*/" />
<PROPERTY NAME="lineComment" VALUE="--" />
<PROPERTY NAME="lineComment" VALUE="#" />
</PROPS>

Am I on the right lines? Also would it not be better to move to a .xsd schema file rather than using the old DTD method? It is much stricter at validation which would ensure greater quality for the syntax highlighting functionality.
2010-04-15 - 16:19:42z
sjakob
Transact-SQL is the dialect of SQL used by MS SQL*Server (and Sybase IIRC). In transact-SQL the "#" character is not a valid comment delimiter.

I notice that there is a mySQL mode available in jEdit. Is this not appropriate?
2013-09-23 - 00:57:35z
lummo
Changing:
<SPAN TYPE="COMMENT1">
<BEGIN>/*</BEGIN>
<END>*/</END>
</SPAN>
to
<EOL_SPAN TYPE="COMMENT1">#</EOL_SPAN>
<SPAN TYPE="COMMENT2">
<BEGIN>/*</BEGIN>
<END>*/</END>
</SPAN>

worked for me.

Attachments