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 the LIMIT clause commented out as well.
Ideally the limit would be added on a new line so that SQL comments cannot have any effect on it.
Superset appends the LIMIT clause to the same line which is functionally equivalent to not adding a limit at all.
User submits the following query (with a default LIMIT of 500 in the UI set):
SELECT y, m, d, COUNT(*)
FROM some_table
GROUP BY y, m, d -- uh oh a trailing comment!
Superset submits to the database engine:
SELECT y, m, d, COUNT(*)
FROM some_table
GROUP BY y, m, d -- uh oh a trailing comment! LIMIT 500
Run a query that ends in a trailing comment, such as the example user submission in the Screenshots section above.
Make sure these boxes are checked before submitting your issue - thank you!
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.
Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.84. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Most helpful comment
Issue-Label Bot is automatically applying the label
#bugto this issue, with a confidence of 0.84. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!Links: app homepage, dashboard and code for this bot.