diff options
author | unknown <lzhou/root@dev3-138.dev.cn.tlan> | 2006-11-02 12:38:45 +0000 |
---|---|---|
committer | unknown <lzhou/root@dev3-138.dev.cn.tlan> | 2006-11-02 12:38:45 +0000 |
commit | a446b5fec96fcd73ee78bb9df47e73a735075112 (patch) | |
tree | f2dd06fc8b3360a6058c6067ee475b47f25715a1 | |
parent | b389038132c60c5852cba29cba7342ce149505f6 (diff) | |
parent | 540a69c34593ba8681b36ea51264eeedf762dfb1 (diff) | |
download | mariadb-git-a446b5fec96fcd73ee78bb9df47e73a735075112.tar.gz |
Merge lzhou@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb-bj
into dev3-138.dev.cn.tlan:/home/zhl/mysql/mysql-5.0/bug19352
-rw-r--r-- | ndb/src/kernel/vm/SimulatedBlock.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index b4787209d55..d8457b5b7ca 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -658,24 +658,26 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear) 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 = ndbd_malloc(size); + if( real_size == (Uint64)size ) + p = ndbd_malloc(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, NDBD_EXIT_MEMALLOC, buf1, buf2); } |