Update the error message in parse_query_body

This commit is contained in:
Nickolay Ponomarev 2019-06-13 03:34:35 +03:00 committed by Nikhil Benesch
parent 4ee461bae4
commit 535505bb96
No known key found for this signature in database
GPG key ID: FCF98542083C5A69
2 changed files with 7 additions and 4 deletions

View file

@ -1529,7 +1529,10 @@ impl Parser {
} else if self.parse_keyword("VALUES") {
SQLSetExpr::Values(self.parse_values()?)
} 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 {

View file

@ -1990,7 +1990,7 @@ fn parse_exists_subquery() {
let res = parse_sql_statements("SELECT EXISTS (");
assert_eq!(
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(),
);
@ -1998,7 +1998,7 @@ fn parse_exists_subquery() {
let res = parse_sql_statements("SELECT EXISTS (NULL)");
assert_eq!(
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(),
);
@ -2399,7 +2399,7 @@ fn lateral_derived() {
let res = parse_sql_statements(sql);
assert_eq!(
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()
);