summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-05-17 11:46:21 -0700
committerunknown <igor@rurik.mysql.com>2006-05-17 11:46:21 -0700
commit8df5fdb9334ff4c908471d5a6bd76dee57e3e9db (patch)
treee05c70627d1455e3fc35f9a5b7cf20f2ac40aabe /sql/item_timefunc.cc
parent2d0297f093a7995b4d0224f090440ce7810d62af (diff)
parente7f87bd0b7d1519abf7aa84b9ac09062d77893e4 (diff)
downloadmariadb-git-8df5fdb9334ff4c908471d5a6bd76dee57e3e9db.tar.gz
Merge rurik.mysql.com:/home/igor/tmp_merge
into rurik.mysql.com:/home/igor/dev/mysql-5.1-0 mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged sql/item_timefunc.cc: Auto merged
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 1f8b5e7cd50..9d98e446c84 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2024,8 +2024,13 @@ bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const
Item_date_add_interval *other= (Item_date_add_interval*) item;
if ((int_type != other->int_type) ||
- (!args[0]->eq(other->args[0], binary_cmp)) ||
- (get_interval_value(args[1], int_type, &val, &interval)))
+ (!args[0]->eq(other->args[0], binary_cmp)))
+ return FALSE;
+
+ if (!args[1]->const_item() || !other->args[1]->const_item())
+ return (args[1]->eq(other->args[1], binary_cmp));
+
+ if (get_interval_value(args[1], int_type, &val, &interval))
return FALSE;
val= other->value;