summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-03-21 09:29:03 +0100
committerunknown <tomas@whalegate.ndb.mysql.com>2007-03-21 09:29:03 +0100
commit5d7f62824fe37b5ff8338ccb5c740bc5822852cb (patch)
tree6d0d181fe502986f03aeb7e52235f44e4c2a308d /storage
parentfa30eca697cf36e9cf07206acdca429e14e10157 (diff)
parenta7970e2408a74829c7bb8cd8b260f337d243d3e5 (diff)
downloadmariadb-git-5d7f62824fe37b5ff8338ccb5c740bc5822852cb.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-telco-gca
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco-gca
Diffstat (limited to 'storage')
-rw-r--r--storage/ndb/src/common/debugger/EventLogger.cpp4
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp10
2 files changed, 8 insertions, 6 deletions
diff --git a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp
index f6665faa187..6e446646898 100644
--- a/storage/ndb/src/common/debugger/EventLogger.cpp
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp
@@ -652,9 +652,9 @@ void getTextEventBufferStatus(QQQQ) {
"Event buffer status: used=%d%s(%d%) alloc=%d%s(%d%) "
"max=%d%s apply_gci=%lld latest_gci=%lld",
used, used_unit,
- theData[2] ? (theData[1]*100)/theData[2] : 0,
+ theData[2] ? (Uint32)((((Uint64)theData[1])*100)/theData[2]) : 0,
alloc, alloc_unit,
- theData[3] ? (theData[2]*100)/theData[3] : 0,
+ theData[3] ? (Uint32)((((Uint64)theData[2])*100)/theData[3]) : 0,
max_, max_unit,
theData[4]+(((Uint64)theData[5])<<32),
theData[6]+(((Uint64)theData[7])<<32));
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index 828ba51bc21..3449f3ff1d2 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -2100,15 +2100,17 @@ NdbEventBuffer::alloc_mem(EventBufData* data,
NdbMem_Free((char*)data->memory);
assert(m_total_alloc >= data->sz);
- m_total_alloc -= data->sz;
data->memory = 0;
data->sz = 0;
data->memory = (Uint32*)NdbMem_Allocate(alloc_size);
if (data->memory == 0)
+ {
+ m_total_alloc -= data->sz;
DBUG_RETURN(-1);
+ }
data->sz = alloc_size;
- m_total_alloc += data->sz;
+ m_total_alloc += add_sz;
if (change_sz != NULL)
*change_sz += add_sz;
@@ -2780,7 +2782,7 @@ NdbEventBuffer::reportStatus()
else
apply_gci= latest_gci;
- if (100*m_free_data_sz < m_min_free_thresh*m_total_alloc &&
+ if (100*(Uint64)m_free_data_sz < m_min_free_thresh*(Uint64)m_total_alloc &&
m_total_alloc > 1024*1024)
{
/* report less free buffer than m_free_thresh,
@@ -2791,7 +2793,7 @@ NdbEventBuffer::reportStatus()
goto send_report;
}
- if (100*m_free_data_sz > m_max_free_thresh*m_total_alloc &&
+ if (100*(Uint64)m_free_data_sz > m_max_free_thresh*(Uint64)m_total_alloc &&
m_total_alloc > 1024*1024)
{
/* report more free than 2 * m_free_thresh