1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

WL#1562 (Improving spatial code)

A set of changes improving our RTree indexes and fixed few bugs
found during the tests
This commit is contained in:
hf@deer.(none)
2004-05-25 15:06:32 +05:00
parent 216c3a3b5f
commit f200b0fbf0
8 changed files with 207 additions and 57 deletions

View File

@ -265,12 +265,12 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
n_dim = keyinfo->keysegs / 2;
if (!my_multi_malloc(MYF(0),
&coord_buf, n_dim * 2 * sizeof(double) * (max_keys + 1 + 4),
&task, sizeof(SplitStruct) * (max_keys + 1),
NullS))
if (!(coord_buf= my_alloca(n_dim * 2 * sizeof(double) * (max_keys + 1 + 4) +
sizeof(SplitStruct) * (max_keys + 1))))
return -1;
task= (SplitStruct *)(coord_buf + n_dim * 2 * (max_keys + 1 + 4));
next_coord = coord_buf;
stop = task + max_keys;
@ -343,6 +343,6 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
my_afree((byte*)new_page);
split_err:
my_free((gptr) coord_buf, MYF(0));
my_afree((byte*) coord_buf);
return err_code;
}