Loading mysql-test/t/cast.test +7 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,12 @@ 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); # # 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); Loading sql/item_func.cc +2 −0 Original line number Diff line number Diff line Loading @@ -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 || Loading Loading
mysql-test/t/cast.test +7 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,12 @@ 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); # # 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); Loading
sql/item_func.cc +2 −0 Original line number Diff line number Diff line Loading @@ -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 || Loading