1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge siva.hindu.god:/usr/home/tim/m/bk/g50

into  siva.hindu.god:/usr/home/tim/m/bk/50
This commit is contained in:
tsmith/tim@siva.hindu.god
2006-10-24 14:42:08 -06:00
68 changed files with 2614 additions and 465 deletions

View File

@ -8376,6 +8376,7 @@ TRP_GROUP_MIN_MAX::make_quick(PARAM *param, bool retrieve_full_rows,
quick->quick_prefix_select= NULL;
quick->update_key_stat();
quick->adjust_prefix_ranges();
DBUG_RETURN(quick);
}
@ -8605,6 +8606,42 @@ bool QUICK_GROUP_MIN_MAX_SELECT::add_range(SEL_ARG *sel_range)
}
/*
Opens the ranges if there are more conditions in quick_prefix_select than
the ones used for jumping through the prefixes.
SYNOPSIS
QUICK_GROUP_MIN_MAX_SELECT::adjust_prefix_ranges()
NOTES
quick_prefix_select is made over the conditions on the whole key.
It defines a number of ranges of length x.
However when jumping through the prefixes we use only the the first
few most significant keyparts in the range key. However if there
are more keyparts to follow the ones we are using we must make the
condition on the key inclusive (because x < "ab" means
x[0] < 'a' OR (x[0] == 'a' AND x[1] < 'b').
To achive the above we must turn off the NEAR_MIN/NEAR_MAX
*/
void QUICK_GROUP_MIN_MAX_SELECT::adjust_prefix_ranges ()
{
if (quick_prefix_select &&
group_prefix_len < quick_prefix_select->max_used_key_length)
{
DYNAMIC_ARRAY *arr;
uint inx;
for (inx= 0, arr= &quick_prefix_select->ranges; inx < arr->elements; inx++)
{
QUICK_RANGE *range;
get_dynamic(arr, (gptr)&range, inx);
range->flag &= ~(NEAR_MIN | NEAR_MAX);
}
}
}
/*
Determine the total number and length of the keys that will be used for
index lookup.