summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-04-12 13:23:11 -0700
committerunknown <igor@rurik.mysql.com>2006-04-12 13:23:11 -0700
commita00a3bb9eb719ad45cca33c7c14e317f2a432788 (patch)
tree0e931bec089509ebd89a8eb00a6cb2c028f8050f /sql/item_cmpfunc.cc
parentc1491e7694884372d3c1a08bdadab0ad2b40135a (diff)
parentb54cb499a7e737743dfba4c27e3885e48e53d19a (diff)
downloadmariadb-git-a00a3bb9eb719ad45cca33c7c14e317f2a432788.tar.gz
Merge rurik.mysql.com:/home/igor/dev/mysql-5.0-0
into rurik.mysql.com:/home/igor/dev/mysql-5.1-0 mysql-test/r/func_time.result: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/sql_insert.cc: Auto merged mysql-test/r/innodb.result: Manual merge mysql-test/t/innodb.test: Manual merge
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 493c3dbc60e..acee912c912 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -52,7 +52,6 @@ static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems)
{
uint i;
Field *field= NULL;
- bool all_constant= TRUE;
/* If the first argument is a FIELD_ITEM, pull out the field. */
if (items[0]->real_item()->type() == Item::FIELD_ITEM)
@@ -65,16 +64,9 @@ static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems)
for (i= 1; i < nitems; i++)
{
type[0]= item_cmp_type(type[0], items[i]->result_type());
- if (field && !convert_constant_item(thd, field, &items[i]))
- all_constant= FALSE;
+ if (field && convert_constant_item(thd, field, &items[i]))
+ type[0]= INT_RESULT;
}
-
- /*
- If we had a field that can be compared as a longlong, and all constant
- items, then the aggregate result will be an INT_RESULT.
- */
- if (field && all_constant)
- type[0]= INT_RESULT;
}