Forced LIMIT clause not being applied correctly when SQL has a trailing comment #7483
Closed
3 tasks done
Labels
!deprecated-label:bug
Deprecated label - Use #bug instead
When a user submits a query that ends in a comment, Superset incorrectly appends its built-in
LIMIT
clause to that same last line which makes theLIMIT
clause commented out as well.Expected results
Ideally the limit would be added on a new line so that SQL comments cannot have any effect on it.
Actual results
Superset appends the
LIMIT
clause to the same line which is functionally equivalent to not adding a limit at all.Screenshots
User submits the following query (with a default LIMIT of 500 in the UI set):
Superset submits to the database engine:
How to reproduce the bug
Run a query that ends in a trailing comment, such as the example user submission in the Screenshots section above.
Environment
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
Additional context
I'm not sure if its as simple as inserting a newline here but I'm having trouble getting the tests to pass locally so I didn't want to submit a PR that I'm not confident about.
The text was updated successfully, but these errors were encountered: