List:Commits« Previous MessageNext Message »
From:jhe Date:August 28 2006 9:05am
Subject:bk commit into 5.0 tree (Justin.He:1.2253) BUG#19203
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of justin.he. When justin.he 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-08-28 17:04:50+08:00, Justin.He@stripped +1 -0
  BUG #19203, Different error reports for similar cases - unable to allocate memory

  ndb/src/kernel/vm/SimulatedBlock.cpp@stripped, 2006-08-28 17:04:45+08:00, Justin.He@stripped +3 -2
    becuase size_t is unsigned 32bit when platform is 32bit, so when we allocate memory>=4GB,
    the variable 'size' will overflow, and the error information are different when configuration 
    parameter's value is changed.
    
    So we need judge whether the size will overflow. Actually, there are already range judgement of the 
    configuration parameters in src/mgmsrv/ConfigInfo.cpp, such as 'DataMemory',
    'MaxNoOfConcurrentOperations' and etc. But the range limitation sometimes is loose, and just
    a theoretic value.
    
    To avoid changing the memory allocation interfaces such as ndbd_malloc seem liked functions, i only add 
    a new 64bit 'real_size' variable and do some judgement, then modification is little.

# 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:	Justin.He
# Host:	qa3-104.qa.cn.tlan
# Root:	/mnt/sda7/justin.he/mysql/bug19203-mysql-5.0-ndb-bj

--- 1.25/ndb/src/kernel/vm/SimulatedBlock.cpp	2006-08-28 17:05:04 +08:00
+++ 1.26/ndb/src/kernel/vm/SimulatedBlock.cpp	2006-08-28 17:05:04 +08:00
@@ -658,8 +658,9 @@
 
   void * p = NULL;
   size_t size = n*s;
+  Uint64 real_size =((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", 
 	     getBlockName(number()), 
@@ -669,7 +670,7 @@
 	     size);
 #endif
     p = ndbd_malloc(size);
-    if (p == NULL){
+    if (p == NULL || size != real_size){
       char buf1[255];
       char buf2[255];
       BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s", 
Thread
bk commit into 5.0 tree (Justin.He:1.2253) BUG#19203jhe28 Aug