getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.43k stars 4.38k forks source link

Queries starting with a commented out line return no data #5863

Open g12-al opened 1 year ago

g12-al commented 1 year ago

Queries starting with a commented out line return no data

Using chrome, if the first line in a query is a comment (not part of the query itself), Redash returns no data.

Steps to Reproduce

  1. Write a working query
  2. Run query
  3. Observe data being returned
  4. On the first line, add a new line that is prefixed with --, indicating that it's a comment
  5. Run the query again
  6. Observe that no data was returned

e.g.

WORKS:

SELECT *
FROM ...
WHERE ...

Returns no data:

-- Some random comment
SELECT *
FROM ...
WHERE ...

Technical details:

lucasfcnunes commented 1 year ago

Which query runner are you using? I couldn't replicate it on 10.1.0 (2589bef1).

jdavidheiser commented 1 year ago

I have been able to replicate this in both the Databricks and Postgres data source. It appears to be related to the automatic limit introduced in #5088 - unchecking the limit 1000 box correctly returns results.

justinclift commented 1 year ago

Ouch, that definitely sounds like a bug which needs fixing.