diff options
author | unknown <ram@mysql.r18.ru> | 2003-03-31 13:32:34 +0500 |
---|---|---|
committer | unknown <ram@mysql.r18.ru> | 2003-03-31 13:32:34 +0500 |
commit | d0038aa7d5cc540e7d897d7fc0b4105fa8b6353f (patch) | |
tree | c04681f585fbe365ecfc6fb73ade3761a1b6cbfb /myisam | |
parent | 48d0071395d5c4dc34a357a270bb67d27c4fbbdf (diff) | |
download | mariadb-git-d0038aa7d5cc540e7d897d7fc0b4105fa8b6353f.tar.gz |
Bug fix: should use my_multi_malloc() here!!!
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/rt_split.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/myisam/rt_split.c b/myisam/rt_split.c index 879cc0dc1dd..9ab26c78171 100644 --- a/myisam/rt_split.c +++ b/myisam/rt_split.c @@ -264,16 +264,15 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, int max_keys = (mi_getint(page)-2) / (full_length); 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)) + return -1; - { - int coord_buf_size = n_dim * 2 * sizeof(double) * (max_keys + 1 + 4); - coord_buf = - my_alloca(coord_buf_size + sizeof(SplitStruct) * (max_keys + 1)); - - task = (SplitStruct *)(((char *)coord_buf) + coord_buf_size); - } next_coord = coord_buf; - + stop = task + max_keys; source_cur = rt_PAGE_FIRST_KEY(page, nod_flag); |