#253 Comment syntax not documented

open
nobody
1
2011-06-15
2010-11-03
MCepek
No

The HSQL 2.0 documentation does not appear to address SQL syntax comments at all. One can guess from the examples that two hyphens at the beginning of the line introduce a comment line. But other questions remain, such as: can double-hyphen be used later in (not at the beginning of) a line? are there other comment characters that are allowed (such as // or /* */ etc)?

Please explicitly document this feature of the SQL syntax as implemented by HSQLDB, including adding it to the appropriate indices and contents. Thanks.

Discussion

  • MCepek
    MCepek
    2010-11-03

    • labels: --> documentation
     
  • MCepek
    MCepek
    2010-11-03

    "...two hyphens at the beginning of the line introduce a comment line."
    should be:
    "...two hyphens at the beginning of the line, optionally preceded by spaces or tabs, introduce a comment line."

     
  • MCepek
    MCepek
    2010-11-04

    A semicolon seems to end a comment. I think that should be fixed in a separate bug so that a semicolon can be part of a comment (shouldn't these comments extend to the end of a line?). Otherwise it should be documented that semicolons cannot be used in a comment. I wasted quite a bit of time chasing this one today.

     
  • Fred Toussi
    Fred Toussi
    2010-11-12

    Will do.
    The /* ... */ style comments are supported within a line or over multiple lines

    The -- comments turn the whole line into a comment, regardless of content.

    If you have found a situation where a semicolon can end a comment, Please attache file containing an example.

     
  • MCepek
    MCepek
    2010-11-14

    My bad. A semicolon in a comment isn't a MySQL parser issue, it was a bug on my end.

    To be thorough, it would help to know how the comment characters behave with each other (e.g. nesting), how they interact with both types of quotes, and any other interactions (e.g. backslash, newline, etc). Thanks.

     
  • Fred Toussi
    Fred Toussi
    2011-06-15

    • priority: 5 --> 1