mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-13 15:32:03 +00:00
Update the error message in parse_query_body
This commit is contained in:
parent
4ee461bae4
commit
535505bb96
2 changed files with 7 additions and 4 deletions
|
@ -1529,7 +1529,10 @@ impl Parser {
|
||||||
} else if self.parse_keyword("VALUES") {
|
} else if self.parse_keyword("VALUES") {
|
||||||
SQLSetExpr::Values(self.parse_values()?)
|
SQLSetExpr::Values(self.parse_values()?)
|
||||||
} else {
|
} else {
|
||||||
return self.expected("SELECT or a subquery in the query body", self.peek_token());
|
return self.expected(
|
||||||
|
"SELECT, VALUES, or a subquery in the query body",
|
||||||
|
self.peek_token(),
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
|
|
@ -1990,7 +1990,7 @@ fn parse_exists_subquery() {
|
||||||
let res = parse_sql_statements("SELECT EXISTS (");
|
let res = parse_sql_statements("SELECT EXISTS (");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError(
|
ParserError::ParserError(
|
||||||
"Expected SELECT or a subquery in the query body, found: EOF".to_string()
|
"Expected SELECT, VALUES, or a subquery in the query body, found: EOF".to_string()
|
||||||
),
|
),
|
||||||
res.unwrap_err(),
|
res.unwrap_err(),
|
||||||
);
|
);
|
||||||
|
@ -1998,7 +1998,7 @@ fn parse_exists_subquery() {
|
||||||
let res = parse_sql_statements("SELECT EXISTS (NULL)");
|
let res = parse_sql_statements("SELECT EXISTS (NULL)");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError(
|
ParserError::ParserError(
|
||||||
"Expected SELECT or a subquery in the query body, found: NULL".to_string()
|
"Expected SELECT, VALUES, or a subquery in the query body, found: NULL".to_string()
|
||||||
),
|
),
|
||||||
res.unwrap_err(),
|
res.unwrap_err(),
|
||||||
);
|
);
|
||||||
|
@ -2399,7 +2399,7 @@ fn lateral_derived() {
|
||||||
let res = parse_sql_statements(sql);
|
let res = parse_sql_statements(sql);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError(
|
ParserError::ParserError(
|
||||||
"Expected SELECT or a subquery in the query body, found: b".to_string()
|
"Expected SELECT, VALUES, or a subquery in the query body, found: b".to_string()
|
||||||
),
|
),
|
||||||
res.unwrap_err()
|
res.unwrap_err()
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue