mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 13:58:15 +00:00
add with/without time zone (#589)
This commit is contained in:
parent
72559e9b62
commit
95fbb55f2c
4 changed files with 37 additions and 5 deletions
|
@ -2854,7 +2854,7 @@ fn parse_literal_datetime() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn parse_literal_timestamp() {
|
||||
fn parse_literal_timestamp_without_time_zone() {
|
||||
let sql = "SELECT TIMESTAMP '1999-01-01 01:23:34'";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
|
@ -2864,6 +2864,29 @@ fn parse_literal_timestamp() {
|
|||
},
|
||||
expr_from_projection(only(&select.projection)),
|
||||
);
|
||||
|
||||
one_statement_parses_to(
|
||||
"SELECT TIMESTAMP WITHOUT TIME ZONE '1999-01-01 01:23:34'",
|
||||
sql,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_literal_timestamp_with_time_zone() {
|
||||
let sql = "SELECT TIMESTAMPTZ '1999-01-01 01:23:34Z'";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
&Expr::TypedString {
|
||||
data_type: DataType::TimestampTz,
|
||||
value: "1999-01-01 01:23:34Z".into()
|
||||
},
|
||||
expr_from_projection(only(&select.projection)),
|
||||
);
|
||||
|
||||
one_statement_parses_to(
|
||||
"SELECT TIMESTAMP WITH TIME ZONE '1999-01-01 01:23:34Z'",
|
||||
sql,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue