summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-06-25 14:02:27 -0700
committerIgor Babaev <igor@askmonty.org>2011-06-25 14:02:27 -0700
commit77f8874c8bea09e743f4747dc84a1a0a4a376877 (patch)
tree95a5ae0663b41ff0780636275db694cdb26b6b79 /sql/opt_sum.cc
parentc68020210fa7f9ab41ba35108a109640f0b50eb5 (diff)
downloadmariadb-git-77f8874c8bea09e743f4747dc84a1a0a4a376877.tar.gz
Fixed LP bug #802023.
Made mergeable views and mergeable derived tables transparent for the MIN/MAX optimization.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 78cb2fa8210..b55f4b7d7fa 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -506,18 +506,18 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order)
break;
case 1:
/* field IS NULL */
- item= func_item->arguments()[0];
+ item= func_item->arguments()[0]->real_item();
if (item->type() != Item::FIELD_ITEM)
return 0;
args[0]= item;
break;
case 2:
/* 'field op const' or 'const op field' */
- item= func_item->arguments()[0];
+ item= func_item->arguments()[0]->real_item();
if (item->type() == Item::FIELD_ITEM)
{
args[0]= item;
- item= func_item->arguments()[1];
+ item= func_item->arguments()[1]->real_item();
if (!item->const_item())
return 0;
args[1]= item;
@@ -525,7 +525,7 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order)
else if (item->const_item())
{
args[1]= item;
- item= func_item->arguments()[1];
+ item= func_item->arguments()[1]->real_item();
if (item->type() != Item::FIELD_ITEM)
return 0;
args[0]= item;
@@ -536,13 +536,13 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order)
break;
case 3:
/* field BETWEEN const AND const */
- item= func_item->arguments()[0];
+ item= func_item->arguments()[0]->real_item();
if (item->type() == Item::FIELD_ITEM)
{
args[0]= item;
for (int i= 1 ; i <= 2; i++)
{
- item= func_item->arguments()[i];
+ item= func_item->arguments()[i]->real_item();
if (!item->const_item())
return 0;
args[i]= item;