mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Removed some warnings reported by valgrind
After merge fixes. Now code compiles, but there is still some valgrind warnings that needs to be fixed myisam/mi_rnext_same.c: handle case where rtree_find_next() returns an error (assume this means that there was no more keys) myisam/rt_index.c: Code cleanup mysql-test/r/func_crypt.result: Update results mysql-test/r/func_group.result: Update results mysql-test/r/null_key.result: Update results mysql-test/r/order_by.result: Update results mysql-test/r/query_cache.result: Update results mysql-test/r/range.result: Update results mysql-test/r/rpl_trunc_binlog.result: Update results mysql-test/t/fulltext.test: Fix error numbers mysql-test/t/func_crypt.test: Fixed test for 4.1 mysql-test/t/range.test: Moved tests to be in sync with 4.0 mysys/test_charset.c: Removed acccess to non existing functions sql-common/client.c: Merge fix sql/item_strfunc.cc: Simple code cleanup Don't call ->c_ptr() when you don't need a 0 terminated string (Causes warnings from valgrind) sql/log_event.cc: After merge fixes sql/protocol.cc: Change default catalog name to 'def' sql/spatial.cc: Code cleanup sql/sql_class.cc: After merge fixes sql/time.cc: Ensure that time object is cleared on error sql/unireg.cc: Removed warning reported by valgrind
This commit is contained in:
@ -36,16 +36,21 @@ typedef struct st_page_list
|
||||
stPageLevel *pages;
|
||||
} stPageList;
|
||||
|
||||
|
||||
/*
|
||||
Find next key in r-tree according to search_flag recursively
|
||||
Used in rtree_find_first() and rtree_find_next()
|
||||
Result values:
|
||||
-1 - error
|
||||
0 - found
|
||||
1 - not found
|
||||
Find next key in r-tree according to search_flag recursively
|
||||
|
||||
NOTES
|
||||
Used in rtree_find_first() and rtree_find_next()
|
||||
|
||||
RETURN
|
||||
-1 Error
|
||||
0 Found
|
||||
1 Not found
|
||||
*/
|
||||
static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag, uint nod_cmp_flag,
|
||||
my_off_t page, int level)
|
||||
|
||||
static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
|
||||
uint nod_cmp_flag, my_off_t page, int level)
|
||||
{
|
||||
uchar *k;
|
||||
uchar *last;
|
||||
@ -143,13 +148,24 @@ err1:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Find first key in r-tree according to search_flag condition
|
||||
Result values:
|
||||
-1 - error
|
||||
0 - found
|
||||
1 - not found
|
||||
Find first key in r-tree according to search_flag condition
|
||||
|
||||
SYNOPSIS
|
||||
rtree_find_first()
|
||||
info Handler to MyISAM file
|
||||
uint keynr Key number to use
|
||||
key Key to search for
|
||||
key_length Length of 'key'
|
||||
search_flag Bitmap of flags how to do the search
|
||||
|
||||
RETURN
|
||||
-1 Error
|
||||
0 Found
|
||||
1 Not found
|
||||
*/
|
||||
|
||||
int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
|
||||
uint search_flag)
|
||||
{
|
||||
@ -175,13 +191,16 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
|
||||
return rtree_find_req(info, keyinfo, search_flag, nod_cmp_flag, root, 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Find next key in r-tree according to search_flag condition
|
||||
Result values:
|
||||
-1 - error
|
||||
0 - found
|
||||
1 - not found
|
||||
Find next key in r-tree according to search_flag condition
|
||||
|
||||
RETURN
|
||||
-1 Error
|
||||
0 Found
|
||||
1 Not found
|
||||
*/
|
||||
|
||||
int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
|
||||
{
|
||||
my_off_t root;
|
||||
@ -189,14 +208,12 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
|
||||
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
|
||||
|
||||
if (info->update & HA_STATE_DELETED)
|
||||
{
|
||||
return rtree_find_first(info, keynr, info->lastkey, info->lastkey_length,
|
||||
search_flag);
|
||||
}
|
||||
|
||||
|
||||
if (!info->buff_used)
|
||||
{
|
||||
uchar *key = info->int_keypos;
|
||||
uchar *key= info->int_keypos;
|
||||
|
||||
while (key < info->int_maxpos)
|
||||
{
|
||||
@ -205,24 +222,16 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
|
||||
{
|
||||
uchar *after_key = key + keyinfo->keylength;
|
||||
|
||||
info->lastpos = _mi_dpos(info, 0, after_key);
|
||||
info->lastpos= _mi_dpos(info, 0, after_key);
|
||||
memcpy(info->lastkey, key, info->lastkey_length);
|
||||
|
||||
if (after_key < info->int_maxpos)
|
||||
{
|
||||
info->int_keypos = after_key;
|
||||
}
|
||||
info->int_keypos= after_key;
|
||||
else
|
||||
{
|
||||
info->buff_used = 1;
|
||||
}
|
||||
|
||||
info->buff_used= 1;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
key += keyinfo->keylength;
|
||||
}
|
||||
key+= keyinfo->keylength;
|
||||
}
|
||||
}
|
||||
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
@ -236,14 +245,19 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
|
||||
return rtree_find_req(info, keyinfo, search_flag, nod_cmp_flag, root, 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Get next key in r-tree recursively
|
||||
Used in rtree_get_first() and rtree_get_next()
|
||||
Result values:
|
||||
-1 - error
|
||||
0 - found
|
||||
1 - not found
|
||||
Get next key in r-tree recursively
|
||||
|
||||
NOTES
|
||||
Used in rtree_get_first() and rtree_get_next()
|
||||
|
||||
RETURN
|
||||
-1 Error
|
||||
0 Found
|
||||
1 Not found
|
||||
*/
|
||||
|
||||
static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
|
||||
my_off_t page, int level)
|
||||
{
|
||||
|
Reference in New Issue
Block a user