Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4472

the SqlParserPos in like statement and in limit statement seems wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.21.0
    • None
    • core
    • java8 + idea + maven3 

      calcite version: 1.21.0

    Description

      Here are the sqls:

       

      // like statement
      select id,name from chener where name like 'name'
      
      //limit statement
      select id,name from chener where name = 'jack' limit 1
      
      

      than the parser code:

      // the java code for parser
      SqlParser.Config mysqlConfig = SqlParser.configBuilder()
              .setParserFactory(SqlAlterParserImpl.FACTORY)
              .setLex(Lex.MYSQL)
              .build();
      SqlParser parser = SqlParser.create("", mysqlConfig);
      SqlNode sqlNode = parser.parseQuery(likeSql);
      SqlNode sqlNode1 = parser.parseQuery(limitSql);
      
      

      the like statement result:

      You can see that the SqlParserPos of the like statement in where seems wrong.If the where statement does not contain the like statement,it works allright. And so does the limit stament.

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            chener chener
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: