Description
Query with syntax error:
select * from `travel-sample` where meta().id like 10* and id is not null and type is not missing;
|
error:
[
|
{
|
"code": 3000,
|
"msg": "syntax error - at and",
|
"query_from_user": "select * from `travel-sample` where meta().id like 10* and id is not null and type is not missing;"
|
}
|
]
|
Even in this simple query, you can start to see how it's hard to figure out which 'and' is the problem.
A few simple suggestions to improve:
1 - Change the msg so that it's clearer what the problem word is. In the above example, reading it would seem to indicate that the "at and" is the problem, when in reality it's just the "and". Suggestion to either put single quotes around the 'and', or to remove the "at" and just have "syntax error: and"
2 - Add a character count. I.e. "syntax error at character 56: and"
3 - Provide more context around the problem word. i.e. "syntax error: ...and id is not null and type is not missing;" or "select * from `travel-sample` where meta().id like 10*<error> and id is not null and type is not missing;" (or replace <error> with something indicative like a '^', etc)
Attachments
Issue Links
- duplicates
-
MB-31399 Improve error message from parser errors to include more context
- Closed