summaryrefslogtreecommitdiff
path: root/storage/maria/ma_search.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/maria/ma_search.c')
-rw-r--r--storage/maria/ma_search.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 98bac11e8d4..cf7ec5f9724 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -116,7 +116,8 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
((keyinfo->flag & (HA_NOSAME | HA_NULL_PART)) != HA_NOSAME ||
(key->flag & SEARCH_PART_KEY) || info->s->base.born_transactional))
{
- if ((error= _ma_search(info, key, nextflag,
+ if ((error= _ma_search(info, key, (nextflag | SEARCH_FIND) &
+ ~(SEARCH_BIGGER | SEARCH_SMALLER | SEARCH_LAST),
_ma_kpos(nod_flag,keypos))) >= 0 ||
my_errno != HA_ERR_KEY_NOT_FOUND)
DBUG_RETURN(error);
@@ -338,10 +339,8 @@ int _ma_seq_search(const MARIA_KEY *key, uchar *page,
comp_flag | tmp_key.flag,
not_used)) >= 0)
break;
-#ifdef EXTRA_DEBUG
- DBUG_PRINT("loop",("page: 0x%lx key: '%s' flag: %d", (long) page, t_buff,
- flag));
-#endif
+ DBUG_PRINT("loop_extra",("page: 0x%lx key: '%s' flag: %d",
+ (long) page, t_buff, flag));
memcpy(buff,t_buff,length);
*ret_pos=page;
}
@@ -2195,9 +2194,10 @@ int _ma_calc_bin_pack_key_length(const MARIA_KEY *int_key,
if (next_length > ref_length)
{
- /* We put a key with different case between two keys with the same prefix
- Extend next key to have same prefix as
- this key */
+ /*
+ We put a key with different case between two keys with the same prefix
+ Extend next key to have same prefix as this key
+ */
s_temp->n_ref_length= ref_length;
s_temp->prev_length= next_length-ref_length;
s_temp->prev_key+= ref_length;
@@ -2207,13 +2207,13 @@ int _ma_calc_bin_pack_key_length(const MARIA_KEY *int_key,
}
/* Check how many characters are identical to next key */
key= s_temp->key+next_length;
+ s_temp->prev_length= 0;
while (*key++ == *next_key++) ;
if ((ref_length= (uint) (key - s_temp->key)-1) == next_length)
{
s_temp->next_key_pos=0;
return (s_temp->move_length= length); /* Can't pack next key */
}
- s_temp->prev_length=0;
s_temp->n_ref_length=ref_length;
return s_temp->move_length= (int) (length-(ref_length - next_length) -
next_length_pack +