summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2007-03-22 11:43:23 +0400
committerunknown <holyfoot/hf@hfmain.(none)>2007-03-22 11:43:23 +0400
commit941f2fb956a446d6f0e37581cd71ebdf889d5633 (patch)
tree357eb02100ecceb9c157fe76f223296b10cbe950 /sql/opt_range.cc
parentc242662096e1ce16b249c478702be54c190d3f5e (diff)
parentb70693f5825f0500cf7e519d7eac7759d4482a18 (diff)
downloadmariadb-git-941f2fb956a446d6f0e37581cd71ebdf889d5633.tar.gz
Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into mysql.com:/home/hf/work/mrg/mysql-5.1-opt mysql-test/r/subselect3.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/t/union.test: Auto merged sql/item.h: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/subselect.result: merging mysql-test/t/subselect.test: merging sql/sql_base.cc: mergin sql/sql_class.h: merging sql/sql_select.cc: merging
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 52faaf25b42..03d97a294ad 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -8985,7 +8985,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
else
DBUG_RETURN(NULL);
- Item *expr= min_max_item->args[0]; /* The argument of MIN/MAX. */
+ /* The argument of MIN/MAX. */
+ Item *expr= min_max_item->args[0]->real_item();
if (expr->type() == Item::FIELD_ITEM) /* Is it an attribute? */
{
if (! min_max_arg_item)
@@ -9356,6 +9357,7 @@ check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item,
DBUG_ENTER("check_group_min_max_predicates");
DBUG_ASSERT(cond && min_max_arg_item);
+ cond= cond->real_item();
Item::Type cond_type= cond->type();
if (cond_type == Item::COND_ITEM) /* 'AND' or 'OR' */
{
@@ -9393,7 +9395,7 @@ check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item,
DBUG_PRINT("info", ("Analyzing: %s", pred->func_name()));
for (uint arg_idx= 0; arg_idx < pred->argument_count (); arg_idx++)
{
- cur_arg= arguments[arg_idx];
+ cur_arg= arguments[arg_idx]->real_item();
DBUG_PRINT("info", ("cur_arg: %s", cur_arg->full_name()));
if (cur_arg->type() == Item::FIELD_ITEM)
{