summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.mysql.com>2007-02-06 14:48:22 +0100
committerunknown <msvensson@pilot.mysql.com>2007-02-06 14:48:22 +0100
commitdcafc4c480a406c907e77114a597fe6dd6e50000 (patch)
tree11ccd2413b305f3797da63237ce98b416af8dd84 /sql/item_timefunc.cc
parent14e7f52fb2c9a32de13caeb8f5f81504e2c6ebd7 (diff)
parent56820e1cdc0185617386bd06f0e54714ecf004d8 (diff)
downloadmariadb-git-dcafc4c480a406c907e77114a597fe6dd6e50000.tar.gz
Merge 192.168.0.10:mysql/mysql-5.0-maint
into pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint mysql-test/mysql-test-run.pl: 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, 6 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 05498018386..737064a9713 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1054,7 +1054,8 @@ longlong Item_func_quarter::val_int()
{
DBUG_ASSERT(fixed == 1);
TIME ltime;
- (void) get_arg0_date(&ltime, TIME_FUZZY_DATE);
+ if (get_arg0_date(&ltime, TIME_FUZZY_DATE))
+ return 0;
return (longlong) ((ltime.month+2)/3);
}
@@ -1668,6 +1669,7 @@ String *Item_func_sec_to_time::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
TIME ltime;
+ longlong arg_val= args[0]->val_int();
if ((null_value=args[0]->null_value) || str->alloc(19))
{
@@ -1675,7 +1677,7 @@ String *Item_func_sec_to_time::val_str(String *str)
return (String*) 0;
}
- sec_to_time(args[0]->val_int(), args[0]->unsigned_flag, &ltime);
+ sec_to_time(arg_val, args[0]->unsigned_flag, &ltime);
make_time((DATE_TIME_FORMAT *) 0, &ltime, str);
return str;
@@ -1686,11 +1688,12 @@ longlong Item_func_sec_to_time::val_int()
{
DBUG_ASSERT(fixed == 1);
TIME ltime;
+ longlong arg_val= args[0]->val_int();
if ((null_value=args[0]->null_value))
return 0;
- sec_to_time(args[0]->val_int(), args[0]->unsigned_flag, &ltime);
+ sec_to_time(arg_val, args[0]->unsigned_flag, &ltime);
return (ltime.neg ? -1 : 1) *
((ltime.hour)*10000 + ltime.minute*100 + ltime.second);