Menu

Handling backticks (`)

2010-11-18
2012-12-07
  • Vadim Eisenberg

    Vadim Eisenberg - 2010-11-18

    Hello jSqlParser developers,

    Could it be possible for you to add handling backticks (`) to the jSqlParser ?

    The backticks are used, for example, in MySQL for quoting identifiers, like in the following statement :

        SELECT * FROM `table` WHERE `table`.`id` > 100;
    

    See http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

    I think handling backticks can be added to jSqlParser in the following way. In the file net/sf/jsqlparser/parser/JSqlParserCC.jj, in the defintion of

    S_QUOTED_IDENTIFIER: < S_QUOTED_IDENTIFIER: "\"" (~["\n","\r","\""])* "\"" >
    

    , add quoting by backticks:

    < S_QUOTED_IDENTIFIER: ("\"" (~["\n","\r","\""])* "\"") | ("`" (~["\n","\r","`"])* "`") >
    

    Thank you in advance,
    Vadim Eisenberg

     
  • Leonardo Francalanci

    Thanks, added to 0.6.5

     
  • Vadim Eisenberg

    Vadim Eisenberg - 2010-12-22

    Thank you ! I have tested it and it works.

    Best Regards,
    Vadim Eisenberg

     

Log in to post a comment.