1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

range.result, range.test:

Added a test case for bug #10031.
opt_range.cc:
  Fixed bug #10031: range condition was not used with
  views. Range analyzer did not take into account that
  view columns were always referred through Item_ref.


sql/opt_range.cc:
  Fixed bug #10031: range condition was not used with
  views. Range analyzer did not take into account that
  view columns were always referred through Item_ref.
mysql-test/t/range.test:
  Added a test case for bug #10031.
mysql-test/r/range.result:
  Added a test case for bug #10031.
This commit is contained in:
unknown
2005-06-28 07:27:00 -07:00
parent 1d937708e8
commit 1031b871e7
3 changed files with 53 additions and 5 deletions

View File

@ -3581,15 +3581,16 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
DBUG_RETURN(ftree);
}
default:
if (cond_func->arguments()[0]->type() == Item::FIELD_ITEM)
if (cond_func->arguments()[0]->real_item()->type() == Item::FIELD_ITEM)
{
field_item= (Item_field*) (cond_func->arguments()[0]);
field_item= (Item_field*) (cond_func->arguments()[0]->real_item());
value= cond_func->arg_count > 1 ? cond_func->arguments()[1] : 0;
}
else if (cond_func->have_rev_func() &&
cond_func->arguments()[1]->type() == Item::FIELD_ITEM)
cond_func->arguments()[1]->real_item()->type() ==
Item::FIELD_ITEM)
{
field_item= (Item_field*) (cond_func->arguments()[1]);
field_item= (Item_field*) (cond_func->arguments()[1]->real_item());
value= cond_func->arguments()[0];
}
else
@ -3610,7 +3611,7 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
for (uint i= 0; i < cond_func->arg_count; i++)
{
Item *arg= cond_func->arguments()[i];
Item *arg= cond_func->arguments()[i]->real_item();
if (arg != field_item)
ref_tables|= arg->used_tables();
}