mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Bug fix: we should set proper my_errno
This commit is contained in:
parent
4f930a7c2a
commit
008b9361bb
1 changed files with 13 additions and 1 deletions
|
@ -158,7 +158,10 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
|
|||
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
|
||||
|
||||
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
{
|
||||
my_errno= HA_ERR_END_OF_FILE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Save searched key */
|
||||
memcpy(info->lastkey2, key, keyinfo->keylength - info->s->base.rec_reflength);
|
||||
|
@ -217,7 +220,10 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag)
|
|||
}
|
||||
}
|
||||
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
{
|
||||
my_errno= HA_ERR_END_OF_FILE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
nod_cmp_flag = ((search_flag & (MBR_EQUAL | MBR_WITHIN)) ?
|
||||
MBR_WITHIN : MBR_INTERSECT);
|
||||
|
@ -340,7 +346,10 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length)
|
|||
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
|
||||
|
||||
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
{
|
||||
my_errno= HA_ERR_END_OF_FILE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
info->rtree_recursion_depth = -1;
|
||||
info->buff_used = 1;
|
||||
|
@ -383,7 +392,10 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
|
|||
else
|
||||
{
|
||||
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
{
|
||||
my_errno= HA_ERR_END_OF_FILE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0);
|
||||
}
|
||||
|
@ -732,7 +744,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
|
|||
|
||||
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
{
|
||||
my_errno = HA_ERR_KEY_NOT_FOUND;
|
||||
my_errno= HA_ERR_END_OF_FILE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue