Bug?

[expired user #7880]'s profile image [expired user #7880] posted 11 years ago in General Permalink
Hi,

the latest (8 3 0 4766) version seems to have issues with comments (--) in the query window:

If you have 2 'commands' in a query window and one of them is commented out (and the comment -- is not separated from the command by at least one space) it is shown as commented (grayed out), yet it is still being executed

ansgar's profile image ansgar posted 11 years ago Permalink
The underlying SynEdit highlighter has a small gitch here. Two dashes must be followed by a space in order to be a comment: "-- ". If there is no space, then it's not a comment, and MySQL takes it as part of the query.

SynEdit, however, displays also two dashes without the following space as comments. This is an error I've ever wanted to submit to their bugtracker. I'll see if it probably was reported before.
ansgar's profile image ansgar posted 11 years ago Permalink
Oh, I have already filed it as a bugreport, 4 years ago...

https://sourceforge.net/p/synedit/bugs/405/
kalvaro's profile image kalvaro posted 11 years ago Permalink
Most likely SynEdit treats SQL as a single language and that's a valid comment in all other dialects (including standard SQL).
ansgar's profile image ansgar posted 11 years ago Permalink
Perhaps I can finally fix that. The SynEdit project unfortunately does not seem very active. I wonder why that's the case, as quite a few applications use the SynEdit highlighter.
Code modification/commit 8aa3e82 from ansgar.becker, 10 years ago, revision 8.3.0.4789
Try to fix SynEdit's double minus comment bug. http://www.heidisql.com/forum.php?t=15621
Code modification/commit c4e66fb from ansgar.becker, 10 years ago, revision 8.3.0.4790
Last required addition to the double minus comment bugfix. http://www.heidisql.com/forum.php?t=15621
ansgar's profile image ansgar posted 10 years ago Permalink
I think I got it, in r4790.
[expired user #8152]'s profile image [expired user #8152] posted 10 years ago Permalink
Hello!

I'm using HeidiSQL with MSSQL Server and for me there could be no spaces and the string would be still commented.

Maybe it's possible to check which server we're connected to and then use different highlight?

Thank you!
ansgar's profile image ansgar posted 10 years ago Permalink
Indeed. I thought MSSQL would behave differently. I guess it's required to make a server/version conditional again here. Sigh.

Please login to leave a reply, or register at first.