Skip to content

Commit

Permalink
Parse MILLENNIUM (#633)
Browse files Browse the repository at this point in the history
* add unknown, is not true/false/unknown

* millennium
  • Loading branch information
sarahyurick committed Sep 28, 2022
1 parent e951cd5 commit d87408b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ast/value.rs
Expand Up @@ -85,6 +85,7 @@ pub enum DateTimeField {
Julian,
Microseconds,
Millenium,
Millennium,
Milliseconds,
Quarter,
Timezone,
Expand Down Expand Up @@ -112,6 +113,7 @@ impl fmt::Display for DateTimeField {
DateTimeField::Julian => "JULIAN",
DateTimeField::Microseconds => "MICROSECONDS",
DateTimeField::Millenium => "MILLENIUM",
DateTimeField::Millennium => "MILLENNIUM",
DateTimeField::Milliseconds => "MILLISECONDS",
DateTimeField::Quarter => "QUARTER",
DateTimeField::Timezone => "TIMEZONE",
Expand Down
1 change: 1 addition & 0 deletions src/keywords.rs
Expand Up @@ -332,6 +332,7 @@ define_keywords!(
METHOD,
MICROSECONDS,
MILLENIUM,
MILLENNIUM,
MILLISECONDS,
MIN,
MINUTE,
Expand Down
2 changes: 2 additions & 0 deletions src/parser.rs
Expand Up @@ -1065,6 +1065,7 @@ impl<'a> Parser<'a> {
Keyword::JULIAN => Ok(DateTimeField::Julian),
Keyword::MICROSECONDS => Ok(DateTimeField::Microseconds),
Keyword::MILLENIUM => Ok(DateTimeField::Millenium),
Keyword::MILLENNIUM => Ok(DateTimeField::Millennium),
Keyword::MILLISECONDS => Ok(DateTimeField::Milliseconds),
Keyword::QUARTER => Ok(DateTimeField::Quarter),
Keyword::TIMEZONE => Ok(DateTimeField::Timezone),
Expand Down Expand Up @@ -1144,6 +1145,7 @@ impl<'a> Parser<'a> {
Keyword::JULIAN,
Keyword::MICROSECONDS,
Keyword::MILLENIUM,
Keyword::MILLENNIUM,
Keyword::MILLISECONDS,
Keyword::QUARTER,
Keyword::TIMEZONE,
Expand Down
1 change: 1 addition & 0 deletions tests/sqlparser_common.rs
Expand Up @@ -1755,6 +1755,7 @@ fn parse_extract() {
verified_stmt("SELECT EXTRACT(JULIAN FROM d)");
verified_stmt("SELECT EXTRACT(MICROSECONDS FROM d)");
verified_stmt("SELECT EXTRACT(MILLENIUM FROM d)");
verified_stmt("SELECT EXTRACT(MILLENNIUM FROM d)");
verified_stmt("SELECT EXTRACT(MILLISECONDS FROM d)");
verified_stmt("SELECT EXTRACT(QUARTER FROM d)");
verified_stmt("SELECT EXTRACT(TIMEZONE FROM d)");
Expand Down

0 comments on commit d87408b

Please sign in to comment.