MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:lzhou Date:November 1 2006 6:23pm
Subject:bk commit into 4.1 tree (lzhou:1.2537) BUG#19352
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of root. When root 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, 2006-11-01 18:23:30+00:00, lzhou@stripped +1 -0
  BUG#19352 return exact error message when parameters overflow in 32-bit platform.

  ndb/src/kernel/vm/SimulatedBlock.cpp@stripped, 2006-11-01 18:23:28+00:00, lzhou@stripped +8 -6
    Return exact error message when parameters overflow in 32-bit platform.

# 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:	lzhou
# Host:	dev3-138.dev.cn.tlan
# Root:	/home/zhl/mysql/mysql-4.1/bug19352

--- 1.17/ndb/src/kernel/vm/SimulatedBlock.cpp	2006-11-01 18:23:34 +00:00
+++ 1.18/ndb/src/kernel/vm/SimulatedBlock.cpp	2006-11-01 18:23:34 +00:00
@@ -658,24 +658,26 @@
 
   void * p = NULL;
   size_t size = n*s;
+  Uint64 real_size = (Uint64)((Uint64)n)*((Uint64)s);
   refresh_watch_dog(); 
-  if (size > 0){
+  if (real_size > 0){
 #ifdef VM_TRACE_MEM
-    ndbout_c("%s::allocRecord(%s, %u, %u) = %u bytes", 
+    ndbout_c("%s::allocRecord(%s, %u, %u) = %llu bytes", 
 	     getBlockName(number()), 
 	     type,
 	     s,
 	     n,
-	     size);
+	     real_size);
 #endif
-    p = NdbMem_Allocate(size);
+    if( real_size == (Uint64)size )
+      p = NdbMem_Allocate(size);
     if (p == NULL){
       char buf1[255];
       char buf2[255];
       BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s", 
 	       getBlockName(number()), type);
-      BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes", 
-	       (Uint32)s, (Uint32)n, (Uint32)size);
+      BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %llu bytes", 
+	       (Uint32)s, (Uint32)n, (Uint64)real_size);
       ERROR_SET(fatal, ERR_MEMALLOC, buf1, buf2);
     }
 
Thread
bk commit into 4.1 tree (lzhou:1.2537) BUG#19352lzhou1 Nov