mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 18:57:21 +00:00
feat: Support LOCALTIME
and LOCALTIMESTAMP
time functions (#592)
This commit is contained in:
parent
bccd63ea07
commit
0bb49cea99
2 changed files with 37 additions and 1 deletions
|
@ -5353,6 +5353,38 @@ fn parse_time_functions() {
|
|||
|
||||
// Validating Parenthesis
|
||||
one_statement_parses_to("SELECT CURRENT_DATE", sql);
|
||||
|
||||
let sql = "SELECT LOCALTIME()";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
&Expr::Function(Function {
|
||||
name: ObjectName(vec![Ident::new("LOCALTIME")]),
|
||||
args: vec![],
|
||||
over: None,
|
||||
distinct: false,
|
||||
special: false,
|
||||
}),
|
||||
expr_from_projection(&select.projection[0])
|
||||
);
|
||||
|
||||
// Validating Parenthesis
|
||||
one_statement_parses_to("SELECT LOCALTIME", sql);
|
||||
|
||||
let sql = "SELECT LOCALTIMESTAMP()";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
&Expr::Function(Function {
|
||||
name: ObjectName(vec![Ident::new("LOCALTIMESTAMP")]),
|
||||
args: vec![],
|
||||
over: None,
|
||||
distinct: false,
|
||||
special: false,
|
||||
}),
|
||||
expr_from_projection(&select.projection[0])
|
||||
);
|
||||
|
||||
// Validating Parenthesis
|
||||
one_statement_parses_to("SELECT LOCALTIMESTAMP", sql);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue