Commit 28dddb43 authored by Brandon Nesterenko's avatar Brandon Nesterenko

MDEV-34348: sql/bounded_queue.h Remove compare_function

Remove compare_function from bounded_queue altogether
because it is never actually instantiated with a value.
parent af88f35a
......@@ -62,16 +62,6 @@ class Bounded_queue
Element_type *from,
bool packing_keys);
/**
Function for comparing two keys.
@param n Pointer to number of bytes to compare.
@param a First key.
@param b Second key.
@retval -1, 0, or 1 depending on whether the left argument is
less than, equal to, or greater than the right argument.
*/
typedef int (*compare_function)(size_t *n, Key_type **a, Key_type **b);
/**
Initialize the queue.
......@@ -93,7 +83,7 @@ class Bounded_queue
We do *not* take ownership of any of the input pointer arguments.
*/
int init(ha_rows max_elements, bool max_at_top,
compare_function compare, size_t compare_length,
size_t compare_length,
keymaker_function keymaker, Sort_param *sort_param,
Key_type **sort_keys);
......@@ -148,7 +138,6 @@ class Bounded_queue
template<typename Element_type, typename Key_type>
int Bounded_queue<Element_type, Key_type>::init(ha_rows max_elements,
bool max_at_top,
compare_function compare,
size_t compare_length,
keymaker_function keymaker,
Sort_param *sort_param,
......@@ -163,13 +152,10 @@ int Bounded_queue<Element_type, Key_type>::init(ha_rows max_elements,
// init_queue() takes an uint, and also does (max_elements + 1)
if (max_elements >= (UINT_MAX - 1))
return 1;
if (compare == NULL)
compare=
reinterpret_cast<compare_function>(get_ptr_compare(compare_length));
// We allocate space for one extra element, for replace when queue is full.
return init_queue(&m_queue, (uint) max_elements + 1,
0, max_at_top,
reinterpret_cast<queue_compare>(compare),
get_ptr_compare(compare_length),
&m_compare_length, 0, 0);
}
......
......@@ -283,7 +283,6 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
sort->init_record_pointers();
if (pq.init(param.max_rows,
true, // max_at_top
NULL, // compare_function
compare_length,
&make_sortkey, &param, sort->get_sort_keys()))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment