List:Commits« Previous MessageNext Message »
From:ramil Date:June 20 2007 9:40am
Subject:bk commit into 4.1 tree (ramil:1.2667) BUG#29079
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of ram. When ram 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-06-20 12:40:35+05:00, ramil@stripped +1 -0
  Fix for bug #29079: Semantics of "bigint" depend on platform specifics (size, signedness
of char ?)
  
  Problem: comparing a big ulonglong variable with a longlong constant may depend on
compiler used
  and lead to unexpected results.
  Fix: use explicit type cast.

  sql/item.cc@stripped, 2007-06-20 12:40:34+05:00, ramil@stripped +6 -3
    Fix for bug #29079: Semantics of "bigint" depend on platform specifics (size,
signedness of char ?)
      - use explicit (ulonglong) cast when comparing a longlong constant with an ulonglong
variable.

# 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:	ramil
# Host:	ramil.myoffice.izhnet.ru
# Root:	/home/ram/work/b29079/b29079.4.1

--- 1.238/sql/item.cc	2007-06-20 12:40:37 +05:00
+++ 1.239/sql/item.cc	2007-06-20 12:40:37 +05:00
@@ -2390,13 +2390,16 @@ int Item_varbinary::save_in_field(Field 
   uint32 length= str_value.length();
   if (length > 8)
   {
-    nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX;
+    nr= field->flags & UNSIGNED_FLAG ? 
+          ULONGLONG_MAX : (ulonglong) LONGLONG_MAX;
     goto warn;
   }
   nr= (ulonglong) val_int();
-  if ((length == 8) && !(field->flags & UNSIGNED_FLAG) && (nr >
LONGLONG_MAX))
+  if ((length == 8) && 
+      !(field->flags & UNSIGNED_FLAG) && 
+      (nr > (ulonglong) LONGLONG_MAX))
   {
-    nr= LONGLONG_MAX;
+    nr= (ulonglong) LONGLONG_MAX;
     goto warn;
   }
   return field->store((longlong) nr);
Thread
bk commit into 4.1 tree (ramil:1.2667) BUG#29079ramil20 Jun
  • Re: bk commit into 4.1 tree (ramil:1.2667) BUG#29079Sergei Golubchik21 Jun