diff options
author | unknown <mhansson@dl145s.mysql.com> | 2007-05-30 10:31:41 +0200 |
---|---|---|
committer | unknown <mhansson@dl145s.mysql.com> | 2007-05-30 10:31:41 +0200 |
commit | d9426a89e45f7211a6b6529c09739972fe0b7914 (patch) | |
tree | 5f72041775c8c88607f9b0964a24f36fd0e7b6e7 | |
parent | 54c88bca0ac840dcd5b20f6ee19ba02927420c23 (diff) | |
parent | 7782446197aedeb9b50efcef830d6991e0948072 (diff) | |
download | mariadb-git-d9426a89e45f7211a6b6529c09739972fe0b7914.tar.gz |
Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into dl145s.mysql.com:/users/mhansson/mysql/autopush/my51-bug28250
sql/item_func.cc:
Auto merged
-rw-r--r-- | mysql-test/t/cast.test | 8 | ||||
-rw-r--r-- | sql/item_func.cc | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 7217d00a1bb..ab2859a5346 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -10,7 +10,13 @@ select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1; select ~5, cast(~5 as signed); explain extended select ~5, cast(~5 as signed); select cast(5 as unsigned) -6.0; -select cast(NULL as signed), cast(1/0 as signed); +select cast(NULL as signed), cast(1/0 as signed); +# +# Bug #28250: Run-Time Check Failure #3 - The variable 'value' is being used +# without being def +# +# The following line causes Run-Time Check Failure on +# binaries built with Visual C++ 2005 select cast(NULL as unsigned), cast(1/0 as unsigned); select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A"; select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME); diff --git a/sql/item_func.cc b/sql/item_func.cc index 906a87730be..7749e61aeb7 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -994,6 +994,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 || |