hansott opened a new pull request, #1629:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1629

   The tokenizer currently throws EOF error for
   
   `select 'foo' /*/**/*/`
   
   while this is supported by postgres:
   
   
   
   `last_ch` causes problems when tokenizing nested comments, we have to 
consume the combination of `/*` or `*/`
   
   The existing `tokenize_nested_multiline_comment` test fails after fixing 
this logic:
   
   ```
   /*multi-line\n* \n/* comment \n /*comment*/*/ */ /comment*/
   ^^ Start                                      ^^ End nested comment
   ```
   
   proof:
   
   ```
   psql (14.15 (Homebrew), server 14.11)
   Type "help" for help.
   
   main_db=# SELECT 'foo' /*/**/*/;
    ?column?
   ----------
    foo
   (1 row)
   
   main_db=# SELECT 'foo' /*multi-line\n* \n/* comment \n /*comment*/*/ */ 
/comment*/;
   ERROR:  syntax error at or near ";"
   LINE 1: .../*multi-line\n* \n/* comment \n /*comment*/*/ */ /comment*/;
                                                                         ^
   main_db=# SELECT 'foo' /*multi-line\n* \n/* comment \n /*comment*/*/ */;
    ?column?
   ----------
    foo
   (1 row)
   ```
   
   Relevant: https://github.com/apache/datafusion-sqlparser-rs/pull/726


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to