Commit dfa4fad4 authored by unknown's avatar unknown

Bug fix: we should set proper my_errno

parent 64d48cd6
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment