mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-11 00:16:21 +00:00
add set time zone sometimezone as a exception while parsing keyword::set (#727)
* add set time zone sometimezone as a exception while parsing keyword::set * remove redundant parentheses * add Statement::SetTimeZone * delete useless comments
This commit is contained in:
parent
10652b61b4
commit
bae682255d
3 changed files with 32 additions and 0 deletions
|
@ -4551,6 +4551,15 @@ impl<'a> Parser<'a> {
|
|||
value: values,
|
||||
});
|
||||
}
|
||||
} else if variable.to_string().eq_ignore_ascii_case("TIMEZONE") {
|
||||
// for some db (e.g. postgresql), SET TIME ZONE <value> is an alias for SET TIMEZONE [TO|=] <value>
|
||||
match self.parse_expr() {
|
||||
Ok(expr) => Ok(Statement::SetTimeZone {
|
||||
local: modifier == Some(Keyword::LOCAL),
|
||||
value: expr,
|
||||
}),
|
||||
_ => self.expected("timezone value", self.peek_token())?,
|
||||
}
|
||||
} else if variable.to_string() == "CHARACTERISTICS" {
|
||||
self.expect_keywords(&[Keyword::AS, Keyword::TRANSACTION])?;
|
||||
Ok(Statement::SetTransaction {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue