Commit a303f5b2 authored by unknown's avatar unknown

Fixes of the empty log problem.


storage/maria/ma_checkpoint.c:
  The new macro for easier printing LSN added.
storage/maria/ma_loghandler.c:
  The assertion returned.
  The new macro for easier printing LSN added.
storage/maria/ma_loghandler_lsn.h:
  The new macro for easier printing LSN added.
storage/maria/ma_pagecache.c:
  The new macro for easier printing LSN added.
storage/maria/ma_recovery.c:
  Recovery checks empty log state.
  RECHEADER_READ_ERROR means some real error.
storage/maria/maria_read_log.c:
  Read log starts from real beggining of the log and precess
  error and empty log states.
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  The new macro for easier printing LSN added.
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  The new macro for easier printing LSN added.
parent 9b266392
......@@ -191,9 +191,8 @@ static int really_execute_checkpoint()
this horizon.
*/
checkpoint_start_log_horizon= translog_get_horizon();
#define LSN_IN_HEX(L) (ulong)LSN_FILE_NO(L),(ulong)LSN_OFFSET(L)
DBUG_PRINT("info",("checkpoint_start_log_horizon (%lu,0x%lx)",
LSN_IN_HEX(checkpoint_start_log_horizon)));
LSN_IN_PARTS(checkpoint_start_log_horizon)));
lsn_store(checkpoint_start_log_horizon_char, checkpoint_start_log_horizon);
......
This diff is collapsed.
......@@ -41,6 +41,9 @@ typedef TRANSLOG_ADDRESS LSN;
/* Gets raw file number part of a LSN/log address */
#define LSN_FILE_NO_PART(L) ((L) & ((int64)0xFFFFFF00000000LL))
/* Parts of LSN for printing */
#define LSN_IN_PARTS(L) (ulong)LSN_FILE_NO(L),(ulong)LSN_OFFSET(L)
/* Gets record offset of a LSN/log address */
#define LSN_OFFSET(L) ((L) & 0xFFFFFFFFL)
......
......@@ -2469,8 +2469,7 @@ static void check_and_set_lsn(PAGECACHE *pagecache,
DBUG_ASSERT(block->type == PAGECACHE_LSN_PAGE);
old= lsn_korr(block->buffer + PAGE_LSN_OFFSET);
DBUG_PRINT("info", ("old lsn: (%lu, 0x%lx) new lsn: (%lu, 0x%lx)",
(ulong)LSN_FILE_NO(old), (ulong)LSN_OFFSET(old),
(ulong)LSN_FILE_NO(lsn), (ulong)LSN_OFFSET(lsn)));
LSN_IN_PARTS(old), LSN_IN_PARTS(lsn)));
if (cmp_translog_addr(lsn, old) > 0)
{
......
......@@ -119,7 +119,6 @@ static void enlarge_buffer(const TRANSLOG_HEADER_BUFFER *rec)
}
#define ALERT_USER() DBUG_ASSERT(0)
#define LSN_IN_HEX(L) (ulong)LSN_FILE_NO(L),(ulong)LSN_OFFSET(L)
/**
......@@ -270,7 +269,7 @@ static void display_record_position(const LOG_DESC *log_desc,
form a group, so we indent below the group's end record
*/
fprintf(tracef, "%sRec#%u LSN (%lu,0x%lx) short_trid %u %s(num_type:%u) len %lu\n",
number ? "" : " ", number, LSN_IN_HEX(rec->lsn),
number ? "" : " ", number, LSN_IN_PARTS(rec->lsn),
rec->short_trid, log_desc->name, rec->type,
(ulong)rec->record_length);
}
......@@ -301,7 +300,7 @@ prototype_redo_exec_hook(LONG_TRANSACTION_ID)
if (gslsn != LSN_IMPOSSIBLE)
{
fprintf(tracef, "Group at LSN (%lu,0x%lx) short_trid %u aborted\n",
LSN_IN_HEX(gslsn), sid);
LSN_IN_PARTS(gslsn), sid);
all_active_trans[sid].group_start_lsn= LSN_IMPOSSIBLE;
}
if (long_trid != 0)
......@@ -314,7 +313,7 @@ prototype_redo_exec_hook(LONG_TRANSACTION_ID)
fprintf(tracef, "Found an old transaction long_trid %s short_trid %u"
" with same short id as this new transaction, and has neither"
" committed nor rollback (undo_lsn: (%lu,0x%lx))\n", llbuf,
sid, LSN_IN_HEX(ulsn));
sid, LSN_IN_PARTS(ulsn));
goto err;
}
}
......@@ -394,7 +393,7 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
{
fprintf(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
" record, ignoring creation",
LSN_IN_HEX(share->state.create_rename_lsn));
LSN_IN_PARTS(share->state.create_rename_lsn));
error= 0;
goto end;
}
......@@ -515,7 +514,7 @@ prototype_redo_exec_hook(REDO_RENAME_TABLE)
{
fprintf(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
" record, ignoring renaming",
LSN_IN_HEX(share->state.create_rename_lsn));
LSN_IN_PARTS(share->state.create_rename_lsn));
error= 0;
goto end;
}
......@@ -634,7 +633,7 @@ prototype_redo_exec_hook(REDO_DROP_TABLE)
{
fprintf(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
" record, ignoring removal",
LSN_IN_HEX(share->state.create_rename_lsn));
LSN_IN_PARTS(share->state.create_rename_lsn));
error= 0;
goto end;
}
......@@ -760,8 +759,8 @@ static int new_table(uint16 sid, const char *name,
{
fprintf(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
" LOGREC_FILE_ID's LSN (%lu,0x%lx), ignoring open request",
LSN_IN_HEX(share->state.create_rename_lsn),
LSN_IN_HEX(lsn_of_file_id));
LSN_IN_PARTS(share->state.create_rename_lsn),
LSN_IN_PARTS(lsn_of_file_id));
error= -1;
goto end;
}
......@@ -1063,7 +1062,7 @@ prototype_redo_exec_hook(COMMIT)
table, so an unfinished group staid in the log.
*/
fprintf(tracef, ", with group at LSN (%lu,0x%lx) short_trid %u aborted\n",
(ulong) LSN_FILE_NO(gslsn), (ulong) LSN_OFFSET(gslsn), sid);
LSN_IN_PARTS(gslsn), sid);
all_active_trans[sid].group_start_lsn= LSN_IMPOSSIBLE;
}
else
......@@ -1093,7 +1092,7 @@ prototype_redo_exec_hook(CLR_END)
set_undo_lsn_for_active_trans(rec->short_trid, previous_undo_lsn);
fprintf(tracef, " CLR_END was about %s, undo_lsn now LSN (%lu,0x%lx)\n",
log_desc->name, LSN_IN_HEX(previous_undo_lsn));
log_desc->name, LSN_IN_PARTS(previous_undo_lsn));
if (cmp_translog_addr(rec->lsn, info->s->state.is_of_horizon) > 0)
{
fprintf(tracef, " state older than record, updating rows' count\n");
......@@ -1144,7 +1143,7 @@ prototype_undo_exec_hook(UNDO_ROW_INSERT)
/* trn->undo_lsn is updated in an inwrite_hook when writing the CLR_END */
fprintf(tracef, " rows' count %lu\n", (ulong)info->s->state.state.records);
fprintf(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
LSN_IN_HEX(previous_undo_lsn));
LSN_IN_PARTS(previous_undo_lsn));
return error;
}
......@@ -1186,7 +1185,7 @@ prototype_undo_exec_hook(UNDO_ROW_DELETE)
info->trn= 0;
fprintf(tracef, " rows' count %lu\n", (ulong)info->s->state.state.records);
fprintf(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
LSN_IN_HEX(previous_undo_lsn));
LSN_IN_PARTS(previous_undo_lsn));
return error;
}
......@@ -1221,7 +1220,7 @@ prototype_undo_exec_hook(UNDO_ROW_UPDATE)
(LSN_STORE_SIZE + FILEID_STORE_SIZE));
info->trn= 0;
fprintf(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
LSN_IN_HEX(previous_undo_lsn));
LSN_IN_PARTS(previous_undo_lsn));
return error;
}
......@@ -1261,13 +1260,19 @@ static int run_redo_phase(LSN lsn, my_bool apply)
TRANSLOG_HEADER_BUFFER rec;
if (unlikely(lsn == translog_get_horizon()))
{
fprintf(tracef, "Cannot find a first record, empty log, nothing to do.\n");
return 0;
}
int len= translog_read_record_header(lsn, &rec);
/** @todo EOF should be detected */
if (len == RECHEADER_READ_ERROR)
{
fprintf(tracef, "Cannot find a first record, empty log, nothing to do\n");
return 0;
fprintf(tracef, "Failed to read header of the first record.\n");
return 1;
}
struct st_translog_scanner_data scanner;
if (translog_init_scanner(lsn, 1, &scanner))
......@@ -1416,7 +1421,7 @@ static uint end_of_redo_phase(my_bool prepare_for_undo_phase)
if (gslsn != LSN_IMPOSSIBLE)
{
fprintf(tracef, "Group at LSN (%lu,0x%lx) short_trid %u aborted\n",
(ulong) LSN_FILE_NO(gslsn), (ulong) LSN_OFFSET(gslsn), sid);
LSN_IN_PARTS(gslsn), sid);
ALERT_USER();
}
if (all_active_trans[sid].undo_lsn != LSN_IMPOSSIBLE)
......@@ -1590,7 +1595,7 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
DBUG_ASSERT(cmp_translog_addr(rec->lsn, checkpoint_start) < 0);
fprintf(tracef, ", table's LOGREC_FILE_ID has LSN (%lu,0x%lx) more recent"
" than record, skipping record",
LSN_IN_HEX(info->s->lsn_of_file_id));
LSN_IN_PARTS(info->s->lsn_of_file_id));
return NULL;
}
/* detect if an open instance of a dropped table (internal bug) */
......@@ -1643,7 +1648,7 @@ static MARIA_HA *get_MARIA_HA_from_UNDO_record(const
{
fprintf(tracef, ", table's LOGREC_FILE_ID has LSN (%lu,0x%lx) more recent"
" than record, skipping record",
LSN_IN_HEX(info->s->lsn_of_file_id));
LSN_IN_PARTS(info->s->lsn_of_file_id));
return NULL;
}
DBUG_ASSERT(info->s->last_version != 0);
......@@ -1670,7 +1675,7 @@ static LSN parse_checkpoint_record(LSN lsn)
TRANSLOG_HEADER_BUFFER rec;
fprintf(tracef, "Loading data from checkpoint record at LSN (%lu,0x%lx)\n",
LSN_IN_HEX(lsn));
LSN_IN_PARTS(lsn));
int len= translog_read_record_header(lsn, &rec);
if (len == RECHEADER_READ_ERROR)
......
......@@ -86,11 +86,18 @@ int main(int argc, char **argv)
printf("You are using --only-display, NOTHING will be written to disk\n");
/* LSN could be also --start-from-lsn=# */
lsn= translog_first_theoretical_lsn();
/*
@todo process LSN_IMPOSSIBLE and LSN_ERROR values of
translog_first_theoretical_lsn()
*/
lsn= translog_first_lsn_in_log();
if (lsn == LSN_ERROR)
{
fprintf(stderr, "Opening transaction log failed\n");
goto end;
}
if (lsn == LSN_IMPOSSIBLE)
{
fprintf(stdout, "The transaction log is empty\n");
}
fprintf(stdout, "The transaction log starts from lsn (%lu,0x%lx)\n",
LSN_IN_PARTS(lsn));
fprintf(stdout, "TRACE of the last maria_read_log\n");
if (maria_apply_log(lsn, opt_display_and_apply, stdout,
......
......@@ -88,8 +88,7 @@ void read_ok(TRANSLOG_HEADER_BUFFER *rec)
{
char buff[80];
snprintf(buff, sizeof(buff), "read record type: %u LSN: (%lu,0x%lx)",
rec->type, (ulong) LSN_FILE_NO(rec->lsn),
(ulong) LSN_OFFSET(rec->lsn));
rec->type, LSN_IN_PARTS(rec->lsn));
ok(1, buff);
}
......@@ -358,7 +357,7 @@ int main(int argc __attribute__((unused)), char *argv[])
(uint) rec.type, (uint) rec.short_trid, (uint) rec.record_length,
(uint) uint4korr(rec.header), (uint) rec.header[4],
(uint) rec.header[5],
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
goto err;
}
read_ok(&rec);
......@@ -403,9 +402,8 @@ int main(int argc __attribute__((unused)), char *argv[])
"lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
(ulong) LSN_FILE_NO(ref), (ulong) LSN_OFFSET(ref),
(ulong) LSN_FILE_NO(lsn), (ulong) LSN_OFFSET(lsn),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(ref), LSN_IN_PARTS(lsn),
LSN_IN_PARTS(rec.lsn));
goto err;
}
}
......@@ -436,14 +434,13 @@ int main(int argc __attribute__((unused)), char *argv[])
"lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
(ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1),
(ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2),
LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
(uint) rec.header[14], (uint) rec.header[15],
(uint) rec.header[16], (uint) rec.header[17],
(uint) rec.header[18], (uint) rec.header[19],
(uint) rec.header[20], (uint) rec.header[21],
(uint) rec.header[22],
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
goto err;
}
}
......@@ -488,8 +485,7 @@ int main(int argc __attribute__((unused)), char *argv[])
rec.record_length != rec_len + LSN_STORE_SIZE,
(uint) len,
len != 12,
(ulong) LSN_FILE_NO(ref), (ulong) LSN_OFFSET(ref),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn),
LSN_IN_PARTS(ref), LSN_IN_PARTS(rec.lsn),
(len != 12 || ref != lsn),
check_content(rec.header + LSN_STORE_SIZE,
len - LSN_STORE_SIZE));
......@@ -500,7 +496,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
goto err;
}
}
......@@ -527,10 +523,8 @@ int main(int argc __attribute__((unused)), char *argv[])
"lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len,
(ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1),
(ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
len, LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
LSN_IN_PARTS(rec.lsn));
goto err;
}
if (read_and_check_content(&rec, long_buffer, LSN_STORE_SIZE * 2))
......@@ -538,7 +532,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
goto err;
}
}
......@@ -571,7 +565,7 @@ int main(int argc __attribute__((unused)), char *argv[])
(uint) rec.record_length,
(uint) uint4korr(rec.header), (uint) rec.header[4],
(uint) rec.header[5],
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
goto err;
}
lsn= rec.lsn;
......@@ -592,8 +586,7 @@ int main(int argc __attribute__((unused)), char *argv[])
"lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len,
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
len, LSN_IN_PARTS(rec.lsn));
goto err;
}
if (read_and_check_content(&rec, long_buffer, 0))
......@@ -601,7 +594,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
goto err;
}
read_ok(&rec);
......
......@@ -92,8 +92,7 @@ int main(int argc __attribute__((unused)), char *argv[])
if (first_lsn != LSN_IMPOSSIBLE)
{
fprintf(stderr, "Incorrect first lsn response (%lu,0x%lx).",
(ulong) LSN_FILE_NO(first_lsn),
(ulong) LSN_OFFSET(first_lsn));
LSN_IN_PARTS(first_lsn));
translog_destroy();
exit(1);
}
......@@ -132,10 +131,7 @@ int main(int argc __attribute__((unused)), char *argv[])
{
fprintf(stderr, "Incorrect first lsn: (%lu,0x%lx) "
" theoretical first: (%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(first_lsn),
(ulong) LSN_OFFSET(first_lsn),
(ulong) LSN_FILE_NO(theor_lsn),
(ulong) LSN_OFFSET(theor_lsn));
LSN_IN_PARTS(first_lsn), LSN_IN_PARTS(theor_lsn));
translog_destroy();
exit(1);
}
......
......@@ -79,8 +79,7 @@ int main(int argc __attribute__((unused)), char *argv[])
if (max_lsn != LSN_IMPOSSIBLE)
{
fprintf(stderr, "Incorrect first lsn response (%lu,0x%lx).",
(ulong) LSN_FILE_NO(max_lsn),
(ulong) LSN_OFFSET(max_lsn));
LSN_IN_PARTS(max_lsn));
translog_destroy();
exit(1);
}
......@@ -125,10 +124,7 @@ int main(int argc __attribute__((unused)), char *argv[])
{
fprintf(stderr, "Incorrect max lsn: (%lu,0x%lx) "
" last lsn on first file: (%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(max_lsn),
(ulong) LSN_OFFSET(max_lsn),
(ulong) LSN_FILE_NO(last_lsn),
(ulong) LSN_OFFSET(last_lsn));
LSN_IN_PARTS(max_lsn), LSN_IN_PARTS(last_lsn));
translog_destroy();
exit(1);
}
......
......@@ -371,7 +371,7 @@ int main(int argc __attribute__((unused)), char *argv[])
(uint) rec.type, (uint) rec.short_trid, (uint) rec.record_length,
(uint)uint4korr(rec.header), (uint) rec.header[4],
(uint) rec.header[5],
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -418,8 +418,7 @@ int main(int argc __attribute__((unused)), char *argv[])
"type %u, strid %u, len %u, ref(%lu,0x%lx), lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
(ulong) LSN_FILE_NO(ref), (ulong) LSN_OFFSET(ref),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(ref), LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -451,14 +450,13 @@ int main(int argc __attribute__((unused)), char *argv[])
"lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
(ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1),
(ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2),
LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
(uint) rec.header[14], (uint) rec.header[15],
(uint) rec.header[16], (uint) rec.header[17],
(uint) rec.header[18], (uint) rec.header[19],
(uint) rec.header[20], (uint) rec.header[21],
(uint) rec.header[22],
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -503,8 +501,7 @@ int main(int argc __attribute__((unused)), char *argv[])
rec.record_length != rec_len + LSN_STORE_SIZE,
len,
len != 12,
(ulong) LSN_FILE_NO(ref), (ulong) LSN_OFFSET(ref),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn),
LSN_IN_PARTS(ref), LSN_IN_PARTS(rec.lsn),
(ref != lsn),
check_content(rec.header + LSN_STORE_SIZE,
len - LSN_STORE_SIZE));
......@@ -516,7 +513,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -544,9 +541,8 @@ int main(int argc __attribute__((unused)), char *argv[])
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len,
(ulong) LSN_FILE_NO(ref1), (ulong) LSN_OFFSET(ref1),
(ulong) LSN_FILE_NO(ref2), (ulong) LSN_OFFSET(ref2),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -555,7 +551,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -591,7 +587,7 @@ int main(int argc __attribute__((unused)), char *argv[])
(uint) rec.record_length,
(uint)uint4korr(rec.header), (uint) rec.header[4],
(uint) rec.header[5],
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -613,8 +609,7 @@ int main(int argc __attribute__((unused)), char *argv[])
"lsn(%lu,0x%lx)\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len,
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
len, LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......@@ -623,7 +618,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......
......@@ -418,10 +418,8 @@ int main(int argc __attribute__((unused)),
(uint) rec.short_trid, (uint) uint2korr(rec.header),
(uint) rec.record_length,
(uint) index, (uint) uint4korr(rec.header + 2),
(ulong) LSN_FILE_NO(rec.lsn),
(ulong) LSN_OFFSET(rec.lsn),
(ulong) LSN_FILE_NO(lsns1[rec.short_trid][index]),
(ulong) LSN_OFFSET(lsns1[rec.short_trid][index]));
LSN_IN_PARTS(rec.lsn),
LSN_IN_PARTS(lsns1[rec.short_trid][index]));
translog_free_record_header(&rec);
goto err;
}
......@@ -446,10 +444,8 @@ int main(int argc __attribute__((unused)),
len,
(ulong) rec.record_length, lens[rec.short_trid][index],
(rec.record_length != lens[rec.short_trid][index]),
(ulong) LSN_FILE_NO(rec.lsn),
(ulong) LSN_OFFSET(rec.lsn),
(ulong) LSN_FILE_NO(lsns2[rec.short_trid][index]),
(ulong) LSN_OFFSET(lsns2[rec.short_trid][index]));
LSN_IN_PARTS(rec.lsn),
LSN_IN_PARTS(lsns2[rec.short_trid][index]));
translog_free_record_header(&rec);
goto err;
}
......@@ -458,8 +454,7 @@ int main(int argc __attribute__((unused)),
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
(ulong) LSN_FILE_NO(rec.lsn),
(ulong) LSN_OFFSET(rec.lsn));
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
}
......
......@@ -114,8 +114,7 @@ int main(int argc __attribute__((unused)), char *argv[])
(uint) uint4korr(rec.header), (uint4korr(rec.header) != 0),
(uint) rec.header[4], (((uchar)rec.header[4]) != 0),
(uint) rec.header[5], (((uchar)rec.header[5]) != 0xFF),
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn),
(first_lsn != rec.lsn));
LSN_IN_PARTS(rec.lsn), (first_lsn != rec.lsn));
goto err;
}
......
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