diff options
author | serg@serg.mylan <> | 2003-07-07 16:45:19 +0200 |
---|---|---|
committer | serg@serg.mylan <> | 2003-07-07 16:45:19 +0200 |
commit | ec1aca5c52c7e861833b7ee432849757991b6a13 (patch) | |
tree | 548e580915dd24ab664df8240d20a49c20ffc3d6 /sql/sql_select.cc | |
parent | 38a2ed6f8b4f1fb1610a90585aef58eabd3e46a0 (diff) | |
download | mariadb-git-ec1aca5c52c7e861833b7ee432849757991b6a13.tar.gz |
correct (finally) condition for MATCH >0, >=0 etc in add_ft_keys (SW#1647)
still no rec. descent
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7176337dbfd..55f10ab930b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1655,17 +1655,17 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array, { Item_func *arg0=(Item_func *)(func->arguments()[0]), *arg1=(Item_func *)(func->arguments()[1]); - if ((functype == Item_func::GE_FUNC || - functype == Item_func::GT_FUNC) && - arg0->type() == Item::FUNC_ITEM && - arg0->functype() == Item_func::FT_FUNC && - arg1->const_item() && arg1->val()>0) + if (arg1->const_item() && + ((functype == Item_func::GE_FUNC && arg1->val()> 0) || + (functype == Item_func::GT_FUNC && arg1->val()>=0)) && + arg0->type() == Item::FUNC_ITEM && + arg0->functype() == Item_func::FT_FUNC) cond_func=(Item_func_match *) arg0; - else if ((functype == Item_func::LE_FUNC || - functype == Item_func::LT_FUNC) && + else if (arg0->const_item() && + ((functype == Item_func::LE_FUNC && arg0->val()> 0) || + (functype == Item_func::LT_FUNC && arg0->val()>=0)) && arg1->type() == Item::FUNC_ITEM && - arg1->functype() == Item_func::FT_FUNC && - arg0->const_item() && arg0->val()>0) + arg1->functype() == Item_func::FT_FUNC) cond_func=(Item_func_match *) arg1; } } |