File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -435,7 +435,11 @@ impl<'a> Parser<'a> {
435
435
special : true ,
436
436
} ) )
437
437
}
438
- Keyword :: CURRENT_TIMESTAMP | Keyword :: CURRENT_TIME | Keyword :: CURRENT_DATE => {
438
+ Keyword :: CURRENT_TIMESTAMP
439
+ | Keyword :: CURRENT_TIME
440
+ | Keyword :: CURRENT_DATE
441
+ | Keyword :: LOCALTIME
442
+ | Keyword :: LOCALTIMESTAMP => {
439
443
self . parse_time_functions ( ObjectName ( vec ! [ w. to_ident( ) ] ) )
440
444
}
441
445
Keyword :: CASE => self . parse_case_expr ( ) ,
Original file line number Diff line number Diff line change @@ -4932,6 +4932,38 @@ fn parse_time_functions() {
4932
4932
4933
4933
// Validating Parenthesis
4934
4934
one_statement_parses_to ( "SELECT CURRENT_DATE" , sql) ;
4935
+
4936
+ let sql = "SELECT LOCALTIME()" ;
4937
+ let select = verified_only_select ( sql) ;
4938
+ assert_eq ! (
4939
+ & Expr :: Function ( Function {
4940
+ name: ObjectName ( vec![ Ident :: new( "LOCALTIME" ) ] ) ,
4941
+ args: vec![ ] ,
4942
+ over: None ,
4943
+ distinct: false ,
4944
+ special: false ,
4945
+ } ) ,
4946
+ expr_from_projection( & select. projection[ 0 ] )
4947
+ ) ;
4948
+
4949
+ // Validating Parenthesis
4950
+ one_statement_parses_to ( "SELECT LOCALTIME" , sql) ;
4951
+
4952
+ let sql = "SELECT LOCALTIMESTAMP()" ;
4953
+ let select = verified_only_select ( sql) ;
4954
+ assert_eq ! (
4955
+ & Expr :: Function ( Function {
4956
+ name: ObjectName ( vec![ Ident :: new( "LOCALTIMESTAMP" ) ] ) ,
4957
+ args: vec![ ] ,
4958
+ over: None ,
4959
+ distinct: false ,
4960
+ special: false ,
4961
+ } ) ,
4962
+ expr_from_projection( & select. projection[ 0 ] )
4963
+ ) ;
4964
+
4965
+ // Validating Parenthesis
4966
+ one_statement_parses_to ( "SELECT LOCALTIMESTAMP" , sql) ;
4935
4967
}
4936
4968
4937
4969
#[ test]
You can’t perform that action at this time.
0 commit comments