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 @@ -438,7 +438,11 @@ impl<'a> Parser<'a> {
438
438
special : true ,
439
439
} ) )
440
440
}
441
- Keyword :: CURRENT_TIMESTAMP | Keyword :: CURRENT_TIME | Keyword :: CURRENT_DATE => {
441
+ Keyword :: CURRENT_TIMESTAMP
442
+ | Keyword :: CURRENT_TIME
443
+ | Keyword :: CURRENT_DATE
444
+ | Keyword :: LOCALTIME
445
+ | Keyword :: LOCALTIMESTAMP => {
442
446
self . parse_time_functions ( ObjectName ( vec ! [ w. to_ident( ) ] ) )
443
447
}
444
448
Keyword :: CASE => self . parse_case_expr ( ) ,
Original file line number Diff line number Diff line change @@ -5353,6 +5353,38 @@ fn parse_time_functions() {
5353
5353
5354
5354
// Validating Parenthesis
5355
5355
one_statement_parses_to ( "SELECT CURRENT_DATE" , sql) ;
5356
+
5357
+ let sql = "SELECT LOCALTIME()" ;
5358
+ let select = verified_only_select ( sql) ;
5359
+ assert_eq ! (
5360
+ & Expr :: Function ( Function {
5361
+ name: ObjectName ( vec![ Ident :: new( "LOCALTIME" ) ] ) ,
5362
+ args: vec![ ] ,
5363
+ over: None ,
5364
+ distinct: false ,
5365
+ special: false ,
5366
+ } ) ,
5367
+ expr_from_projection( & select. projection[ 0 ] )
5368
+ ) ;
5369
+
5370
+ // Validating Parenthesis
5371
+ one_statement_parses_to ( "SELECT LOCALTIME" , sql) ;
5372
+
5373
+ let sql = "SELECT LOCALTIMESTAMP()" ;
5374
+ let select = verified_only_select ( sql) ;
5375
+ assert_eq ! (
5376
+ & Expr :: Function ( Function {
5377
+ name: ObjectName ( vec![ Ident :: new( "LOCALTIMESTAMP" ) ] ) ,
5378
+ args: vec![ ] ,
5379
+ over: None ,
5380
+ distinct: false ,
5381
+ special: false ,
5382
+ } ) ,
5383
+ expr_from_projection( & select. projection[ 0 ] )
5384
+ ) ;
5385
+
5386
+ // Validating Parenthesis
5387
+ one_statement_parses_to ( "SELECT LOCALTIMESTAMP" , sql) ;
5356
5388
}
5357
5389
5358
5390
#[ test]
You can’t perform that action at this time.
0 commit comments