preston-footprint opened a new issue, #2958:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2958

   In the Redshift dialect a `--` comment runs to the next `\n`, but Redshift 
ends it at a lone `\r` too, as Postgres does. sqlparser already stops at `\r` 
for `PostgreSqlDialect` (tokenizer `tokenize_single_line_comment`).
   
   ```sql
   select 1 as a --\r, pg_backend_pid()
   ```
   (`\r` is a literal carriage return.)
   
   - sqlparser 0.64.0: `SingleLineComment("\r, pg_backend_pid()")`; parses as 
`SELECT 1 AS a`.
   - Redshift: two columns, `a = 1`, `pg_backend_pid = 1073905994`.
   
   Redshift is based on PostgreSQL 8.0.2 
(https://docs.aws.amazon.com/redshift/latest/dg/c_redshift-and-postgres-sql.html),
 whose lexer treats both `\n` and `\r` as newlines. Could `RedshiftSqlDialect` 
share the Postgres behavior here?
   


-- 
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