List:Commits« Previous MessageNext Message »
From:mhansson Date:May 23 2007 2:43pm
Subject:bk commit into 5.0 tree (mhansson:1.2490) BUG#28250
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of mhansson. When mhansson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-23 14:43:06+02:00, mhansson@stripped +2 -0
  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

  mysql-test/t/cast.test@stripped, 2007-05-23 14:43:02+02:00, mhansson@stripped +7 -1
    bug#28250: There is no need for an extra test case, but we
    recognize that this one catches the bug.

  sql/item_func.cc@stripped, 2007-05-23 14:43:04+02:00, mhansson@stripped +2 -0
    bug#28250: initialization of value.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	mhansson
# Host:	dl145s.mysql.com
# Root:	/users/mhansson/mysql/push/bug28250/my50-bug28250

--- 1.341/sql/item_func.cc	2007-05-11 17:56:20 +02:00
+++ 1.342/sql/item_func.cc	2007-05-23 14:43:04 +02:00
@@ -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 ||

--- 1.35/mysql-test/t/cast.test	2007-05-04 10:25:46 +02:00
+++ 1.36/mysql-test/t/cast.test	2007-05-23 14:43:02 +02:00
@@ -10,7 +10,13 @@ select cast(-5 as unsigned) -1, cast(-5 
 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);
Thread
bk commit into 5.0 tree (mhansson:1.2490) BUG#28250mhansson23 May