mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Two-level index structure for FULLTEXT indexes
This commit is contained in:
@ -71,7 +71,8 @@ static int NEAR_F merge_buffers(MI_SORT_PARAM *info,uint keys,
|
||||
BUFFPEK *Fb, BUFFPEK *Tb);
|
||||
static int NEAR_F merge_index(MI_SORT_PARAM *,uint,uchar **,BUFFPEK *, int,
|
||||
IO_CACHE *);
|
||||
|
||||
static int flush_ft_buf(MI_SORT_PARAM *info);
|
||||
|
||||
static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,uchar **sort_keys,
|
||||
uint count, BUFFPEK *buffpek,
|
||||
IO_CACHE *tempfile);
|
||||
@ -120,7 +121,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
|
||||
info->read_to_buffer=read_to_buffer;
|
||||
info->write_key=write_merge_key;
|
||||
}
|
||||
|
||||
|
||||
my_b_clear(&tempfile);
|
||||
my_b_clear(&tempfile_for_exceptions);
|
||||
bzero((char*) &buffpek,sizeof(buffpek));
|
||||
@ -207,7 +208,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
|
||||
goto err; /* purecov: inspected */
|
||||
}
|
||||
|
||||
if (flush_pending_blocks(info))
|
||||
if (flush_ft_buf(info) || flush_pending_blocks(info))
|
||||
goto err;
|
||||
|
||||
if (my_b_inited(&tempfile_for_exceptions))
|
||||
@ -478,7 +479,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
|
||||
fflush(stdout);
|
||||
}
|
||||
if (write_index(sinfo, sinfo->sort_keys, sinfo->keys) ||
|
||||
flush_pending_blocks(sinfo))
|
||||
flush_ft_buf(sinfo) || flush_pending_blocks(sinfo))
|
||||
got_error=1;
|
||||
}
|
||||
}
|
||||
@ -551,6 +552,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
|
||||
if (merge_index(sinfo, keys, (uchar **)mergebuf,
|
||||
dynamic_element(&sinfo->buffpek,0,BUFFPEK *),
|
||||
maxbuffer,&sinfo->tempfile) ||
|
||||
flush_ft_buf(sinfo) ||
|
||||
flush_pending_blocks(sinfo))
|
||||
{
|
||||
got_error=1;
|
||||
@ -976,3 +978,16 @@ merge_index(MI_SORT_PARAM *info, uint keys, uchar **sort_keys,
|
||||
DBUG_RETURN(0);
|
||||
} /* merge_index */
|
||||
|
||||
static int
|
||||
flush_ft_buf(MI_SORT_PARAM *info)
|
||||
{
|
||||
int err=0;
|
||||
if (info->sort_info->ft_buf)
|
||||
{
|
||||
err=sort_ft_buf_flush(info);
|
||||
my_free((gptr)info->sort_info->ft_buf, MYF(0));
|
||||
info->sort_info->ft_buf=0;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user