1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with

fulltext search and row op.

The search for fulltext indexes is searching for some special 
predicate layouts. While doing so it's not checking for the number
of columns of the expressions it tries to calculate.
And since row expressions can't return a single scalar value there
was a crash.
Fixed by checking if the expressions are scalar (in addition to 
being constant) before calling Item::val_xxx() methods.
This commit is contained in:
Georgi Kodinov
2010-02-02 18:37:56 +02:00
parent 090c75d2b0
commit e4b7138561
3 changed files with 30 additions and 12 deletions

View File

@@ -3650,20 +3650,20 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
cond_func=(Item_func_match *)cond;
else if (func->arg_count == 2)
{
Item_func *arg0=(Item_func *)(func->arguments()[0]),
*arg1=(Item_func *)(func->arguments()[1]);
if (arg1->const_item() &&
Item *arg0= func->arguments()[0],
*arg1= func->arguments()[1];
if (arg1->const_item() && arg1->cols() == 1 &&
((functype == Item_func::GE_FUNC && arg1->val_real() > 0) ||
(functype == Item_func::GT_FUNC && arg1->val_real() >=0)) &&
arg0->type() == Item::FUNC_ITEM &&
arg0->functype() == Item_func::FT_FUNC)
cond_func=(Item_func_match *) arg0;
else if (arg0->const_item() &&
(functype == Item_func::GT_FUNC && arg1->val_real() >= 0)) &&
arg0->type() == Item::FUNC_ITEM &&
((Item_func *) arg0)->functype() == Item_func::FT_FUNC)
cond_func= (Item_func_match *) arg0;
else if (arg0->const_item() && arg0->cols() == 1 &&
((functype == Item_func::LE_FUNC && arg0->val_real() > 0) ||
(functype == Item_func::LT_FUNC && arg0->val_real() >=0)) &&
arg1->type() == Item::FUNC_ITEM &&
arg1->functype() == Item_func::FT_FUNC)
cond_func=(Item_func_match *) arg1;
(functype == Item_func::LT_FUNC && arg0->val_real() >= 0)) &&
arg1->type() == Item::FUNC_ITEM &&
((Item_func *) arg1)->functype() == Item_func::FT_FUNC)
cond_func= (Item_func_match *) arg1;
}
}
else if (cond->type() == Item::COND_ITEM)