1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Clean up nth_value

Implement nth_value correctly and add a test case for it.
This commit is contained in:
Vicențiu Ciorbaru
2016-09-22 22:18:45 +02:00
parent 53cf265b3b
commit 6e4015727a
4 changed files with 196 additions and 29 deletions

View File

@ -2205,10 +2205,14 @@ void add_special_frame_cursors(THD *thd, Cursor_manager *cursor_manager,
cursor_manager->add_cursor(bottom_bound);
cursor_manager->add_cursor(top_bound);
DBUG_ASSERT(item_sum->fixed);
Item *int_item= new (thd->mem_root) Item_int(thd, 1);
Item *offset_func= new (thd->mem_root)
Item_func_minus(thd, item_sum->get_arg(1),
int_item);
offset_func->fix_fields(thd, &offset_func);
fc= new Frame_positional_cursor(*top_bound,
*top_bound, *bottom_bound,
*item_sum->get_arg(1),
false);
*offset_func, false);
fc->add_sum_func(item_sum);
cursor_manager->add_cursor(fc);
break;