Commit 60abc6ee authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

The log parses

git-svn-id: file:///svn/tokudb@561 c7de825b-a66e-492c-adef-691d508d4ae1
parent a3f55afa
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
u_int32_t crc=0; u_int32_t crc=0;
u_int32_t actual_len=0; u_int32_t actual_len=0;
unsigned char get_char(void) { int get_char(void) {
int v = getchar(); int v = getchar();
assert(v!=EOF); if (v==EOF) return v;
unsigned char c = v; unsigned char c = v;
crc=crc32(crc, &c, 1); crc=crc32(crc, &c, 1);
actual_len++; actual_len++;
return c; return v;
} }
u_int32_t get_uint32 (void) { u_int32_t get_uint32 (void) {
...@@ -98,7 +98,7 @@ int main (int argc, char *argv[]) { ...@@ -98,7 +98,7 @@ int main (int argc, char *argv[]) {
count = atoi(argv[1]); count = atoi(argv[1]);
} }
for (i=0; for (i=0;
i!=count && (crc=0,cmd=get_char())!=EOF; i!=count && (crc=0,actual_len=0,cmd=get_char())!=EOF;
i++) { i++) {
switch (cmd) { switch (cmd) {
case LT_INSERT_WITH_NO_OVERWRITE: case LT_INSERT_WITH_NO_OVERWRITE:
...@@ -116,10 +116,14 @@ int main (int argc, char *argv[]) { ...@@ -116,10 +116,14 @@ int main (int argc, char *argv[]) {
case LT_DELETE: case LT_DELETE:
printf("DELETE:"); printf("DELETE:");
transcribe_lsn();
transcribe_txnid(); transcribe_txnid();
transcribe_fileid();
transcribe_diskoff(); transcribe_diskoff();
transcribe_key_or_data("key"); transcribe_key_or_data("key");
transcribe_key_or_data("data"); transcribe_key_or_data("data");
transcribe_crc32();
transcribe_len();
printf("\n"); printf("\n");
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment