summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2003-07-14 12:39:10 +0500
committerunknown <ram@mysql.r18.ru>2003-07-14 12:39:10 +0500
commite45b9ab481b26a8da6aa508437325ef7f00fb55f (patch)
tree7b4ca46b2239ae1d29fa8251960e3414e7a6f1d1 /sql/item_cmpfunc.cc
parentc4381bb0c61a3e51320830d7f00c8bb67c889fae (diff)
downloadmariadb-git-e45b9ab481b26a8da6aa508437325ef7f00fb55f.tar.gz
backport fix for the bug #803: INTERVAL(NULL, ....)
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 731f9b61438..8c58c58a67d 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -311,7 +311,7 @@ void Item_func_interval::split_sum_func(List<Item> &fields)
}
/*
- return NULL if null value,
+ return -1 if null value,
0 if lower than lowest
1 - arg_count if between args[n] and args[n+1]
arg_count+1 if higher than biggest argument
@@ -321,10 +321,7 @@ longlong Item_func_interval::val_int()
{
double value= item->val();
if (item->null_value)
- {
- null_value= 1;
- return -1;
- }
+ return -1; // -1 if NULL
if (intervals)
{ // Use binary search to find interval
uint start= 0, end= arg_count - 1;