Merge pull request #76 from benesch/select-all

Support SELECT ALL
This commit is contained in:
Nickolay Ponomarev 2019-05-30 02:35:18 +03:00 committed by GitHub
commit 86a2fbd8e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -1354,7 +1354,11 @@ impl Parser {
/// Parse a restricted `SELECT` statement (no CTEs / `UNION` / `ORDER BY`),
/// assuming the initial `SELECT` was already consumed
pub fn parse_select(&mut self) -> Result<SQLSelect, ParserError> {
let all = self.parse_keyword("ALL");
let distinct = self.parse_keyword("DISTINCT");
if all && distinct {
return parser_err!("Cannot specify both ALL and DISTINCT in SELECT");
}
let projection = self.parse_select_list()?;
let (relation, joins) = if self.parse_keyword("FROM") {