summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_boolean_search.c11
-rw-r--r--myisam/mi_packrec.c7
-rw-r--r--myisam/rt_index.c7
-rw-r--r--myisam/sort.c3
4 files changed, 12 insertions, 16 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index c38bffed665..4e66bd92a94 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -346,11 +346,12 @@ static void _ftb_init_index_search(FT_INFO *ftb)
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */
{
- FTB_EXPR *top_ftbe=ftbe->up->up;
+ FTB_EXPR *top_ftbe=ftbe->up;
ftbw->docid[0]=HA_OFFSET_ERROR;
- for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up)
- if (!(ftbe->flags & FTB_FLAG_NO))
- ftbe->yweaks++;
+ for (ftbe=(FTB_EXPR *)ftbw;
+ ftbe != top_ftbe && !(ftbe->flags & FTB_FLAG_NO);
+ ftbe=ftbe->up)
+ ftbe->up->yweaks++;
ftbe=0;
break;
}
@@ -364,7 +365,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
else
reset_tree(& ftb->no_dupes);
}
-
+
if (_ft2_search(ftb, ftbw, 1))
return;
}
diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c
index 62d15c03266..a8a27858d79 100644
--- a/myisam/mi_packrec.c
+++ b/myisam/mi_packrec.c
@@ -184,21 +184,14 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+
(uint) (share->pack.header_length+7),
MYF(MY_WME | MY_ZEROFILL))))
- {
- my_free((gptr) share->decode_trees,MYF(0));
goto err1;
- }
tmp_buff=share->decode_tables+length;
disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE);
if (my_read(file,disk_cache,
(uint) (share->pack.header_length-sizeof(header)),
MYF(MY_NABP)))
- {
- my_free((gptr) share->decode_trees,MYF(0));
- my_free((gptr) share->decode_tables,MYF(0));
goto err2;
- }
huff_tree_bits=max_bit(trees ? trees-1 : 0);
init_bit_buffer(&bit_buff, (uchar*) disk_cache,
diff --git a/myisam/rt_index.c b/myisam/rt_index.c
index bdf5ee9c60f..97554dca4e6 100644
--- a/myisam/rt_index.c
+++ b/myisam/rt_index.c
@@ -948,15 +948,14 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
/* check for redundant root (not leaf, 1 child) and eliminate */
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
goto err1;
- if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS,
+ if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS,
info->buff, 0))
goto err1;
nod_flag = mi_test_if_nod(info->buff);
page_size = mi_getint(info->buff);
- if (nod_flag && (page_size == 2 + key_length +
- (nod_flag ? nod_flag : info->s->base.rec_reflength)))
+ if (nod_flag && (page_size == 2 + key_length + nod_flag))
{
- my_off_t new_root = _mi_kpos(nod_flag,
+ my_off_t new_root = _mi_kpos(nod_flag,
rt_PAGE_FIRST_KEY(info->buff, nod_flag));
if (_mi_dispose(info, keyinfo, old_root, DFLT_INIT_HITS))
goto err1;
diff --git a/myisam/sort.c b/myisam/sort.c
index 09dd45f388c..9d2af2e8c70 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -162,7 +162,10 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
{
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2))
+ {
my_free((gptr) sort_keys,MYF(0));
+ sort_keys= 0;
+ }
else
break;
}