summaryrefslogtreecommitdiff
path: root/myisam/rt_split.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-05-20 16:14:35 +0300
committerunknown <monty@mysql.com>2005-05-20 16:14:35 +0300
commit027c10f3bbc5ad54a104909f5587effe246d7ed5 (patch)
treeaa7fb9173589000beb4052d77262a95532b07c2e /myisam/rt_split.c
parent3034935a875d959c21af79d08fbda2a1d32f11c6 (diff)
downloadmariadb-git-027c10f3bbc5ad54a104909f5587effe246d7ed5.tar.gz
compatibility issues
Fixed errors reported by valgrind (some errors in NDB remains) myisam/rt_split.c: Added missing cast that caused problem on novell (minor code cleanup) ndb/src/ndbapi/Ndb.cpp: Moved DBUG_ENTER to remove warning from DBUG library sql/field_conv.cc: Added test for valgrind/purify to avoid warning sql/item_sum.cc: Removed comment and added ASSERT as setup can't be called twice anymore sql/sql_delete.cc: Fixed wrong return value sql/sql_parse.cc: More debugging sql/sql_select.cc: Removed duplicate call to setup() which caused a memory leak strings/my_vsnprintf.c: Added support for '%c' (used when printing my_getopt errors)
Diffstat (limited to 'myisam/rt_split.c')
-rw-r--r--myisam/rt_split.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/myisam/rt_split.c b/myisam/rt_split.c
index 005e86805bb..31a7d09ab4f 100644
--- a/myisam/rt_split.c
+++ b/myisam/rt_split.c
@@ -257,18 +257,17 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
int n_dim;
uchar *source_cur, *cur1, *cur2;
uchar *new_page;
- int err_code = 0;
-
- uint nod_flag = mi_test_if_nod(page);
- uint full_length = key_length + (nod_flag ? nod_flag :
- info->s->base.rec_reflength);
-
- int max_keys = (mi_getint(page)-2) / (full_length);
+ int err_code= 0;
+ uint nod_flag= mi_test_if_nod(page);
+ uint full_length= key_length + (nod_flag ? nod_flag :
+ info->s->base.rec_reflength);
+ int max_keys= (mi_getint(page)-2) / (full_length);
n_dim = keyinfo->keysegs / 2;
- if (!(coord_buf= my_alloca(n_dim * 2 * sizeof(double) * (max_keys + 1 + 4) +
- sizeof(SplitStruct) * (max_keys + 1))))
+ if (!(coord_buf= (double*) 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));
@@ -311,8 +310,7 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
cur1 = rt_PAGE_FIRST_KEY(page, nod_flag);
cur2 = rt_PAGE_FIRST_KEY(new_page, nod_flag);
- n1 = 0;
- n2 = 0;
+ n1= n2 = 0;
for (cur = task; cur < stop; ++cur)
{
uchar *to;