Repository navigation
Redshift: End -- comments at a carriage return - #2987
Open
anubhavlal07 wants to merge 1 commit into
Open
anubhavlal07 wants to merge 1 commit into
anubhavlal07 wants to merge 1 commit into
Conversation
Author
|
I've reviewed the doc comment on |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2987 +/- ##
=======================================
Coverage 83.28% 83.29%
=======================================
Files 42 42
Lines 35355 35364 +9
Branches 35355 35364 +9
=======================================
+ Hits 29446 29455 +9
Misses 2458 2458
Partials 3451 3451 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dialects: Redshift, PostgreSQL
Fixes #2958
With
RedshiftSqlDialect, a--comment did not end at a lone\r, soSELECT 1 AS a --\r, 2parsed asSELECT 1 AS a. The tokenizer stopped at\ronly forPostgreSqlDialect. Redshift is based on PostgreSQL 8.0.2 (Amazon Redshift and PostgreSQL), and the PostgreSQL lexer ends--comments at either\nor\r(scan.l).This replaces the
dialect_of!(self is PostgreSqlDialect)check with a newDialect::single_line_comment_ends_at_carriage_returnmethod, which defaults tofalseand returnstruefor PostgreSQL and Redshift. PostgreSQL behaves as before.The new test in
tests/sqlparser_redshift.rschecks that dialects which enable the method parse two projections, and that the others still treat the rest of the line as a comment. I also added the fuzz seedfuzz/fuzz_seeds/redshift_2958_comment_cr.sql.I wrote this with AI assistance, then reviewed the diff and description myself.