diff options
author | mhansson@dl145s.mysql.com <> | 2007-05-23 14:43:06 +0200 |
---|---|---|
committer | mhansson@dl145s.mysql.com <> | 2007-05-23 14:43:06 +0200 |
commit | 85111f0a953aaecdd4dc70e7a4a77cd91d0e89fd (patch) | |
tree | f8be640e16878e279b3ede71f412312052092b35 /sql/item_func.cc | |
parent | bb089cea3852546e37d6a241b35f9223759b88c1 (diff) | |
download | mariadb-git-85111f0a953aaecdd4dc70e7a4a77cd91d0e89fd.tar.gz |
Bug #28250: Run-Time Check Failure #3 - The variable 'value' is
being used without being def
Inside method Item_func_unsigned::val_int, the variable value
can be returned without being initialized when the CAST argument
is of type DECIMAL and has a NULL value. This gives a run-time
error when building debug binaries using Visual C++ 2005.
Solution: Initialize value to 0
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index c0a9647e382..2a081add234 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -996,6 +996,8 @@ longlong Item_func_unsigned::val_int() my_decimal tmp, *dec= args[0]->val_decimal(&tmp); if (!(null_value= args[0]->null_value)) my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value); + else + value= 0; return value; } else if (args[0]->cast_to_int_type() != STRING_RESULT || |