Bug: tab after -- not recognised as comment

[expired user #7063]'s profile image [expired user #7063] posted 8 years ago in General Permalink

In Heidi 9.3.0.4984 it doesn't restyle (my)SQL-codes to comments when using two dashes followed by a tab. It does work correctly when using a space after it. In previous versions of Heidi the restyling was done as expected. I have attachted a screenshot and the script used.

2 attachment(s):
Code modification/commit from ansgarbecker, 8 years ago, revision 9.3.0.5036
Allow tab after double dash comment in SQL highlighter. See http://www.heidisql.com/forum.php?t=20196 and http://dev.mysql.com/doc/refman/5.7/en/comments.html
ansgar's profile image ansgar posted 8 years ago Permalink

r5036 allows a tab instead of space character after the double minus comment.

This is still not fully correct, as the documentation says:

From a “-- ” sequence to the end of the line. In MySQL, the “-- ” (double-dash) comment style requires the second dash to be followed by at least one whitespace or control character (such as a space, tab, newline, and so on).

I'm unsure what they mean by "and so on". But I guess for the everyday work tabs and spaces are sufficient.

[expired user #7063]'s profile image [expired user #7063] posted 8 years ago Permalink

Thanks, I'll upgrade to a new version then. Tabs and spaces should be enough, but I think they mean all 'empty' characters like alt+0160 ( )

igitur's profile image igitur posted 7 years ago Permalink

In MS SQL, this is a valid comment:

--select * from table

However, SynEdit doesn't highlight it as a comment. Only if a insert a space after the -- does it recognise it as a comment. In MySQL, the space is required, but not in MS SQL.

Uzi's profile image Uzi posted 3 years ago Permalink

This bug happens again. I'm using latest nightly built version 11.0.0.6112 (64 bit).

ansgar's profile image ansgar posted 3 years ago Permalink

Uzi, you are probably not using MSSQL, as igitur was, right?

Uzi's profile image Uzi posted 3 years ago Permalink

Uzi, you are probably not using MSSQL, as igitur was, right?

No, I'm using MySQL, or more exactly, MariaDB 5.5.64. I'm more familiar with using tabs instead of spaces to indent queries. HeidiSQL used to behave fine with "tabs after double hyphens" comments before. This problem's just re-appeared with more recent versions.

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