diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-03-07 21:57:17 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-03-07 21:57:17 +0100 |
commit | 30e5b4d7196eb56ef3032f016823ecaae2207680 (patch) | |
tree | 34869702a2436da52d3bb42ec26b9e7a284525dd /sql/time.cc | |
parent | 19a3c29d64e050a4ab99621856455361ffe56eb0 (diff) | |
download | mariadb-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/time.cc')
-rw-r--r-- | sql/time.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/time.cc b/sql/time.cc index 7d23a795413..2badb77d14b 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -726,17 +726,17 @@ void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level leve if (field_name) cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff), ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), - type_str, str.c_ptr(), field_name, + type_str, str.c_ptr_safe(), field_name, (ulong) thd->row_count); else { if (time_type > MYSQL_TIMESTAMP_ERROR) cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff), ER(ER_TRUNCATED_WRONG_VALUE), - type_str, str.c_ptr()); + type_str, str.c_ptr_safe()); else cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff), - ER(ER_WRONG_VALUE), type_str, str.c_ptr()); + ER(ER_WRONG_VALUE), type_str, str.c_ptr_safe()); } push_warning(thd, level, ER_TRUNCATED_WRONG_VALUE, warn_buff); |