summaryrefslogtreecommitdiff
path: root/storage/myisam/rt_key.c
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-03-08 12:13:54 +0100
committerunknown <istruewing@chilla.local>2007-03-08 12:13:54 +0100
commit2923b0d40ccc0f294ef221fa7a68894f67c23497 (patch)
tree34e6c154ab025381413ec6ad4616177ffe853cca /storage/myisam/rt_key.c
parent8bf49833318770d5e9a559b8cdc66f9cc02a5f55 (diff)
parent2157f642380a766d4d859997b624a8cd0bfc7e80 (diff)
downloadmariadb-git-2923b0d40ccc0f294ef221fa7a68894f67c23497.tar.gz
Merge chilla.local:/home/mydev/mysql-5.0-bug25673
into chilla.local:/home/mydev/mysql-5.1-bug25673 mysql-test/r/gis-rtree.result: Auto merged mysql-test/t/gis-rtree.test: Auto merged storage/myisam/rt_index.c: Auto merged storage/myisam/rt_key.c: Auto merged storage/myisam/rt_split.c: Auto merged
Diffstat (limited to 'storage/myisam/rt_key.c')
-rw-r--r--storage/myisam/rt_key.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/storage/myisam/rt_key.c b/storage/myisam/rt_key.c
index cb6a82c51f6..fe59af3c605 100644
--- a/storage/myisam/rt_key.c
+++ b/storage/myisam/rt_key.c
@@ -34,6 +34,7 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
{
uint page_size = mi_getint(page_buf);
uint nod_flag = mi_test_if_nod(page_buf);
+ DBUG_ENTER("rtree_add_key");
if (page_size + key_length + info->s->base.rec_reflength <=
keyinfo->block_length)
@@ -42,22 +43,26 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
if (nod_flag)
{
/* save key */
+ DBUG_ASSERT(_mi_kpos(nod_flag, key) < info->state->key_file_length);
memcpy(rt_PAGE_END(page_buf), key - nod_flag, key_length + nod_flag);
page_size += key_length + nod_flag;
}
else
{
/* save key */
+ DBUG_ASSERT(_mi_dpos(info, nod_flag, key + key_length +
+ info->s->base.rec_reflength) <
+ info->state->data_file_length + info->s->base.pack_reclength);
memcpy(rt_PAGE_END(page_buf), key, key_length +
info->s->base.rec_reflength);
page_size += key_length + info->s->base.rec_reflength;
}
mi_putint(page_buf, page_size, nod_flag);
- return 0;
+ DBUG_RETURN(0);
}
- return (rtree_split_page(info, keyinfo, page_buf, key, key_length,
- new_page) ? -1 : 1);
+ DBUG_RETURN((rtree_split_page(info, keyinfo, page_buf, key, key_length,
+ new_page) ? -1 : 1));
}
/*
@@ -89,11 +94,13 @@ int rtree_delete_key(MI_INFO *info, uchar *page_buf, uchar *key,
int rtree_set_key_mbr(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint key_length, my_off_t child_page)
{
+ DBUG_ENTER("rtree_set_key_mbr");
+
if (!_mi_fetch_keypage(info, keyinfo, child_page,
DFLT_INIT_HITS, info->buff, 0))
- return -1;
+ DBUG_RETURN(-1); /* purecov: inspected */
- return rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length);
+ DBUG_RETURN(rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length));
}
#endif /*HAVE_RTREE_KEYS*/