From 8d6634c9e0c43b2d4ed2b0cc9f90b66c850855ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Oct 2005 02:27:40 +0300 Subject: 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 --- mysys/my_handler.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'mysys') diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 135480756da..3eed0ee6c08 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -86,15 +86,9 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, position and this should also be compared diff_pos OUT Number of first keypart where values differ, counting from one. - - DESCRIPTION - If SEARCH_RETURN_B_POS flag is set, diff_pos must point to array of 2 - values, first value has the meaning as described in parameter - description above, the second value is: - - diff_pos[1] OUT (b + diff_pos[1]) points to first value in tuple b + diff_pos[1] OUT (b + diff_pos[1]) points to first value in tuple b that is different from corresponding value in tuple a. - + EXAMPLES Example1: if the function is called for tuples ('aaa','bbb') and ('eee','fff'), then @@ -137,9 +131,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, uchar *end; uint piks=! (keyseg->flag & HA_NO_SORT); (*diff_pos)++; - - if (nextflag & SEARCH_RETURN_B_POS) - diff_pos[1]= (uint)(b - orig_b); + diff_pos[1]= (uint)(b - orig_b); /* Handle NULL part */ if (keyseg->null_bit) -- cgit v1.2.1