preston-footprint opened a new issue, #2959:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2959
Redshift nests `/* */` comments, as Postgres does, but `RedshiftSqlDialect`
doesn't set `supports_nested_comments`, so sqlparser ends the comment at the
first `*/`.
```sql
select 1 /* /* */ , ' */ , pg_backend_pid() -- '
```
- sqlparser 0.64.0: `MultiLineComment(" /* ")`, then a string; parses as
`SELECT 1, ' */ , pg_backend_pid() -- '`.
- Redshift: two columns, `1` and `1073905994`, so the comment ran to the
second `*/`.
The overlapping form `select 1 /*/*/ , ' */ */ , pg_backend_pid() -- '`
behaves the same way on both sides.
Postgres documents nesting in "Comments"
(https://www.postgresql.org/docs/8.0/sql-syntax.html#SQL-SYNTAX-COMMENTS), and
Redshift is based on PostgreSQL 8.0.2.
--
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]