summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-03-07 21:57:17 +0100
committerSergei Golubchik <sergii@pisem.net>2011-03-07 21:57:17 +0100
commit30e5b4d7196eb56ef3032f016823ecaae2207680 (patch)
tree34869702a2436da52d3bb42ec26b9e7a284525dd /sql/item_timefunc.cc
parent19a3c29d64e050a4ab99621856455361ffe56eb0 (diff)
downloadmariadb-git-30e5b4d7196eb56ef3032f016823ecaae2207680.tar.gz
lp:730637 - Valgrind warnings in 5.1-micro
sql/field.cc: initialize ltime completely sql/filesort.cc: don't pack MYSQL_TIME if it's not initialized (safe here, but valgrind complains) sql/item_cmpfunc.cc: don't pack MYSQL_TIME if it's not initialized (safe here, but valgrind complains) sql/item_timefunc.cc: don't check MYSQL_TIME members if it's uninitialized (safe here, but valgrind complains) sql/time.cc: use c_ptr_safe() instead of c_ptr() (make valgrind happy)
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index feae39e1509..7ec41299ed7 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2293,7 +2293,8 @@ void Item_char_typecast::fix_length_and_dec()
bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
- bool res= get_arg0_time(ltime);
+ if (get_arg0_time(ltime))
+ return 1;
/*
MYSQL_TIMESTAMP_TIME value can have non-zero day part,
which we should not lose.
@@ -2301,16 +2302,17 @@ bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
if (ltime->time_type != MYSQL_TIMESTAMP_TIME)
ltime->year= ltime->month= ltime->day= 0;
ltime->time_type= MYSQL_TIMESTAMP_TIME;
- return res;
+ return 0;
}
bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
- bool res= get_arg0_date(ltime, TIME_FUZZY_DATE);
+ if (get_arg0_date(ltime, TIME_FUZZY_DATE))
+ return 1;
ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0;
ltime->time_type= MYSQL_TIMESTAMP_DATE;
- return res;
+ return 0;
}
bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)