Commit 204434f2 authored by Michael Widenius's avatar Michael Widenius

Backport aria usage if LSN_FMT from 10.3

This helps when merging code between releases
parent cf403934
......@@ -7549,7 +7549,7 @@ void _ma_print_block_info(MARIA_SHARE *share, uchar *buff)
{
LSN lsn= lsn_korr(buff);
printf("LSN: %lu,0x%lx type: %u dir_entries: %u dir_free: %u empty_space: %u\n",
printf("LSN: " LSN_FMT " type: %u dir_entries: %u dir_free: %u empty_space: %u\n",
LSN_IN_PARTS(lsn),
(uint)buff[PAGE_TYPE_OFFSET],
(uint)buff[DIR_COUNT_OFFSET],
......
......@@ -170,7 +170,7 @@ static int really_execute_checkpoint(void)
"Horizon" is a lower bound of the LSN of the next log record.
*/
checkpoint_start_log_horizon= translog_get_horizon();
DBUG_PRINT("info",("checkpoint_start_log_horizon (%lu,0x%lx)",
DBUG_PRINT("info",("checkpoint_start_log_horizon " LSN_FMT "",
LSN_IN_PARTS(checkpoint_start_log_horizon)));
lsn_store(checkpoint_start_log_horizon_char, checkpoint_start_log_horizon);
......@@ -375,7 +375,7 @@ static void flush_all_tables(int what_to_flush)
MA_STATE_INFO_WRITE_DONT_MOVE_OFFSET|
MA_STATE_INFO_WRITE_LOCK);
DBUG_PRINT("maria_flush_states",
("is_of_horizon: LSN (%lu,0x%lx)",
("is_of_horizon: LSN " LSN_FMT "",
LSN_IN_PARTS(info->s->state.is_of_horizon)));
break;
case 2:
......
This diff is collapsed.
......@@ -47,7 +47,8 @@ typedef TRANSLOG_ADDRESS LSN;
#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)
#define LSN_IN_PARTS(L) (uint)LSN_FILE_NO(L),(uint)LSN_OFFSET(L)
#define LSN_FMT "(%u,0x%x)"
/* Gets record offset of a LSN/log address */
#define LSN_OFFSET(L) (ulong) ((L) & 0xFFFFFFFFL)
......
......@@ -1378,7 +1378,7 @@ uint _ma_state_info_write(MARIA_SHARE *share, uint pWrite)
is too new). Recovery does it by itself.
*/
share->state.is_of_horizon= translog_get_horizon();
DBUG_PRINT("info", ("is_of_horizon set to LSN (%lu,0x%lx)",
DBUG_PRINT("info", ("is_of_horizon set to LSN " LSN_FMT "",
LSN_IN_PARTS(share->state.is_of_horizon)));
}
res= _ma_state_info_write_sub(share->kfile.file, &share->state, pWrite);
......
......@@ -2793,7 +2793,7 @@ static void check_and_set_lsn(PAGECACHE *pagecache,
*/
DBUG_ASSERT((block->type == PAGECACHE_LSN_PAGE) || maria_in_recovery);
old= lsn_korr(block->buffer);
DBUG_PRINT("info", ("old lsn: (%lu, 0x%lx) new lsn: (%lu, 0x%lx)",
DBUG_PRINT("info", ("old lsn: " LSN_FMT " new lsn: " LSN_FMT,
LSN_IN_PARTS(old), LSN_IN_PARTS(lsn)));
if (cmp_translog_addr(lsn, old) > 0)
{
......
This diff is collapsed.
......@@ -1526,8 +1526,8 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
}
if (share->base.born_transactional)
{
printf("LSNs: create_rename (%lu,0x%lx),"
" state_horizon (%lu,0x%lx), skip_redo (%lu,0x%lx)\n",
printf("LSNs: create_rename " LSN_FMT ","
" state_horizon " LSN_FMT ", skip_redo " LSN_FMT "\n",
LSN_IN_PARTS(share->state.create_rename_lsn),
LSN_IN_PARTS(share->state.is_of_horizon),
LSN_IN_PARTS(share->state.skip_redo_lsn));
......
......@@ -109,11 +109,11 @@ int main(int argc, char **argv)
last_checkpoint_lsn != LSN_IMPOSSIBLE)
{
lsn= LSN_IMPOSSIBLE; /* LSN set in maria_apply_log() */
fprintf(stdout, "Starting from checkpoint (%lu,0x%lx)\n",
fprintf(stdout, "Starting from checkpoint " LSN_FMT "\n",
LSN_IN_PARTS(last_checkpoint_lsn));
}
else
fprintf(stdout, "The transaction log starts from lsn (%lu,0x%lx)\n",
fprintf(stdout, "The transaction log starts from lsn " LSN_FMT "\n",
LSN_IN_PARTS(lsn));
if (opt_start_from_lsn)
......@@ -125,7 +125,7 @@ int main(int argc, char **argv)
goto err;
}
lsn= (LSN) opt_start_from_lsn;
fprintf(stdout, "Starting reading log from lsn (%lu,0x%lx)\n",
fprintf(stdout, "Starting reading log from lsn " LSN_FMT "\n",
LSN_IN_PARTS(lsn));
}
......
......@@ -114,7 +114,7 @@ static my_bool check_content(uchar *ptr, ulong length)
void read_ok(TRANSLOG_HEADER_BUFFER *rec)
{
ok(1, "read record type: %u LSN: (%lu,0x%lx)",
ok(1, "read record type: %u LSN: " LSN_FMT,
rec->type, LSN_IN_PARTS(rec->lsn));
}
......@@ -399,7 +399,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_0LSN_EXAMPLE "
"data read(0)\n"
"type %u, strid %u, len %u, i: %u, 4: %u 5: %u, "
"lsn(%lu,0x%lx)\n",
"lsn" LSN_FMT "\n",
(uint) rec.type, (uint) rec.short_trid, (uint) rec.record_length,
(uint) uint4korr(rec.header), (uint) rec.header[4],
(uint) rec.header[5],
......@@ -444,8 +444,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_1LSN_EXAMPLE "
"data read(%d) "
"type: %u strid: %u len: %u"
"ref: (%lu,0x%lx) (%lu,0x%lx) "
"lsn(%lu,0x%lx)\n",
"ref: " LSN_FMT " " LSN_FMT " "
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
LSN_IN_PARTS(ref), LSN_IN_PARTS(lsn),
......@@ -475,9 +475,9 @@ int main(int argc __attribute__((unused)), char *argv[])
{
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_2LSN_EXAMPLE "
"data read(%d) "
"type %u, strid %u, len %u, ref1(%lu,0x%lx), "
"ref2(%lu,0x%lx) %x%x%x%x%x%x%x%x%x "
"lsn(%lu,0x%lx)\n",
"type %u, strid %u, len %u, ref1" LSN_FMT ", "
"ref2" LSN_FMT " %x%x%x%x%x%x%x%x%x "
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
......@@ -522,7 +522,7 @@ int main(int argc __attribute__((unused)), char *argv[])
"data read(%d)"
"type %u (%d), strid %u (%d), len %lu, %lu + 7 (%d), "
"hdr len: %u (%d), "
"ref(%lu,0x%lx), lsn(%lu,0x%lx) (%d), content: %d\n",
"ref" LSN_FMT ", lsn" LSN_FMT " (%d), content: %d\n",
i, (uint) rec.type,
rec.type != LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE,
(uint) rec.short_trid,
......@@ -541,7 +541,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",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
goto err;
}
......@@ -565,8 +565,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
"data read(%d) "
"type %u, strid %u, len %lu != %lu + 14, hdr len: %d, "
"ref1(%lu,0x%lx), ref2(%lu,0x%lx), "
"lsn(%lu,0x%lx)\n",
"ref1" LSN_FMT ", ref2" LSN_FMT ", "
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len, LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
......@@ -577,7 +577,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",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
goto err;
}
......@@ -606,7 +606,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_0LSN_EXAMPLE "
"data read(%d)\n"
"type %u, strid %u, len %u, i: %u, 4: %u 5: %u "
"lsn(%lu,0x%lx)\n",
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
(uint) uint4korr(rec.header), (uint) rec.header[4],
......@@ -629,7 +629,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"data read(%d) "
"type %u, strid %u, len %lu != %lu, hdr len: %d, "
"lsn(%lu,0x%lx)\n",
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len, LSN_IN_PARTS(rec.lsn));
......@@ -639,7 +639,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",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
goto err;
}
......
......@@ -102,7 +102,7 @@ int main(int argc __attribute__((unused)), char *argv[])
first_lsn= translog_first_lsn_in_log();
if (first_lsn != LSN_IMPOSSIBLE)
{
fprintf(stderr, "Incorrect first lsn response (%lu,0x%lx).",
fprintf(stderr, "Incorrect first lsn response " LSN_FMT ".",
LSN_IN_PARTS(first_lsn));
translog_destroy();
exit(1);
......@@ -140,8 +140,8 @@ int main(int argc __attribute__((unused)), char *argv[])
first_lsn= translog_first_lsn_in_log();
if (first_lsn != theor_lsn)
{
fprintf(stderr, "Incorrect first lsn: (%lu,0x%lx) "
" theoretical first: (%lu,0x%lx)\n",
fprintf(stderr, "Incorrect first lsn: " LSN_FMT " "
" theoretical first: " LSN_FMT "\n",
LSN_IN_PARTS(first_lsn), LSN_IN_PARTS(theor_lsn));
translog_destroy();
exit(1);
......
......@@ -94,7 +94,7 @@ int main(int argc __attribute__((unused)), char *argv[])
}
if (max_lsn != LSN_IMPOSSIBLE)
{
fprintf(stderr, "Incorrect first lsn response (%lu,0x%lx).",
fprintf(stderr, "Incorrect first lsn response " LSN_FMT ".",
LSN_IN_PARTS(max_lsn));
translog_destroy();
exit(1);
......@@ -138,8 +138,8 @@ int main(int argc __attribute__((unused)), char *argv[])
}
if (max_lsn != last_lsn)
{
fprintf(stderr, "Incorrect max lsn: (%lu,0x%lx) "
" last lsn on first file: (%lu,0x%lx)\n",
fprintf(stderr, "Incorrect max lsn: " LSN_FMT " "
" last lsn on first file: " LSN_FMT "\n",
LSN_IN_PARTS(max_lsn), LSN_IN_PARTS(last_lsn));
translog_destroy();
exit(1);
......
......@@ -486,7 +486,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_0LSN_EXAMPLE "
"data read(0)\n"
"type %u, strid %u, len %u, i: %u, 4: %u 5: %u, "
"lsn(0x%lu,0x%lx)\n",
LSN_FMT "\n",
(uint) rec.type, (uint) rec.short_trid, (uint) rec.record_length,
(uint)uint4korr(rec.header), (uint) rec.header[4],
(uint) rec.header[5],
......@@ -534,7 +534,7 @@ int main(int argc __attribute__((unused)), char *argv[])
{
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_1LSN_EXAMPLE "
"data read(%d)"
"type %u, strid %u, len %u, ref(%lu,0x%lx), lsn(%lu,0x%lx)\n",
"type %u, strid %u, len %u, ref" LSN_FMT ", lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
LSN_IN_PARTS(ref), LSN_IN_PARTS(rec.lsn));
......@@ -564,9 +564,9 @@ int main(int argc __attribute__((unused)), char *argv[])
{
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_2LSN_EXAMPLE "
"data read(%d) "
"type %u, strid %u, len %u, ref1(%lu,0x%lx), "
"ref2(%lu,0x%lx) %x%x%x%x%x%x%x%x%x "
"lsn(%lu,0x%lx)\n",
"type %u, strid %u, len %u, ref1" LSN_FMT ", "
"ref2" LSN_FMT " %x%x%x%x%x%x%x%x%x "
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
LSN_IN_PARTS(ref1), LSN_IN_PARTS(ref2),
......@@ -612,7 +612,7 @@ int main(int argc __attribute__((unused)), char *argv[])
"data read(%d)"
"type %u (%d), strid %u (%d), len %lu, %lu + 7 (%d), "
"hdr len: %d (%d), "
"ref(%lu,0x%lx), lsn(%lu,0x%lx) (%d), content: %d\n",
"ref" LSN_FMT ", lsn" LSN_FMT " (%d), content: %d\n",
i, (uint) rec.type,
rec.type !=LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE,
(uint) rec.short_trid,
......@@ -632,7 +632,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",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
......@@ -656,8 +656,8 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE "
" data read(%d) "
"type %u, strid %u, len %lu != %lu + 14, hdr len: %d, "
"ref1(%lu,0x%lx), ref2(%lu,0x%lx), "
"lsn(%lu,0x%lx)\n",
"ref1" LSN_FMT ", ref2" LSN_FMT ", "
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len,
......@@ -670,7 +670,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",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
......@@ -702,7 +702,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_0LSN_EXAMPLE "
"data read(%d)\n"
"type %u, strid %u, len %u, i: %u, 4: %u 5: %u "
"lsn(%lu,0x%lx)\n",
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(uint) rec.record_length,
(uint)uint4korr(rec.header), (uint) rec.header[4],
......@@ -726,7 +726,7 @@ int main(int argc __attribute__((unused)), char *argv[])
fprintf(stderr, "Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"data read(%d) "
"type %u, strid %u, len %lu != %lu, hdr len: %d, "
"lsn(%lu,0x%lx)\n",
"lsn" LSN_FMT "\n",
i, (uint) rec.type, (uint) rec.short_trid,
(ulong) rec.record_length, (ulong) rec_len,
len, LSN_IN_PARTS(rec.lsn));
......@@ -737,7 +737,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",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
......
......@@ -486,7 +486,7 @@ int main(int argc __attribute__((unused)),
fprintf(stderr, "Incorrect LOGREC_FIXED_RECORD_0LSN_EXAMPLE "
"data read(%d)\n"
"type %u, strid %u %u, len %u, i: %u %u, "
"lsn(%lu,0x%lx) (%lu,0x%lx)\n",
"lsn" LSN_FMT " " LSN_FMT "\n",
i, (uint) rec.type,
(uint) rec.short_trid, (uint) uint2korr(rec.header),
(uint) rec.record_length,
......@@ -510,7 +510,7 @@ int main(int argc __attribute__((unused)),
"data read(%d) "
"thread: %d, iteration %d, stage %d\n"
"type %u (%d), len %d, length %lu %lu (%d) "
"lsn(%lu,0x%lx) (%lu,0x%lx)\n",
"lsn" LSN_FMT " " LSN_FMT "\n",
i, (uint) rec.short_trid, index, stage,
(uint) rec.type, (rec.type !=
LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE),
......@@ -526,7 +526,7 @@ int main(int argc __attribute__((unused)),
{
fprintf(stderr,
"Incorrect LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE "
"in whole rec read lsn(%lu,0x%lx)\n",
"in whole rec read lsn" LSN_FMT "\n",
LSN_IN_PARTS(rec.lsn));
translog_free_record_header(&rec);
goto err;
......
......@@ -116,7 +116,7 @@ int main(int argc __attribute__((unused)), char *argv[])
"data read(0)\n"
"type: %u (%d) strid: %u (%d) len: %u (%d) i: %u (%d), "
"4: %u (%d) 5: %u (%d) "
"lsn(%lu,0x%lx) (%d)\n",
"lsn" LSN_FMT " (%d)\n",
(uint) rec.type, (rec.type !=LOGREC_FIXED_RECORD_0LSN_EXAMPLE),
(uint) rec.short_trid, (rec.short_trid != 0),
(uint) rec.record_length, (rec.record_length != 6),
......
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