summaryrefslogtreecommitdiff
path: root/myisam/mi_search.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-10-25 02:27:40 +0300
committerunknown <monty@mysql.com>2005-10-25 02:27:40 +0300
commit8d6634c9e0c43b2d4ed2b0cc9f90b66c850855ab (patch)
tree56b86b67bce65a21ff4ffd27cd2dd139b110b622 /myisam/mi_search.c
parent3c02a0534d4b5450b2a5126bbf84428595c4a803 (diff)
downloadmariadb-git-8d6634c9e0c43b2d4ed2b0cc9f90b66c850855ab.tar.gz
Added more tests for new UPDATE ... ORDER BY ... LIMIT optimization
heap/_check.c: Change arguments to ha_key_cmp heap/hp_create.c: Change arguments to ha_key_cmp include/my_base.h: Remove SEARCH_RETURN_B_POS and instead always send an array to ha_key_cmp() as last argument myisam/mi_check.c: Change arguments to ha_key_cmp myisam/mi_rnext_same.c: Change arguments to ha_key_cmp myisam/mi_search.c: Change arguments to ha_key_cmp myisam/mi_write.c: Change arguments to ha_key_cmp myisammrg/myrg_queue.c: Change arguments to ha_key_cmp mysys/my_handler.c: Remove SEARCH_RETURN_B_POS and instead always send an array to ha_key_cmp() as last argument (This removes an if in a loop at the expensive of an int on the stack) sql/records.cc: Simplify new rr_index() code Create common error handling function for rr_() functions. Remove loop from rr_index() as handler::index_next() can never return HA_ERR_RECORD_DELETED sql/sql_load.cc: Simplify sql/sql_update.cc: Simplify code Fixed bug when one is updating an index column that could be used with ORDER BY sql/structs.h: Removed not needed structure element
Diffstat (limited to 'myisam/mi_search.c')
-rw-r--r--myisam/mi_search.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index 4ea2480889e..9321f5b87d5 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -128,13 +128,13 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0)
{
- uint not_used;
+ uint not_used[2];
if (_mi_get_prev_key(info,keyinfo, buff, info->lastkey, keypos,
&info->lastkey_length))
goto err;
if (!(nextflag & SEARCH_SMALLER) &&
ha_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND,
- &not_used))
+ not_used))
{
my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */
goto err;
@@ -178,7 +178,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
reg4 int start,mid,end,save_end;
int flag;
- uint totlength,nod_flag,not_used;
+ uint totlength,nod_flag,not_used[2];
DBUG_ENTER("_mi_bin_search");
LINT_INIT(flag);
@@ -192,7 +192,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
mid= (start+end)/2;
if ((flag=ha_key_cmp(keyinfo->seg,page+(uint) mid*totlength,key,key_len,
- comp_flag,&not_used))
+ comp_flag, not_used))
>= 0)
end=mid;
else
@@ -200,7 +200,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
}
if (mid != start)
flag=ha_key_cmp(keyinfo->seg,page+(uint) start*totlength,key,key_len,
- comp_flag,&not_used);
+ comp_flag, not_used);
if (flag < 0)
start++; /* point at next, bigger key */
*ret_pos=page+(uint) start*totlength;
@@ -241,7 +241,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *buff, my_bool *last_key)
{
int flag;
- uint nod_flag,length,not_used;
+ uint nod_flag,length,not_used[2];
uchar t_buff[MI_MAX_KEY_BUFF],*end;
DBUG_ENTER("_mi_seq_search");
@@ -262,7 +262,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
DBUG_RETURN(MI_FOUND_WRONG_KEY);
}
if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag,
- &not_used)) >= 0)
+ not_used)) >= 0)
break;
#ifdef EXTRA_DEBUG
DBUG_PRINT("loop",("page: %lx key: '%s' flag: %d", (long) page, t_buff,
@@ -503,9 +503,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
cmp_rest:
if (key_len_left>0)
{
- uint not_used;
+ uint not_used[2];
if ((flag = ha_key_cmp(keyinfo->seg+1,vseg,
- k,key_len_left,nextflag,&not_used)) >= 0)
+ k, key_len_left, nextflag, not_used)) >= 0)
break;
}
else