summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <tulin@dl145b.mysql.com>2005-09-05 09:13:28 +0200
committerunknown <tulin@dl145b.mysql.com>2005-09-05 09:13:28 +0200
commit0ef858082027a636910f27492ff6b2481862ddd6 (patch)
treeda55ba5cef1783c1f7d6619ce9be03534a87fb96 /ndb
parentfd3164e30e3eea8bf8525ef42ab6a3fe2bbf9029 (diff)
downloadmariadb-git-0ef858082027a636910f27492ff6b2481862ddd6.tar.gz
fixed small bug in ndb redolog printer
+ added option to dumpe rest of page after exnd of data ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp: fixed small bug in ndb redolog printer ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp: fixed small bug in ndb redolog printer
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp4
-rw-r--r--ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp2
-rw-r--r--ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp25
3 files changed, 23 insertions, 8 deletions
diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp
index ba6d65ca838..b7e2ab072b5 100644
--- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp
+++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp
@@ -134,7 +134,9 @@ bool PrepareOperationRecord::check() {
return true;
}
-Uint32 PrepareOperationRecord::getLogRecordSize() {
+Uint32 PrepareOperationRecord::getLogRecordSize(Uint32 wordsRead) {
+ if (wordsRead < 2)
+ return 2; // make sure we read more
return m_logRecordSize;
}
diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp
index 11b8dc4a6fa..b2da7427f4e 100644
--- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp
+++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp
@@ -83,7 +83,7 @@ class PrepareOperationRecord {
friend NdbOut& operator<<(NdbOut&, const PrepareOperationRecord&);
public:
bool check();
- Uint32 getLogRecordSize();
+ Uint32 getLogRecordSize(Uint32 wordsRead);
protected:
Uint32 m_recordType;
diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
index aa8b1d25e4e..751d27db74e 100644
--- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
+++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
@@ -41,6 +41,7 @@ void doExit();
FILE * f= 0;
char fileName[256];
+bool theDumpFlag = false;
bool thePrintFlag = true;
bool theCheckFlag = true;
bool onlyPageHeaders = false;
@@ -208,7 +209,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
case ZPREP_OP_TYPE:
poRecord = (PrepareOperationRecord *) redoLogPagePos;
- wordIndex += poRecord->getLogRecordSize();
+ wordIndex += poRecord->getLogRecordSize(PAGESIZE-wordIndex);
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*poRecord);
if (theCheckFlag) {
@@ -277,10 +278,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
ndbout << " ------ERROR: UNKNOWN RECORD TYPE------" << endl;
// Print out remaining data in this page
- for (int j = wordIndex; j < PAGESIZE; j++){
- Uint32 unknown = redoLogPage[i*PAGESIZE + j];
-
- ndbout_c("%-30d%-12u%-12x", j, unknown, unknown);
+ for (int k = wordIndex; k < PAGESIZE; k++){
+ Uint32 unknown = redoLogPage[i*PAGESIZE + k];
+ ndbout_c("%-30d%-12u%-12x", k, unknown, unknown);
}
doExit();
@@ -289,8 +289,19 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
if (lastPage)
+ {
+ if (theDumpFlag)
+ {
+ ndbout << " ------PAGE END: DUMPING REST OF PAGE------" << endl;
+ for (int k = wordIndex > PAGESIZE ? oldWordIndex : wordIndex;
+ k < PAGESIZE; k++)
+ {
+ Uint32 word = redoLogPage[i*PAGESIZE + k];
+ ndbout_c("%-30d%-12u%-12x", k, word, word);
+ }
+ }
break;
-
+ }
if (wordIndex > PAGESIZE) {
words_from_previous_page = PAGESIZE - oldWordIndex;
ndbout << " ----------- Record continues on next page -----------" << endl;
@@ -353,6 +364,8 @@ void readArguments(int argc, const char** argv)
{
if (strcmp(argv[i], "-noprint") == 0) {
thePrintFlag = false;
+ } else if (strcmp(argv[i], "-dump") == 0) {
+ theDumpFlag = true;
} else if (strcmp(argv[i], "-nocheck") == 0) {
theCheckFlag = false;
} else if (strcmp(argv[i], "-mbyteheaders") == 0) {