Skip to content
Snippets Groups Projects
Commit 7f60f51b authored by Igor Kuznetsov's avatar Igor Kuznetsov
Browse files

feat: change sql parser error messages format

parent fa4aa1fe
No related branches found
No related tags found
1 merge request!1414sbroad import
......@@ -42,7 +42,7 @@ impl Ast for AbstractSyntaxTree {
Ok(p) => p,
Err(e) => {
return Err(QueryPlannerError::CustomError(format!(
"Parsing error: {:?}",
"Parsing error: {}",
e
)))
}
......
......@@ -147,11 +147,12 @@ fn invalid_query() {
let ast = AbstractSyntaxTree::new(query).unwrap_err();
assert_eq!(
format!(
"{} {} {} {}",
r#"Parsing error: Error { variant: ParsingError { positives:"#,
r#"[Alias, Asterisk, True, False, Null, Decimal, Double, Integer, Unsigned, Row, Parameter], negatives: [] },"#,
r#"location: Pos(7), line_col: Pos((1, 8)), path: None, line: "select a frAm t","#,
r#"continued_line: None }"#,
r#"Parsing error: --> 1:8
|
1 | select a frAm t
| ^---
|
= expected Alias, Asterisk, True, False, Null, Decimal, Double, Integer, Unsigned, Row, or Parameter"#,
),
format!("{}", ast),
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment