summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-10-13 12:13:09 +0200
committerunknown <jonas@perch.ndb.mysql.com>2006-10-13 12:13:09 +0200
commit1b7ac273970413ece2db846bb2403a5cc66cc11c (patch)
tree144c5fe939322579b62117c9890f2dea0953d092
parent38910a8637f184ad0b3d0e11636abda9896e30e4 (diff)
parenta4a651e10b8c1df2a2533e291708081ac8e5d2ca (diff)
downloadmariadb-git-1b7ac273970413ece2db846bb2403a5cc66cc11c.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into perch.ndb.mysql.com:/home/jonas/src/51-work storage/ndb/src/common/debugger/EventLogger.cpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: merge
-rw-r--r--storage/ndb/src/common/debugger/EventLogger.cpp4
-rw-r--r--storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp1
-rw-r--r--storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp3
4 files changed, 6 insertions, 4 deletions
diff --git a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp
index db9b8417c0d..f1c6084754f 100644
--- a/storage/ndb/src/common/debugger/EventLogger.cpp
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp
@@ -683,8 +683,8 @@ void getTextMemoryUsage(QQQQ) {
const int used = theData[3];
const int total = theData[4];
const int block = theData[5];
- const int percent = (used*100)/total;
-
+ const int percent = total ? (used*100)/total : 0;
+
BaseString::snprintf(m_text, m_text_len,
"%s usage %s %d%s(%d %dK pages of total %d)",
(block==DBACC ? "Index" : (block == DBTUP ?"Data":"<unknown>")),
diff --git a/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
index 27355299a9c..cc8d0f38c4f 100644
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
@@ -42,6 +42,7 @@ void Dbacc::initData()
scanRec = 0;
tabrec = 0;
+ cnoOfAllocatedPages = cpagesize = 0;
// Records with constant sizes
}//Dbacc::initData()
diff --git a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
index 30a36495579..d5578a5c0c0 100644
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
@@ -113,7 +113,7 @@ void Dbacc::execCONTINUEB(Signal* signal)
case ZREPORT_MEMORY_USAGE:{
jam();
static int c_currentMemUsed = 0;
- int now = (cnoOfAllocatedPages * 100)/cpagesize;
+ int now = cpagesize ? (cnoOfAllocatedPages * 100)/cpagesize : 0;
const int thresholds[] = { 99, 90, 80, 0};
Uint32 i = 0;
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index c59cf4015af..f8fc6236051 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -169,7 +169,8 @@ void Dbtup::execCONTINUEB(Signal* signal)
case ZREPORT_MEMORY_USAGE:{
ljam();
static int c_currentMemUsed = 0;
- int now = (cnoOfAllocatedPages * 100)/c_page_pool.getSize();
+ Uint32 sz = c_page_pool.getSize();
+ int now = sz ? (cnoOfAllocatedPages * 100)/sz : 0;
const int thresholds[] = { 100, 90, 80, 0 };
Uint32 i = 0;