summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <lzhou/root@dev3-138.dev.cn.tlan>2006-11-02 13:16:38 +0000
committerunknown <lzhou/root@dev3-138.dev.cn.tlan>2006-11-02 13:16:38 +0000
commit5df6fc3378a979a5a0fa81d3fe6fb68bab3dbb5e (patch)
treee0785c51a4a337f3e6d8a5e9dba0ec55256dbdd1 /ndb
parente70e103fef8a09f49baa882936de5668f2959cd7 (diff)
parent98575bb401270c3100d0e7a3c5826209d4f97323 (diff)
downloadmariadb-git-5df6fc3378a979a5a0fa81d3fe6fb68bab3dbb5e.tar.gz
Merge lzhou@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb-bj
into dev3-138.dev.cn.tlan:/home/zhl/mysql/mysql-4.1/bug19352
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index 9b52ac65331..d5ba3ac63c1 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 = 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);
}