summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorigor@olga.mysql.com <>2007-04-03 16:11:27 -0700
committerigor@olga.mysql.com <>2007-04-03 16:11:27 -0700
commit6aa599fc3197fa72c7f5161e4a7691c08e40b44f (patch)
tree7d86af270592c9cb832537de4dc43a63ecbb4474 /sql/item_cmpfunc.cc
parent54bc9c3d779e659f101f317d1925b7fd95064064 (diff)
parent90aa05d276b85367c297cc9f7580529aa782d205 (diff)
downloadmariadb-git-6aa599fc3197fa72c7f5161e4a7691c08e40b44f.tar.gz
Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into olga.mysql.com:/home/igor/mysql-5.0-opt
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 8943b9d3586..ac1adc235c3 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1079,6 +1079,26 @@ longlong Item_func_strcmp::val_int()
}
+bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const
+{
+ /* Assume we don't have rtti */
+ if (this == item)
+ return 1;
+ if (item->type() != FUNC_ITEM)
+ return 0;
+ Item_func *item_func=(Item_func*) item;
+ if (arg_count != item_func->arg_count ||
+ functype() != item_func->functype())
+ return 0;
+ if (negated != ((Item_func_opt_neg *) item_func)->negated)
+ return 0;
+ for (uint i=0; i < arg_count ; i++)
+ if (!args[i]->eq(item_func->arguments()[i], binary_cmp))
+ return 0;
+ return 1;
+}
+
+
void Item_func_interval::fix_length_and_dec()
{
use_decimal_comparison= (row->element_index(0)->result_type() == DECIMAL_RESULT) ||