summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-03-23 21:10:23 +0400
committerunknown <hf@deer.(none)>2004-03-23 21:10:23 +0400
commit9079dc1a662f470688802294571c685f8532c39a (patch)
tree82f5452104b98b0806bd9f1f63f6042f14fd6717 /sql/item_timefunc.cc
parent78b4ba746b79ea7d89044e3eecd56338a8f4eb6f (diff)
downloadmariadb-git-9079dc1a662f470688802294571c685f8532c39a.tar.gz
Fix for #3264 (FROM_DAYS doesn't work properly in range comparison)
Item_func_from_days::get_date didn't change 'hr', 'min' and some other fields of incoming ltime, so they got random values. bzeroing of the ltime added mysql-test/r/func_time.result: appropriate test result mysql-test/t/func_time.test: test case sql/item_timefunc.cc: cleaning ltime added
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 1ac04cd9ff0..a578abc345a 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1114,6 +1114,7 @@ bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date)
longlong value=args[0]->val_int();
if ((null_value=args[0]->null_value))
return 1;
+ bzero(ltime, sizeof(TIME));
get_date_from_daynr((long) value, &ltime->year, &ltime->month, &ltime->day);
ltime->time_type= TIMESTAMP_DATE;
return 0;