1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix a PS re-execution problem and code cleanup

- Make Item_XXX::cleanup() clean List<Cached_item> orderby_fields.
  (Items survive across PS re-executions. Cached_item don't, because
   they keep pointers to fix_field'ed items, etc)
- Move List<Cached_item> out into Group_bound_tracker.
This commit is contained in:
Sergei Petrunia
2016-03-24 02:09:17 +03:00
parent 602e15a0cb
commit d8b8b5affa
3 changed files with 74 additions and 62 deletions

View File

@ -387,46 +387,6 @@ public:
/////////////////////////////////////////////////////////////////////////////
/* A wrapper around test_if_group_changed */
class Group_bound_tracker
{
List<Cached_item> group_fields;
public:
void init(THD *thd, SQL_I_List<ORDER> *list)
{
for (ORDER *curr = list->first; curr; curr=curr->next)
{
Cached_item *tmp= new_Cached_item(thd, curr->item[0], TRUE);
group_fields.push_back(tmp);
}
}
/*
Check if the current row is in a different group than the previous row
this function was called for.
The new row's group becomes the current row's group.
*/
bool check_if_next_group()
{
if (test_if_group_changed(group_fields) > -1)
return true;
return false;
}
int compare_with_cache()
{
List_iterator<Cached_item> li(group_fields);
Cached_item *ptr;
int res;
while ((ptr= li++))
{
if ((res= ptr->cmp_read_only()))
return res;
}
return 0;
}
};
/*
Window frame bound cursor. Abstract interface.