mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
Bug#16073689 : CRASH IN ITEM_FUNC_MATCH::INIT_SEARCH
Problem: In query like select 1 from .. order by match .. against ...; causes a debug assert failue. Analysis: In union type query like (select * from order by a) order by b; or (select * from order by a) union (select * from order by b); We skip resolving of order by a for 1st query and order by of a and b in 2nd query. This means that, in case when our order by have Item_func_match class, we skip resolving it. But we maintain a ft_func_list and at the time of optimization, when we Perform FULLTEXT search before all regular searches on the bases of the list we call Item_func_match::init_search() which will cause debug assert as the item is not resolved. Solution: We will skip execution if the item is not fixed and we will not fix index(Item_func_match::fix_index()) for which Item_func_match::fix_field() is not called so that on later changes we can check the dependency on fix field. sql/item_func.cc: skiping execution, if item is not resolved.
This commit is contained in:
parent
7c384a9333
commit
89b1b50844
1 changed files with 14 additions and 0 deletions
|
@ -5316,6 +5316,13 @@ void Item_func_match::init_search(bool no_order)
|
|||
{
|
||||
DBUG_ENTER("Item_func_match::init_search");
|
||||
|
||||
/*
|
||||
We will skip execution if the item is not fixed
|
||||
with fix_field
|
||||
*/
|
||||
if (!fixed)
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
/* Check if init_search() has been called before */
|
||||
if (ft_handler)
|
||||
{
|
||||
|
@ -5446,6 +5453,13 @@ bool Item_func_match::fix_index()
|
|||
uint ft_to_key[MAX_KEY], ft_cnt[MAX_KEY], fts=0, keynr;
|
||||
uint max_cnt=0, mkeys=0, i;
|
||||
|
||||
/*
|
||||
We will skip execution if the item is not fixed
|
||||
with fix_field
|
||||
*/
|
||||
if (!fixed)
|
||||
return false;
|
||||
|
||||
if (key == NO_SUCH_KEY)
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue