Commit 008b9361 authored by ram@mysql.r18.ru's avatar ram@mysql.r18.ru

Bug fix: we should set proper my_errno

parent 4f930a7c
...@@ -158,7 +158,10 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length, ...@@ -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; MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
{
my_errno= HA_ERR_END_OF_FILE;
return -1; return -1;
}
/* Save searched key */ /* Save searched key */
memcpy(info->lastkey2, key, keyinfo->keylength - info->s->base.rec_reflength); 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) ...@@ -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) if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
{
my_errno= HA_ERR_END_OF_FILE;
return -1; return -1;
}
nod_cmp_flag = ((search_flag & (MBR_EQUAL | MBR_WITHIN)) ? nod_cmp_flag = ((search_flag & (MBR_EQUAL | MBR_WITHIN)) ?
MBR_WITHIN : MBR_INTERSECT); MBR_WITHIN : MBR_INTERSECT);
...@@ -340,7 +346,10 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length) ...@@ -340,7 +346,10 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length)
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
{
my_errno= HA_ERR_END_OF_FILE;
return -1; return -1;
}
info->rtree_recursion_depth = -1; info->rtree_recursion_depth = -1;
info->buff_used = 1; info->buff_used = 1;
...@@ -383,7 +392,10 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length) ...@@ -383,7 +392,10 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
else else
{ {
if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
{
my_errno= HA_ERR_END_OF_FILE;
return -1; return -1;
}
return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0); 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) ...@@ -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) 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; 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