diff options
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3cc76c51439..f6e06a05cca 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -11494,28 +11494,43 @@ window_frame_extent: window_frame_start: UNBOUNDED_SYM PRECEDING_SYM { - $$->precedence_type= Window_frame_bound::PRECEDING; - $$->offset= (Item *) 1; + $$= new (thd->mem_root) + Window_frame_bound(Window_frame_bound::PRECEDING, + (Item*)1); + if ($$ == NULL) + MYSQL_YYABORT; } - | CURRENT_SYM ROW_SYM { $$->offset= (Item *) 0; } + | CURRENT_SYM ROW_SYM + { + $$= new (thd->mem_root) + Window_frame_bound(Window_frame_bound::PRECEDING, NULL); + if ($$ == NULL) + MYSQL_YYABORT; + } | literal PRECEDING_SYM { - $$->precedence_type= Window_frame_bound::PRECEDING; - $$->offset= $1; + $$= new (thd->mem_root) + Window_frame_bound(Window_frame_bound::PRECEDING, $1); + if ($$ == NULL) + MYSQL_YYABORT; } ; window_frame_bound: window_frame_start { $$= $1; } - | UNBOUNDED_SYM FOLLOWING_SYM + | UNBOUNDED_SYM FOLLOWING_SYM { - $$->precedence_type= Window_frame_bound::FOLLOWING; - $$->offset= (Item *) 1; - } + $$= new (thd->mem_root) + Window_frame_bound(Window_frame_bound::FOLLOWING, (Item*)1); + if ($$ == NULL) + MYSQL_YYABORT; + } | literal FOLLOWING_SYM { - $$->precedence_type= Window_frame_bound::FOLLOWING; - $$->offset= $1; + $$= new (thd->mem_root) + Window_frame_bound(Window_frame_bound::FOLLOWING, $1); + if ($$ == NULL) + MYSQL_YYABORT; } ; |