mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 13:15:32 +02:00
Ill-minded FULLTEXT impilict initialization hack removed.
From now on FULLTEXT search is initialized expilictly in mysql_select() sql/item_func.cc: FULLTEXT expilict initialization sql/opt_ft.h: FULLTEXT expilict initialization sql/opt_range.h: FULLTEXT expilict initialization sql/ha_myisam.cc: FULLTEXT expilict initialization sql/ha_myisam.h: FULLTEXT expilict initialization sql/handler.h: FULLTEXT expilict initialization sql/item_func.h: FULLTEXT expilict initialization sql/sql_select.cc: FULLTEXT expilict initialization myisam/ft_search.c: FULLTEXT expilict initialization
This commit is contained in:
parent
2db1639c90
commit
e735267f69
9 changed files with 44 additions and 74 deletions
|
|
@ -1840,9 +1840,6 @@ err:
|
|||
|
||||
double Item_func_match::val()
|
||||
{
|
||||
if (first_call)
|
||||
init_search();
|
||||
|
||||
// Don't know how to return an error from val(), so NULL will be returned
|
||||
if ((null_value=(ft_handler==NULL)))
|
||||
return 0.0;
|
||||
|
|
@ -1853,8 +1850,7 @@ double Item_func_match::val()
|
|||
}
|
||||
else
|
||||
{
|
||||
/* implicit initialization was done, so we'll have to find
|
||||
ft_relevance manually in ft_handler array */
|
||||
/* we'll have to find ft_relevance manually in ft_handler array */
|
||||
|
||||
int a,b,c;
|
||||
FT_DOC *docs=ft_handler->doc;
|
||||
|
|
@ -1881,9 +1877,8 @@ double Item_func_match::val()
|
|||
|
||||
void Item_func_match::init_search()
|
||||
{
|
||||
if (!first_call)
|
||||
if (ft_handler)
|
||||
return;
|
||||
first_call=false;
|
||||
|
||||
if (master)
|
||||
{
|
||||
|
|
@ -1893,20 +1888,19 @@ void Item_func_match::init_search()
|
|||
return;
|
||||
}
|
||||
|
||||
if (join_key)
|
||||
{
|
||||
ft_handler=((FT_DOCLIST *)table->file->ft_handler);
|
||||
return;
|
||||
}
|
||||
|
||||
/* join won't use this ft-key, but we must to init it anyway */
|
||||
String *ft_tmp=0;
|
||||
char tmp1[FT_QUERY_MAXLEN];
|
||||
String tmp2(tmp1,sizeof(tmp1));
|
||||
|
||||
ft_tmp=key_item()->val_str(&tmp2);
|
||||
ft_handler=(FT_DOCLIST *)
|
||||
table->file->ft_init_ext(key, (byte*) ft_tmp->ptr(), ft_tmp->length());
|
||||
table->file->ft_init_ext(key, (byte*) ft_tmp->ptr(), ft_tmp->length(), join_key);
|
||||
|
||||
if (join_key)
|
||||
{
|
||||
table->file->ft_handler=ft_handler;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist)
|
||||
|
|
@ -1917,6 +1911,8 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist)
|
|||
/* Why testing for const_item ? Monty */
|
||||
/* I'll remove it later, but this should include modifications to
|
||||
find_best and auto_close as complement to auto_init code above. SerG */
|
||||
/* I'd rather say now that const_item is assumed in quite a bit of
|
||||
places, so it would be difficult to remove. SerG */
|
||||
if (Item_func::fix_fields(thd,tlist) || !const_item())
|
||||
return 1;
|
||||
|
||||
|
|
@ -1996,7 +1992,6 @@ bool Item_func_match::fix_index()
|
|||
}
|
||||
|
||||
this->key=max_key;
|
||||
first_call=1;
|
||||
maybe_null=1;
|
||||
join_key=0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue