mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 11:17:23 +00:00
parent
036a4120b4
commit
49d178477e
2 changed files with 58 additions and 10 deletions
|
@ -7022,6 +7022,27 @@ fn parse_set_variable() {
|
|||
one_statement_parses_to("SET SOMETHING TO '1'", "SET SOMETHING = '1'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_double_colon_cast_at_timezone() {
|
||||
let sql = "SELECT '2001-01-01T00:00:00.000Z'::TIMESTAMP AT TIME ZONE 'Europe/Brussels' FROM t";
|
||||
let select = verified_only_select(sql);
|
||||
|
||||
assert_eq!(
|
||||
&Expr::AtTimeZone {
|
||||
timestamp: Box::new(Expr::Cast {
|
||||
kind: CastKind::DoubleColon,
|
||||
expr: Box::new(Expr::Value(Value::SingleQuotedString(
|
||||
"2001-01-01T00:00:00.000Z".to_string()
|
||||
),)),
|
||||
data_type: DataType::Timestamp(None, TimezoneInfo::None),
|
||||
format: None
|
||||
}),
|
||||
time_zone: "Europe/Brussels".to_string()
|
||||
},
|
||||
expr_from_projection(only(&select.projection)),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_set_time_zone() {
|
||||
match verified_stmt("SET TIMEZONE = 'UTC'") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue