What is the bug?
Instead of using the proper SQL syntax SELECT * FROM ... WHERE ..., when running SELECT *FROM ... WHERE ... (notice missing space between * and FROM), query still executes unexpectedly, and behaves differently from the proper syntax.
How can one reproduce the bug?
Steps to reproduce the behavior:
Go to "Query Workbench"
Run the example queries
Note that in all the released version I tested, the issue can be observed.
However, when tested this on https://playground.opensearch.org/app/home#/ as well, the behavior in playground is slightly different.
In query workbench, the malformed query (1) doesn't do anything. It doesn't return result, and also doesn't error out, unlike other malformed query which yields "Opensearch_dashboards_sample_data_ecommerce: Bad Request, this query is not runnable."
What is the expected behavior?SELECT *FROM ... WHERE ... is a malformed query and should've resulted in parsing error and not be executed.
What is your host/environment?
version: 1.0 / 2.13 / 2.15 / 2.17.1
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Explaining SELECT * FROM ... WHERE ... and SELECT *FROM ... WHERE ... yields different result.
Not all queries in the example are explainable, though.
What is the bug? Instead of using the proper SQL syntax
SELECT * FROM ... WHERE ...
, when runningSELECT *FROM ... WHERE ...
(notice missing space between * and FROM), query still executes unexpectedly, and behaves differently from the proper syntax.Verified same behavior can be observed in https://opensearch.org/versions/opensearch-1-0-0.html, all the way back to the 1.0 version, and in latest version.
Below are some queries on some sample index
opensearch_dashboards_sample_data_ecommerce
This result is unexpected.
Notice that if we modify above query (1) into
SELECT * FROM ...
, then we get an error:The correct syntax should be the following, with literals quoted
Without where clause
Notice, however, that without the where clause, this query errors out:
with json format
Even more bizarre, same malformed query without
where
clause but querying with json format returns without errorHow can one reproduce the bug? Steps to reproduce the behavior:
Note that in all the released version I tested, the issue can be observed. However, when tested this on https://playground.opensearch.org/app/home#/ as well, the behavior in playground is slightly different. In query workbench, the malformed query (1) doesn't do anything. It doesn't return result, and also doesn't error out, unlike other malformed query which yields "Opensearch_dashboards_sample_data_ecommerce: Bad Request, this query is not runnable."
What is the expected behavior?
SELECT *FROM ... WHERE ...
is a malformed query and should've resulted in parsing error and not be executed.What is your host/environment?
Do you have any screenshots? If applicable, add screenshots to help explain your problem.
Do you have any additional context? Explaining
SELECT * FROM ... WHERE ...
andSELECT *FROM ... WHERE ...
yields different result. Not all queries in the example are explainable, though.