Details
-
Improvement
-
Resolution: Done
-
Major
-
4.5.0, 4.6.0, 5.0.0, 6.0.0, 6.6.0, 6.5.0
Description
N1QL query error messages are not very useful in identifying or fixing a problem in the query. Can we throw more useful syntax error messages. For ex:
1) select * from[ default;
"code": 3000,
"msg": "syntax error - at ;",
"query_from_user": "select * from[ default;"
2) select *, from default;
"code": 3000,
"msg": "syntax error - at from",
"query_from_user": "select *, from default;"
3) select * from default where type = "order" let x = name;
"code": 3000,
"msg": "syntax error - at let",
"query_from_user": "select * from default where type = \"order\" let x = name;"
Thoughts to improve these errors:
==========================
1) print the line#, col#, and the sample/surrounding text causing the syntax error. If line# &col# are not relevant, some way to identify the position# in the query text will be helpful.
2) Any contextual suggestion to identify/fix the issue would be great. In example (3) above, why let clause is error, or suggesting to move let-clause before where-clause.
Attachments
Issue Links
- relates to
-
MB-43383 Query Workbench: Show line number for syntax errors
- Resolved