Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip_comments does not strip when "|--" is found. #722

Open
Raihan9797 opened this issue Jun 1, 2023 · 0 comments
Open

strip_comments does not strip when "|--" is found. #722

Raihan9797 opened this issue Jun 1, 2023 · 0 comments

Comments

@Raihan9797
Copy link

Example occurs when "|" is directly before the single line comment token.
Issue is resolved when you separate them with a space.

edge_case = """myval := oneval || otherval ||--;
continuedvals;
"""
processed = sqlparse.format(edge_case, strip_comments=True)
sqlparse.split(processed)

# should only be 1 statement but getting 2
# returns ['myval := oneval || otherval ||--;', 'continuedvals;']

### bug doesnt occur when there is a space
FIXED_edge_case = """myval := oneval || otherval || --;
continuedvals;
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant