@@ -50,10 +50,11 @@ import (
50
50
%token <ident>
51
51
52
52
/* yy:token "%c" */
53
- identifier "identifier"
54
- asof "AS OF"
55
- toTimestamp "TO TIMESTAMP"
56
- toTSO "TO TSO"
53
+ identifier "identifier"
54
+ asof "AS OF"
55
+ toTimestamp "TO TIMESTAMP"
56
+ toTSO "TO TSO"
57
+
57
58
/* yy:token "_%c" */
58
59
underscoreCS "UNDERSCORE_CHARSET"
59
60
@@ -2621,44 +2622,44 @@ FlashbackToTimestampStmt:
2621
2622
" FLASHBACK" " CLUSTER" toTimestamp stringLit
2622
2623
{
2623
2624
$$ = &ast.FlashBackToTimestampStmt{
2624
- FlashbackTS: ast.NewValueExpr($4 , " " , " " ),
2625
+ FlashbackTS: ast.NewValueExpr($4 , " " , " " ),
2625
2626
FlashbackTSO: 0 ,
2626
2627
}
2627
2628
}
2628
2629
| " FLASHBACK" " TABLE" TableNameList toTimestamp stringLit
2629
2630
{
2630
2631
$$ = &ast.FlashBackToTimestampStmt{
2631
- Tables: $3 .([]*ast.TableName),
2632
- FlashbackTS: ast.NewValueExpr($5 , " " , " " ),
2632
+ Tables: $3 .([]*ast.TableName),
2633
+ FlashbackTS: ast.NewValueExpr($5 , " " , " " ),
2633
2634
FlashbackTSO: 0 ,
2634
2635
}
2635
2636
}
2636
2637
| " FLASHBACK" DatabaseSym DBName toTimestamp stringLit
2637
2638
{
2638
2639
$$ = &ast.FlashBackToTimestampStmt{
2639
- DBName: model.NewCIStr($3 ),
2640
- FlashbackTS: ast.NewValueExpr($5 , " " , " " ),
2640
+ DBName: model.NewCIStr($3 ),
2641
+ FlashbackTS: ast.NewValueExpr($5 , " " , " " ),
2641
2642
FlashbackTSO: 0 ,
2642
2643
}
2643
2644
}
2644
2645
| " FLASHBACK" " CLUSTER" toTSO LengthNum
2645
2646
{
2646
2647
if tsoValue, ok := $4 .(uint64); ok && tsoValue > 0 {
2647
2648
$$ = &ast.FlashBackToTimestampStmt{
2648
- FlashbackTSO: tsoValue,
2649
- }
2649
+ FlashbackTSO: tsoValue,
2650
+ }
2650
2651
} else {
2651
- yylex.AppendError(yylex.Errorf(" Invalid TSO value provided: %d" , $4 ))
2652
- return 1
2652
+ yylex.AppendError(yylex.Errorf(" Invalid TSO value provided: %d" , $4 ))
2653
+ return 1
2653
2654
}
2654
2655
}
2655
2656
| " FLASHBACK" " TABLE" TableNameList toTSO LengthNum
2656
2657
{
2657
2658
if tsoValue, ok := $5 .(uint64); ok && tsoValue > 0 {
2658
2659
$$ = &ast.FlashBackToTimestampStmt{
2659
- Tables: $3 .([]*ast.TableName),
2660
- FlashbackTSO: tsoValue,
2661
- }
2660
+ Tables: $3 .([]*ast.TableName),
2661
+ FlashbackTSO: tsoValue,
2662
+ }
2662
2663
} else {
2663
2664
yylex.AppendError(yylex.Errorf(" Invalid TSO value provided: %d" , $5 ))
2664
2665
return 1
@@ -2668,16 +2669,15 @@ FlashbackToTimestampStmt:
2668
2669
{
2669
2670
if tsoValue, ok := $5 .(uint64); ok && tsoValue > 0 {
2670
2671
$$ = &ast.FlashBackToTimestampStmt{
2671
- DBName: model.NewCIStr($3 ),
2672
- FlashbackTSO: tsoValue,
2672
+ DBName: model.NewCIStr($3 ),
2673
+ FlashbackTSO: tsoValue,
2673
2674
}
2674
2675
} else {
2675
2676
yylex.AppendError(yylex.Errorf(" Invalid TSO value provided: %d" , $5 ))
2676
2677
return 1
2677
2678
}
2678
2679
}
2679
2680
2680
-
2681
2681
/* ******************************************************************
2682
2682
*
2683
2683
* Flush Back Table Statement
@@ -7868,7 +7868,11 @@ SumExpr:
7868
7868
}
7869
7869
| builtinVarSamp ' (' BuggyDefaultFalseDistinctOpt Expression ' )' OptWindowingClause
7870
7870
{
7871
- $$ = &ast.AggregateFuncExpr{F: $1 , Args: []ast.ExprNode{$4 }, Distinct: $3 .(bool )}
7871
+ if $6 != nil {
7872
+ $$ = &ast.WindowFuncExpr{F: $1 , Args: []ast.ExprNode{$4 }, Distinct: $3 .(bool ), Spec: *($6 .(*ast.WindowSpec))}
7873
+ } else {
7874
+ $$ = &ast.AggregateFuncExpr{F: $1 , Args: []ast.ExprNode{$4 }, Distinct: $3 .(bool )}
7875
+ }
7872
7876
}
7873
7877
| " JSON_ARRAYAGG" ' (' Expression ' )' OptWindowingClause
7874
7878
{
@@ -9772,8 +9776,8 @@ SetOprStmtWoutLimitOrderBy:
9772
9776
setOprList2 = []ast.Node{x}
9773
9777
with2 = x.With
9774
9778
case *ast.SetOprStmt:
9775
- // child setOprStmt's limit and order should also make sense
9776
- // we should separate it out from other normal SetOprSelectList.
9779
+ // child setOprStmt's limit and order should also make sense
9780
+ // we should separate it out from other normal SetOprSelectList.
9777
9781
setOprList2 = x.SelectList.Selects
9778
9782
with2 = x.With
9779
9783
limit2 = x.Limit
0 commit comments