summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2011-03-28 17:24:25 +0400
committerSergey Glukhov <sergey.glukhov@oracle.com>2011-03-28 17:24:25 +0400
commitd6125b27b38432d1a465397c0c5a9e62bb1c65d3 (patch)
tree82c83e03cac4cf1059a361f9a2efd46cf30ce0a0 /sql/item_timefunc.cc
parent4ed8cb4a76275a28231a842c9112834d384b7b4c (diff)
downloadmariadb-git-d6125b27b38432d1a465397c0c5a9e62bb1c65d3.tar.gz
Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION
Valgrind warning happens due to uninitialized cached_format_type field which is used later in Item_func_str_to_date::val_str method. The fix is to init cached_format_type field. mysql-test/r/func_time.result: test case mysql-test/t/func_time.test: test case sql/item_timefunc.cc: init cached_format_type field
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 71b2baf4fee..ecf790cc061 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -3293,6 +3293,7 @@ void Item_func_str_to_date::fix_length_and_dec()
{
maybe_null= 1;
decimals=0;
+ cached_format_type= DATE_TIME;
cached_field_type= MYSQL_TYPE_DATETIME;
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;