Commit 2cccfcd8 authored by unknown's avatar unknown

Applying Sanja's patch which makes the log handler not issue

errors when reading a log record which has a 0-length header
(like LOGREC_REDO_DROP_TABLE).


storage/maria/ma_loghandler.c:
  Functions reading record's header now don't use 0 to indicate error,
  as some valid records have a 0-length header (like REDO_DROP_TABLE).
  Instead, negative values are used for EOF and error.
storage/maria/ma_loghandler.h:
  functions to read record's header now return an int
  (either the length of this header (>=0) or some negative values
  for EOF or error).
storage/maria/ma_recovery.c:
  update to the new log handler's behaviour. Note the @todo.
storage/maria/maria_read_log.c:
  inform when program failed
storage/maria/unittest/ma_test_loghandler-t.c:
  update to new log handler's API
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  update to new log handler's API
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  update to new log handler's API
parent 9554b40d
This diff is collapsed.
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#define TRANSLOG_FLAGS_NUM ((TRANSLOG_PAGE_CRC | TRANSLOG_SECTOR_PROTECTION | \ #define TRANSLOG_FLAGS_NUM ((TRANSLOG_PAGE_CRC | TRANSLOG_SECTOR_PROTECTION | \
TRANSLOG_RECORD_CRC) + 1) TRANSLOG_RECORD_CRC) + 1)
#define RECHEADER_READ_ERROR -1
#define RECHEADER_READ_EOF -2
/* /*
Page size in transaction log Page size in transaction log
It should be Power of 2 and multiple of DISK_DRIVE_SECTOR_SIZE It should be Power of 2 and multiple of DISK_DRIVE_SECTOR_SIZE
...@@ -228,9 +231,7 @@ translog_write_record(LSN *lsn, enum translog_record_type type, ...@@ -228,9 +231,7 @@ translog_write_record(LSN *lsn, enum translog_record_type type,
extern void translog_destroy(); extern void translog_destroy();
extern translog_size_t translog_read_record_header(LSN lsn, extern int translog_read_record_header(LSN lsn, TRANSLOG_HEADER_BUFFER *buff);
TRANSLOG_HEADER_BUFFER
*buff);
extern void translog_free_record_header(TRANSLOG_HEADER_BUFFER *buff); extern void translog_free_record_header(TRANSLOG_HEADER_BUFFER *buff);
...@@ -247,10 +248,8 @@ extern my_bool translog_init_scanner(LSN lsn, ...@@ -247,10 +248,8 @@ extern my_bool translog_init_scanner(LSN lsn,
my_bool fixed_horizon, my_bool fixed_horizon,
struct st_translog_scanner_data *scanner); struct st_translog_scanner_data *scanner);
extern translog_size_t translog_read_next_record_header(TRANSLOG_SCANNER_DATA extern int translog_read_next_record_header(TRANSLOG_SCANNER_DATA *scanner,
*scanner, TRANSLOG_HEADER_BUFFER *buff);
TRANSLOG_HEADER_BUFFER
*buff);
extern my_bool translog_lock(); extern my_bool translog_lock();
extern my_bool translog_unlock(); extern my_bool translog_unlock();
extern void translog_lock_assert_owner(); extern void translog_lock_assert_owner();
......
...@@ -194,13 +194,13 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file) ...@@ -194,13 +194,13 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file)
struct st_translog_scanner_data scanner; struct st_translog_scanner_data scanner;
uint i= 1; uint i= 1;
translog_size_t len= translog_read_record_header(lsn, &rec); int len= translog_read_record_header(lsn, &rec);
/** @todo translog_read_record_header() should be fixed for 0-byte headers */ /** @todo EOF should be detected */
if (len == 0) /* means error, but apparently EOF too */ if (len == RECHEADER_READ_ERROR)
{ {
fprintf(tracef, "empty log\n"); fprintf(tracef, "Cannot find a first record\n");
goto end; goto err;
} }
if (translog_init_scanner(lsn, 1, &scanner)) if (translog_init_scanner(lsn, 1, &scanner))
...@@ -246,7 +246,7 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file) ...@@ -246,7 +246,7 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file)
TRANSLOG_HEADER_BUFFER rec2; TRANSLOG_HEADER_BUFFER rec2;
len= len=
translog_read_record_header(all_active_trans[sid].group_start_lsn, &rec2); translog_read_record_header(all_active_trans[sid].group_start_lsn, &rec2);
if (len == (TRANSLOG_RECORD_HEADER_MAX_SIZE + 1)) if (len < 0) /* EOF or error */
{ {
fprintf(tracef, "Cannot find record where it should be\n"); fprintf(tracef, "Cannot find record where it should be\n");
goto err; goto err;
...@@ -267,7 +267,7 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file) ...@@ -267,7 +267,7 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file)
goto err; goto err;
} }
len= translog_read_next_record_header(&scanner2, &rec2); len= translog_read_next_record_header(&scanner2, &rec2);
if (len == (TRANSLOG_RECORD_HEADER_MAX_SIZE + 1)) if (len < 0) /* EOF or error */
{ {
fprintf(tracef, "Cannot find record where it should be\n"); fprintf(tracef, "Cannot find record where it should be\n");
goto err; goto err;
...@@ -294,9 +294,17 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file) ...@@ -294,9 +294,17 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file)
} }
} }
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == (TRANSLOG_RECORD_HEADER_MAX_SIZE + 1)) if (len < 0)
{ {
fprintf(tracef, "EOF on the log\n"); switch (len)
{
case RECHEADER_READ_EOF:
fprintf(tracef, "EOF on the log\n");
break;
case RECHEADER_READ_ERROR:
fprintf(stderr, "Error reading log\n");
goto err;
}
break; break;
} }
} }
......
...@@ -90,11 +90,12 @@ int main(int argc, char **argv) ...@@ -90,11 +90,12 @@ int main(int argc, char **argv)
fprintf(stdout, "TRACE of the last maria_read_log\n"); fprintf(stdout, "TRACE of the last maria_read_log\n");
if (maria_apply_log(lsn, opt_display_and_apply, stdout)) if (maria_apply_log(lsn, opt_display_and_apply, stdout))
goto err; goto err;
fprintf(stdout, "SUCCESS\n"); fprintf(stdout, "%s: SUCCESS\n", my_progname);
goto end; goto end;
err: err:
/* don't touch anything more, in case we hit a bug */ /* don't touch anything more, in case we hit a bug */
fprintf(stderr, "%s: FAILED\n", my_progname);
exit(1); exit(1);
end: end:
maria_end(); maria_end();
......
...@@ -360,8 +360,8 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -360,8 +360,8 @@ int main(int argc __attribute__((unused)), char *argv[])
rc= 1; rc= 1;
{ {
translog_size_t len= translog_read_record_header(first_lsn, &rec); int len= translog_read_record_header(first_lsn, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "translog_read_record_header failed (%d)\n", errno); fprintf(stderr, "translog_read_record_header failed (%d)\n", errno);
goto err; goto err;
...@@ -392,13 +392,13 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -392,13 +392,13 @@ int main(int argc __attribute__((unused)), char *argv[])
for (i= 1;; i++) for (i= 1;; i++)
{ {
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n", fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n",
i, errno); i, errno);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
if (i != ITERATIONS) if (i != ITERATIONS)
{ {
...@@ -471,13 +471,13 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -471,13 +471,13 @@ int main(int argc __attribute__((unused)), char *argv[])
translog_free_record_header(&rec); translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header (var) " fprintf(stderr, "1-%d translog_read_next_record_header (var) "
"failed (%d)\n", i, errno); "failed (%d)\n", i, errno);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
fprintf(stderr, "EOL met at the middle of iteration (first var) %u " fprintf(stderr, "EOL met at the middle of iteration (first var) %u "
"instead of beginning of %u\n", i, ITERATIONS); "instead of beginning of %u\n", i, ITERATIONS);
...@@ -542,12 +542,12 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -542,12 +542,12 @@ int main(int argc __attribute__((unused)), char *argv[])
{ {
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE " fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
"data read(%d) " "data read(%d) "
"type %u, strid %u, len %lu != %lu + 14, hdr len: %u, " "type %u, strid %u, len %lu != %lu + 14, hdr len: %d, "
"ref1(%lu,0x%lx), ref2(%lu,0x%lx), " "ref1(%lu,0x%lx), ref2(%lu,0x%lx), "
"lsn(%lu,0x%lx)\n", "lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid, i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len, (ulong) rec.record_length, (ulong) rec_len,
(uint) len, len,
(ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1), (ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1),
(ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2), (ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn)); (ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
...@@ -566,13 +566,13 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -566,13 +566,13 @@ int main(int argc __attribute__((unused)), char *argv[])
translog_free_record_header(&rec); translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n", fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n",
i, errno); i, errno);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
fprintf(stderr, "EOL met at the middle of iteration %u " fprintf(stderr, "EOL met at the middle of iteration %u "
"instead of beginning of %u\n", i, ITERATIONS); "instead of beginning of %u\n", i, ITERATIONS);
...@@ -604,15 +604,15 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -604,15 +604,15 @@ int main(int argc __attribute__((unused)), char *argv[])
if (rec.type != LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE || if (rec.type != LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE ||
rec.short_trid != (i % 0xFFFF) || rec.short_trid != (i % 0xFFFF) ||
rec.record_length != rec_len || rec.record_length != rec_len ||
len != 9 || check_content(rec.header, len)) len != 9 || check_content(rec.header, (uint)len))
{ {
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE " fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"data read(%d) " "data read(%d) "
"type %u, strid %u, len %lu != %lu, hdr len: %u, " "type %u, strid %u, len %lu != %lu, hdr len: %d, "
"lsn(%lu,0x%lx)\n", "lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid, i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len, (ulong) rec.record_length, (ulong) rec_len,
(uint) len, len,
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn)); (ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
goto err; goto err;
} }
......
...@@ -349,8 +349,8 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -349,8 +349,8 @@ int main(int argc __attribute__((unused)), char *argv[])
rc= 1; rc= 1;
{ {
translog_size_t len= translog_read_record_header(first_lsn, &rec); int len= translog_read_record_header(first_lsn, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "translog_read_record_header failed (%d)\n", errno); fprintf(stderr, "translog_read_record_header failed (%d)\n", errno);
translog_free_record_header(&rec); translog_free_record_header(&rec);
...@@ -383,14 +383,14 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -383,14 +383,14 @@ int main(int argc __attribute__((unused)), char *argv[])
for (i= 1;; i++) for (i= 1;; i++)
{ {
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n", fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n",
i, errno); i, errno);
translog_free_record_header(&rec); translog_free_record_header(&rec);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
if (i != ITERATIONS) if (i != ITERATIONS)
{ {
...@@ -464,13 +464,13 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -464,13 +464,13 @@ int main(int argc __attribute__((unused)), char *argv[])
translog_free_record_header(&rec); translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header (var) " fprintf(stderr, "1-%d translog_read_next_record_header (var) "
"failed (%d)\n", i, errno); "failed (%d)\n", i, errno);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
fprintf(stderr, "EOL met at the middle of iteration (first var) %u " fprintf(stderr, "EOL met at the middle of iteration (first var) %u "
"instead of beginning of %u\n", i, ITERATIONS); "instead of beginning of %u\n", i, ITERATIONS);
...@@ -490,7 +490,7 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -490,7 +490,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE " fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE "
"data read(%d)" "data read(%d)"
"type %u (%d), strid %u (%d), len %lu, %lu + 7 (%d), " "type %u (%d), strid %u (%d), len %lu, %lu + 7 (%d), "
"hdr len: %u (%d), " "hdr len: %d (%d), "
"ref(%lu,0x%lx), lsn(%lu,0x%lx) (%d), content: %d\n", "ref(%lu,0x%lx), lsn(%lu,0x%lx) (%d), content: %d\n",
i, (uint) rec.type, i, (uint) rec.type,
rec.type !=LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE, rec.type !=LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE,
...@@ -498,7 +498,7 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -498,7 +498,7 @@ int main(int argc __attribute__((unused)), char *argv[])
rec.short_trid != (i % 0xFFFF), rec.short_trid != (i % 0xFFFF),
(ulong) rec.record_length, (ulong) rec_len, (ulong) rec.record_length, (ulong) rec_len,
rec.record_length != rec_len + LSN_STORE_SIZE, rec.record_length != rec_len + LSN_STORE_SIZE,
(uint) len, len,
len != 12, len != 12,
(ulong) LSN_FILE_NO(ref), (ulong) LSN_OFFSET(ref), (ulong) LSN_FILE_NO(ref), (ulong) LSN_OFFSET(ref),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn), (ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn),
...@@ -535,12 +535,12 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -535,12 +535,12 @@ int main(int argc __attribute__((unused)), char *argv[])
{ {
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE " fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
" data read(%d) " " data read(%d) "
"type %u, strid %u, len %lu != %lu + 14, hdr len: %u, " "type %u, strid %u, len %lu != %lu + 14, hdr len: %d, "
"ref1(%lu,0x%lx), ref2(%lu,0x%lx), " "ref1(%lu,0x%lx), ref2(%lu,0x%lx), "
"lsn(%lu,0x%lx)\n", "lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid, i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len, (ulong) rec.record_length, (ulong) rec_len,
(uint) len, len,
(ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1), (ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1),
(ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2), (ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn)); (ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
...@@ -561,14 +561,14 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -561,14 +561,14 @@ int main(int argc __attribute__((unused)), char *argv[])
translog_free_record_header(&rec); translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n", fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n",
i, errno); i, errno);
translog_free_record_header(&rec); translog_free_record_header(&rec);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
fprintf(stderr, "EOL met at the middle of iteration %u " fprintf(stderr, "EOL met at the middle of iteration %u "
"instead of beginning of %u\n", i, ITERATIONS); "instead of beginning of %u\n", i, ITERATIONS);
...@@ -606,11 +606,11 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -606,11 +606,11 @@ int main(int argc __attribute__((unused)), char *argv[])
{ {
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE " fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"data read(%d) " "data read(%d) "
"type %u, strid %u, len %lu != %lu, hdr len: %u, " "type %u, strid %u, len %lu != %lu, hdr len: %d, "
"lsn(%lu,0x%lx)\n", "lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid, i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len, (ulong) rec.record_length, (ulong) rec_len,
(uint) len, len,
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn)); (ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
translog_free_record_header(&rec); translog_free_record_header(&rec);
goto err; goto err;
......
...@@ -363,7 +363,8 @@ int main(int argc __attribute__((unused)), ...@@ -363,7 +363,8 @@ int main(int argc __attribute__((unused)),
{ {
uint indeces[WRITERS]; uint indeces[WRITERS];
uint index, len, stage; uint index, stage;
int len;
bzero(indeces, sizeof(uint) * WRITERS); bzero(indeces, sizeof(uint) * WRITERS);
bzero(indeces, sizeof(indeces)); bzero(indeces, sizeof(indeces));
...@@ -377,14 +378,14 @@ int main(int argc __attribute__((unused)), ...@@ -377,14 +378,14 @@ int main(int argc __attribute__((unused)),
{ {
len= translog_read_next_record_header(&scanner, &rec); len= translog_read_next_record_header(&scanner, &rec);
if (len == 0) if (len == RECHEADER_READ_ERROR)
{ {
fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n", fprintf(stderr, "1-%d translog_read_next_record_header failed (%d)\n",
i, errno); i, errno);
translog_free_record_header(&rec); translog_free_record_header(&rec);
goto err; goto err;
} }
if (rec.lsn == LSN_IMPOSSIBLE) if (len == RECHEADER_READ_EOF)
{ {
if (i != WRITERS * ITERATIONS * 2) if (i != WRITERS * ITERATIONS * 2)
{ {
...@@ -427,18 +428,18 @@ int main(int argc __attribute__((unused)), ...@@ -427,18 +428,18 @@ int main(int argc __attribute__((unused)),
len != 9 || len != 9 ||
rec.record_length != lens[rec.short_trid][index] || rec.record_length != lens[rec.short_trid][index] ||
cmp_translog_addr(lsns2[rec.short_trid][index], rec.lsn) != 0 || cmp_translog_addr(lsns2[rec.short_trid][index], rec.lsn) != 0 ||
check_content(rec.header, len)) check_content(rec.header, (uint)len))
{ {
fprintf(stderr, fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE " "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"data read(%d) " "data read(%d) "
"thread: %d, iteration %d, stage %d\n" "thread: %d, iteration %d, stage %d\n"
"type %u (%d), len %u, length %lu %lu (%d) " "type %u (%d), len %d, length %lu %lu (%d) "
"lsn(%lu,0x%lx) (%lu,0x%lx)\n", "lsn(%lu,0x%lx) (%lu,0x%lx)\n",
i, (uint) rec.short_trid, index, stage, i, (uint) rec.short_trid, index, stage,
(uint) rec.type, (rec.type != (uint) rec.type, (rec.type !=
LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE), LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE),
(uint) len, len,
(ulong) rec.record_length, lens[rec.short_trid][index], (ulong) rec.record_length, lens[rec.short_trid][index],
(rec.record_length != lens[rec.short_trid][index]), (rec.record_length != lens[rec.short_trid][index]),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_FILE_NO(rec.lsn),
......
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