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:
......
......@@ -1175,7 +1175,7 @@ static my_bool translog_max_lsn_to_header(File file, LSN lsn)
my_bool rc;
DBUG_ENTER("translog_max_lsn_to_header");
DBUG_PRINT("enter", ("File descriptor: %ld "
"lsn: (%lu,0x%lx)",
"lsn: " LSN_FMT,
(long) file,
LSN_IN_PARTS(lsn)));
......@@ -1248,7 +1248,7 @@ my_bool translog_read_file_header(LOGHANDLER_FILE_INFO *desc, File file)
translog_interpret_file_header(desc, page_buff);
DBUG_PRINT("info", ("timestamp: %llu aria ver: %lu mysql ver: %lu "
"server id %lu page size %lu file number %lu "
"max lsn: (%lu,0x%lx)",
"max lsn: " LSN_FMT,
(ulonglong) desc->timestamp,
(ulong) desc->maria_version,
(ulong) desc->mysql_version,
......@@ -1277,7 +1277,7 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file,
{
uint32 file;
DBUG_ENTER("translog_set_lsn_for_files");
DBUG_PRINT("enter", ("From: %lu to: %lu lsn: (%lu,0x%lx) locked: %d",
DBUG_PRINT("enter", ("From: %lu to: %lu lsn: " LSN_FMT " locked: %d",
(ulong) from_file, (ulong) to_file,
LSN_IN_PARTS(lsn),
is_locked));
......@@ -1506,7 +1506,7 @@ LSN translog_get_file_max_lsn_stored(uint32 file)
info.max_lsn= LSN_ERROR;
}
DBUG_PRINT("info", ("Max lsn: (%lu,0x%lx)", LSN_IN_PARTS(info.max_lsn)));
DBUG_PRINT("info", ("Max lsn: " LSN_FMT, LSN_IN_PARTS(info.max_lsn)));
DBUG_RETURN(info.max_lsn);
}
}
......@@ -1792,7 +1792,7 @@ static void translog_new_page_header(TRANSLOG_ADDRESS *horizon,
if (log_descriptor.flags & TRANSLOG_PAGE_CRC)
{
#ifndef DBUG_OFF
DBUG_PRINT("info", ("write 0x11223344 CRC to (%lu,0x%lx)",
DBUG_PRINT("info", ("write 0x11223344 CRC to " LSN_FMT,
LSN_IN_PARTS(*horizon)));
/* This will be overwritten by real CRC; This is just for debugging */
int4store(ptr, 0x11223344);
......@@ -1819,7 +1819,7 @@ static void translog_new_page_header(TRANSLOG_ADDRESS *horizon,
}
cursor->ptr= ptr;
DBUG_PRINT("info", ("NewP buffer #%u: 0x%lx chaser: %d Size: %lu (%lu) "
"Horizon: (%lu,0x%lx)",
"Horizon: " LSN_FMT,
(uint) cursor->buffer->buffer_no, (ulong) cursor->buffer,
cursor->chaser, (ulong) cursor->buffer->size,
(ulong) (cursor->ptr - cursor->buffer->buffer),
......@@ -1924,13 +1924,13 @@ static void translog_finish_page(TRANSLOG_ADDRESS *horizon,
uchar *page= cursor->ptr - cursor->current_page_fill;
DBUG_ENTER("translog_finish_page");
DBUG_PRINT("enter", ("Buffer: #%u 0x%lx "
"Buffer addr: (%lu,0x%lx) "
"Page addr: (%lu,0x%lx) "
"Buffer addr: " LSN_FMT " "
"Page addr: " LSN_FMT " "
"size:%lu (%lu) Pg:%u left:%u",
(uint) cursor->buffer_no, (ulong) cursor->buffer,
LSN_IN_PARTS(cursor->buffer->offset),
(ulong) LSN_FILE_NO(*horizon),
(ulong) (LSN_OFFSET(*horizon) -
(uint) LSN_FILE_NO(*horizon),
(uint) (LSN_OFFSET(*horizon) -
cursor->current_page_fill),
(ulong) cursor->buffer->size,
(ulong) (cursor->ptr -cursor->buffer->buffer),
......@@ -2197,7 +2197,7 @@ static my_bool translog_buffer_next(TRANSLOG_ADDRESS *horizon,
my_bool chasing= cursor->chaser;
DBUG_ENTER("translog_buffer_next");
DBUG_PRINT("info", ("horizon: (%lu,0x%lx) chasing: %d",
DBUG_PRINT("info", ("horizon: " LSN_FMT " chasing: %d",
LSN_IN_PARTS(log_descriptor.horizon), chasing));
DBUG_ASSERT(cmp_translog_addr(log_descriptor.horizon, *horizon) >= 0);
......@@ -2249,7 +2249,7 @@ static my_bool translog_buffer_next(TRANSLOG_ADDRESS *horizon,
BUFFER_MAX_LSN(log_descriptor.buffers + old_buffer_no);
}
log_descriptor.buffers[old_buffer_no].next_buffer_offset= new_buffer->offset;
DBUG_PRINT("info", ("prev_last_lsn set to (%lu,0x%lx) buffer: 0x%lx",
DBUG_PRINT("info", ("prev_last_lsn set to " LSN_FMT " buffer: 0x%lx",
LSN_IN_PARTS(new_buffer->prev_last_lsn),
(ulong) new_buffer));
translog_new_page_header(horizon, cursor);
......@@ -2274,9 +2274,9 @@ static void translog_set_sent_to_disk(struct st_translog_buffer *buffer)
DBUG_ENTER("translog_set_sent_to_disk");
mysql_mutex_lock(&log_descriptor.sent_to_disk_lock);
DBUG_PRINT("enter", ("lsn: (%lu,0x%lx) in_buffers: (%lu,0x%lx) "
"in_buffers_only: (%lu,0x%lx) start: (%lu,0x%lx) "
"sent_to_disk: (%lu,0x%lx)",
DBUG_PRINT("enter", ("lsn: " LSN_FMT " in_buffers: " LSN_FMT " "
"in_buffers_only: " LSN_FMT " start: " LSN_FMT " "
"sent_to_disk: " LSN_FMT,
LSN_IN_PARTS(lsn),
LSN_IN_PARTS(in_buffers),
LSN_IN_PARTS(log_descriptor.log_start),
......@@ -2314,8 +2314,8 @@ static void translog_set_only_in_buffers(TRANSLOG_ADDRESS in_buffers)
{
DBUG_ENTER("translog_set_only_in_buffers");
mysql_mutex_lock(&log_descriptor.sent_to_disk_lock);
DBUG_PRINT("enter", ("in_buffers: (%lu,0x%lx) "
"in_buffers_only: (%lu,0x%lx)",
DBUG_PRINT("enter", ("in_buffers: " LSN_FMT " "
"in_buffers_only: " LSN_FMT,
LSN_IN_PARTS(in_buffers),
LSN_IN_PARTS(log_descriptor.in_buffers_only)));
/* LSN_IMPOSSIBLE == 0 => it will work for very first time */
......@@ -2369,7 +2369,7 @@ static LSN translog_get_sent_to_disk()
DBUG_ENTER("translog_get_sent_to_disk");
mysql_mutex_lock(&log_descriptor.sent_to_disk_lock);
lsn= log_descriptor.sent_to_disk;
DBUG_PRINT("info", ("sent to disk up to (%lu,0x%lx)", LSN_IN_PARTS(lsn)));
DBUG_PRINT("info", ("sent to disk up to " LSN_FMT, LSN_IN_PARTS(lsn)));
mysql_mutex_unlock(&log_descriptor.sent_to_disk_lock);
DBUG_RETURN(lsn);
}
......@@ -2578,8 +2578,8 @@ my_bool translog_prev_buffer_flush_wait(struct st_translog_buffer *buffer)
TRANSLOG_FILE *file= buffer->file;
uint8 ver= buffer->ver;
DBUG_ENTER("translog_prev_buffer_flush_wait");
DBUG_PRINT("enter", ("buffer: 0x%lx #%u offset: (%lu,0x%lx) "
"prev sent: (%lu,0x%lx) prev offset: (%lu,0x%lx)",
DBUG_PRINT("enter", ("buffer: 0x%lx #%u offset: " LSN_FMT " "
"prev sent: " LSN_FMT " prev offset: " LSN_FMT,
(ulong) buffer, (uint) buffer->buffer_no,
LSN_IN_PARTS(buffer->offset),
LSN_IN_PARTS(buffer->prev_sent_to_disk),
......@@ -2619,8 +2619,8 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
uint skipped_data;
DBUG_ENTER("translog_buffer_flush");
DBUG_PRINT("enter",
("Buffer: #%u 0x%lx file: %d offset: (%lu,0x%lx) size: %lu",
(uint) buffer->buffer_no, (ulong) buffer,
("Buffer: #%u %p file: %d offset: " LSN_FMT " size: %lu",
(uint) buffer->buffer_no, buffer,
buffer->file->handler.file,
LSN_IN_PARTS(buffer->offset),
(ulong) buffer->size));
......@@ -2659,11 +2659,11 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
#ifndef DBUG_OFF
TRANSLOG_ADDRESS addr= (buffer->offset + i);
#endif
DBUG_PRINT("info", ("send log form %lu till %lu address: (%lu,0x%lx) "
"page #: %lu buffer size: %lu buffer: 0x%lx",
DBUG_PRINT("info", ("send log form %lu till %lu address: " LSN_FMT " "
"page #: %lu buffer size: %lu buffer: %p",
(ulong) i, (ulong) (i + TRANSLOG_PAGE_SIZE),
LSN_IN_PARTS(addr), (ulong) pg, (ulong) buffer->size,
(ulong) buffer));
buffer));
DBUG_ASSERT(log_descriptor.pagecache->block_size == TRANSLOG_PAGE_SIZE);
DBUG_ASSERT(i + TRANSLOG_PAGE_SIZE <= buffer->size);
if (translog_status != TRANSLOG_OK && translog_status != TRANSLOG_SHUTDOWN)
......@@ -2680,9 +2680,9 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
TRANSLOG_PAGE_SIZE - skipped_data))
{
DBUG_PRINT("error",
("Can't write page (%lu,0x%lx) to pagecache, error: %d",
(ulong) buffer->file->number,
(ulong) (LSN_OFFSET(buffer->offset)+ i),
("Can't write page " LSN_FMT " to pagecache, error: %d",
buffer->file->number,
(uint) (LSN_OFFSET(buffer->offset)+ i),
my_errno));
translog_stop_writing();
DBUG_RETURN(1);
......@@ -2695,10 +2695,10 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
LSN_OFFSET(buffer->offset) + buffer->skipped_data,
log_write_flags))
{
DBUG_PRINT("error", ("Can't write buffer (%lu,0x%lx) size %lu "
DBUG_PRINT("error", ("Can't write buffer " LSN_FMT " size %lu "
"to the disk (%d)",
(ulong) file->handler.file,
(ulong) LSN_OFFSET(buffer->offset),
(uint) file->handler.file,
(uint) LSN_OFFSET(buffer->offset),
(ulong) buffer->size, errno));
translog_stop_writing();
DBUG_RETURN(1);
......@@ -2918,10 +2918,10 @@ static my_bool translog_page_validator(int res, PAGECACHE_IO_HOOK_ARGS *args)
if ((pgcache_page_no_t) uint3korr(page) != page_no ||
(uint32) uint3korr(page + 3) != data->number)
{
DBUG_PRINT("error", ("Page (%lu,0x%lx): "
DBUG_PRINT("error", ("Page " LSN_FMT ": "
"page address written in the page is incorrect: "
"File %lu instead of %lu or page %lu instead of %lu",
(ulong) data->number, (ulong) offset,
(uint)data->number, (uint)offset,
(ulong) uint3korr(page + 3), (ulong) data->number,
(ulong) uint3korr(page),
(ulong) page_no));
......@@ -2932,9 +2932,9 @@ static my_bool translog_page_validator(int res, PAGECACHE_IO_HOOK_ARGS *args)
if (flags & ~(TRANSLOG_PAGE_CRC | TRANSLOG_SECTOR_PROTECTION |
TRANSLOG_RECORD_CRC))
{
DBUG_PRINT("error", ("Page (%lu,0x%lx): "
DBUG_PRINT("error", ("Page " LSN_FMT ": "
"Garbage in the page flags field detected : %x",
(ulong) data->number, (ulong) offset,
(uint) data->number, (uint) offset,
(uint) flags));
DBUG_RETURN(1);
}
......@@ -2946,9 +2946,9 @@ static my_bool translog_page_validator(int res, PAGECACHE_IO_HOOK_ARGS *args)
this_page_page_overhead);
if (crc != uint4korr(page_pos))
{
DBUG_PRINT("error", ("Page (%lu,0x%lx): "
DBUG_PRINT("error", ("Page " LSN_FMT ": "
"CRC mismatch: calculated: %lx on the page %lx",
(ulong) data->number, (ulong) offset,
(uint) data->number, (uint) offset,
(ulong) crc, (ulong) uint4korr(page_pos)));
DBUG_RETURN(1);
}
......@@ -3029,10 +3029,10 @@ static uchar *translog_get_page(TRANSLOG_VALIDATOR_DATA *data, uchar *buffer,
uint32 file_no= LSN_FILE_NO(addr);
TRANSLOG_FILE *file;
DBUG_ENTER("translog_get_page");
DBUG_PRINT("enter", ("File: %lu Offset: %lu(0x%lx)",
(ulong) file_no,
(ulong) LSN_OFFSET(addr),
(ulong) LSN_OFFSET(addr)));
DBUG_PRINT("enter", ("File: %u Offset: %u(0x%x)",
file_no,
(uint) LSN_OFFSET(addr),
(uint) LSN_OFFSET(addr)));
/* it is really page address */
DBUG_ASSERT(LSN_OFFSET(addr) % TRANSLOG_PAGE_SIZE == 0);
......@@ -3042,7 +3042,7 @@ static uchar *translog_get_page(TRANSLOG_VALIDATOR_DATA *data, uchar *buffer,
restart:
in_buffers= translog_only_in_buffers();
DBUG_PRINT("info", ("in_buffers: (%lu,0x%lx)",
DBUG_PRINT("info", ("in_buffers: " LSN_FMT,
LSN_IN_PARTS(in_buffers)));
if (in_buffers != LSN_IMPOSSIBLE &&
cmp_translog_addr(addr, in_buffers) >= 0)
......@@ -3424,8 +3424,8 @@ static my_bool translog_truncate_log(TRANSLOG_ADDRESS addr)
uchar page_buff[TRANSLOG_PAGE_SIZE];
DBUG_ENTER("translog_truncate_log");
/* TODO: write warning to the client */
DBUG_PRINT("warning", ("removing all records from (%lu,0x%lx) "
"till (%lu,0x%lx)",
DBUG_PRINT("warning", ("removing all records from " LSN_FMT " "
"till " LSN_FMT,
LSN_IN_PARTS(addr),
LSN_IN_PARTS(log_descriptor.horizon)));
DBUG_ASSERT(cmp_translog_addr(addr, log_descriptor.horizon) < 0);
......@@ -4139,7 +4139,7 @@ my_bool translog_init_with_table(const char *directory,
There is no harm in leaving it "as-is".
*/
log_descriptor.previous_flush_horizon= log_descriptor.horizon;
DBUG_PRINT("info", ("previous_flush_horizon: (%lu,0x%lx)",
DBUG_PRINT("info", ("previous_flush_horizon: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.
previous_flush_horizon)));
DBUG_RETURN(0);
......@@ -4167,7 +4167,7 @@ my_bool translog_init_with_table(const char *directory,
translog_size_t rec_len;
int len;
uchar buffer[1];
DBUG_PRINT("info", ("going to check the last found record (%lu,0x%lx)",
DBUG_PRINT("info", ("going to check the last found record " LSN_FMT,
LSN_IN_PARTS(last_lsn)));
len=
......@@ -4176,7 +4176,7 @@ my_bool translog_init_with_table(const char *directory,
len == RECHEADER_READ_EOF))
{
DBUG_PRINT("error", ("unexpected end of log or record during "
"reading record header: (%lu,0x%lx) len: %d",
"reading record header: " LSN_FMT " len: %d",
LSN_IN_PARTS(last_lsn), len));
if (readonly)
log_descriptor.log_start= log_descriptor.horizon= last_lsn;
......@@ -4200,7 +4200,7 @@ my_bool translog_init_with_table(const char *directory,
if (rec_len != 1)
{
DBUG_PRINT("error", ("unexpected end of log or record during "
"reading record body: (%lu,0x%lx) len: %d",
"reading record body: " LSN_FMT " len: %d",
LSN_IN_PARTS(rec.lsn),
len));
if (readonly)
......@@ -4218,7 +4218,7 @@ my_bool translog_init_with_table(const char *directory,
}
}
log_descriptor.previous_flush_horizon= log_descriptor.horizon;
DBUG_PRINT("info", ("previous_flush_horizon: (%lu,0x%lx)",
DBUG_PRINT("info", ("previous_flush_horizon: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.previous_flush_horizon)));
DBUG_RETURN(0);
err:
......@@ -4237,7 +4237,7 @@ static void translog_buffer_destroy(struct st_translog_buffer *buffer)
{
DBUG_ENTER("translog_buffer_destroy");
DBUG_PRINT("enter",
("Buffer #%u: 0x%lx file: %d offset: (%lu,0x%lx) size: %lu",
("Buffer #%u: 0x%lx file: %d offset: " LSN_FMT " size: %lu",
(uint) buffer->buffer_no, (ulong) buffer,
(buffer->file ? buffer->file->handler.file : -1),
LSN_IN_PARTS(buffer->offset),
......@@ -4502,7 +4502,7 @@ static my_bool translog_write_parts_on_page(TRANSLOG_ADDRESS *horizon,
}
} while (left);
DBUG_PRINT("info", ("Horizon: (%lu,0x%lx) Length %lu(0x%lx)",
DBUG_PRINT("info", ("Horizon: " LSN_FMT " Length %lu(0x%lx)",
LSN_IN_PARTS(*horizon),
(ulong) length, (ulong) length));
parts->current= cur;
......@@ -4516,7 +4516,7 @@ static my_bool translog_write_parts_on_page(TRANSLOG_ADDRESS *horizon,
*/
DBUG_PRINT("info", ("Write parts buffer #%u: 0x%lx "
"chaser: %d Size: %lu (%lu) "
"Horizon: (%lu,0x%lx) buff offset: 0x%lx",
"Horizon: " LSN_FMT " buff offset: 0x%lx",
(uint) cursor->buffer->buffer_no, (ulong) cursor->buffer,
cursor->chaser, (ulong) cursor->buffer->size,
(ulong) (cursor->ptr - cursor->buffer->buffer),
......@@ -4747,7 +4747,7 @@ static my_bool translog_advance_pointer(int pages, uint16 last_page_data,
pages * TRANSLOG_PAGE_SIZE + last_page_offset);
translog_size_t buffer_end_offset, file_end_offset, min_offset;
DBUG_ENTER("translog_advance_pointer");
DBUG_PRINT("enter", ("Pointer: (%lu, 0x%lx) + %u + %u pages + %u + %u",
DBUG_PRINT("enter", ("Pointer: " LSN_FMT " + %u + %u pages + %u + %u",
LSN_IN_PARTS(log_descriptor.horizon),
(uint) (TRANSLOG_PAGE_SIZE -
log_descriptor.bc.current_page_fill),
......@@ -4799,20 +4799,20 @@ static my_bool translog_advance_pointer(int pages, uint16 last_page_data,
file_end_offset= (TRANSLOG_PAGE_SIZE -
log_descriptor.bc.current_page_fill);
}
DBUG_PRINT("info", ("offset: %lu buffer_end_offs: %lu, "
"file_end_offs: %lu",
(ulong) offset, (ulong) buffer_end_offset,
(ulong) file_end_offset));
DBUG_PRINT("info", ("Buff #%u %u (0x%lx) offset 0x%lx + size 0x%lx = "
"0x%lx (0x%lx)",
(uint) log_descriptor.bc.buffer->buffer_no,
(uint) log_descriptor.bc.buffer_no,
(ulong) log_descriptor.bc.buffer,
(ulong) LSN_OFFSET(log_descriptor.bc.buffer->offset),
(ulong) log_descriptor.bc.buffer->size,
(ulong) (LSN_OFFSET(log_descriptor.bc.buffer->offset) +
DBUG_PRINT("info", ("offset: %u buffer_end_offs: %u, "
"file_end_offs: %u",
offset, buffer_end_offset,
file_end_offset));
DBUG_PRINT("info", ("Buff #%u %u (%p) offset 0x%x + size 0x%x = "
"0x%x (0x%x)",
log_descriptor.bc.buffer->buffer_no,
log_descriptor.bc.buffer_no,
log_descriptor.bc.buffer,
(uint) LSN_OFFSET(log_descriptor.bc.buffer->offset),
log_descriptor.bc.buffer->size,
(uint) (LSN_OFFSET(log_descriptor.bc.buffer->offset) +
log_descriptor.bc.buffer->size),
(ulong) LSN_OFFSET(log_descriptor.horizon)));
(uint) LSN_OFFSET(log_descriptor.horizon)));
DBUG_ASSERT(LSN_OFFSET(log_descriptor.bc.buffer->offset) +
log_descriptor.bc.buffer->size ==
LSN_OFFSET(log_descriptor.horizon));
......@@ -4845,9 +4845,9 @@ static my_bool translog_advance_pointer(int pages, uint16 last_page_data,
/* TODO: check is it ptr or size enough */
log_descriptor.bc.buffer->size+= min_offset;
log_descriptor.bc.ptr+= min_offset;
DBUG_PRINT("info", ("NewP buffer #%u: 0x%lx chaser: %d Size: %lu (%lu)",
DBUG_PRINT("info", ("NewP buffer #%u: %p chaser: %d Size: %lu (%lu)",
(uint) log_descriptor.bc.buffer->buffer_no,
(ulong) log_descriptor.bc.buffer,
log_descriptor.bc.buffer,
log_descriptor.bc.chaser,
(ulong) log_descriptor.bc.buffer->size,
(ulong) (log_descriptor.bc.ptr -log_descriptor.bc.
......@@ -4898,10 +4898,10 @@ static my_bool translog_advance_pointer(int pages, uint16 last_page_data,
used_buffs_add(buffs, log_descriptor.bc.buffer);
log_descriptor.horizon+= offset; /* offset increasing */
log_descriptor.bc.current_page_fill= last_page_offset;
DBUG_PRINT("info", ("NewP buffer #%u: 0x%lx chaser: %d Size: %lu (%lu) "
DBUG_PRINT("info", ("NewP buffer #%u: %p chaser: %d Size: %lu (%lu) "
"offset: %u last page: %u",
(uint) log_descriptor.bc.buffer->buffer_no,
(ulong) log_descriptor.bc.buffer,
log_descriptor.bc.buffer,
log_descriptor.bc.chaser,
(ulong) log_descriptor.bc.buffer->size,
(ulong) (log_descriptor.bc.ptr -
......@@ -4909,7 +4909,7 @@ static my_bool translog_advance_pointer(int pages, uint16 last_page_data,
buffer), (uint) offset,
(uint) last_page_offset));
DBUG_PRINT("info",
("pointer moved to: (%lu, 0x%lx)",
("pointer moved to: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon)));
translog_check_cursor(&log_descriptor.bc);
log_descriptor.bc.protected= 0;
......@@ -4999,7 +4999,7 @@ static uint translog_get_current_page_rest()
static uint translog_get_current_buffer_rest()
{
return ((log_descriptor.bc.buffer->buffer + TRANSLOG_WRITE_BUFFER -
return (uint)((log_descriptor.bc.buffer->buffer + TRANSLOG_WRITE_BUFFER -
log_descriptor.bc.ptr) /
TRANSLOG_PAGE_SIZE);
}
......@@ -5046,7 +5046,7 @@ static inline void set_lsn(LSN *lsn, LSN value)
*lsn= value;
/* we generate LSN so something is not flushed in log */
log_descriptor.is_everything_flushed= 0;
DBUG_PRINT("info", ("new LSN appeared: (%lu,0x%lx)", LSN_IN_PARTS(value)));
DBUG_PRINT("info", ("new LSN appeared: " LSN_FMT, LSN_IN_PARTS(value)));
DBUG_VOID_RETURN;
}
......@@ -5143,9 +5143,9 @@ translog_write_variable_record_1group(LSN *lsn,
(record_rest ? record_rest + 3 : 0),
&cursor.buffs);
log_descriptor.bc.buffer->last_lsn= *lsn;
DBUG_PRINT("info", ("last_lsn set to (%lu,0x%lx) buffer: 0x%lx",
DBUG_PRINT("info", ("last_lsn set to " LSN_FMT " buffer: %p",
LSN_IN_PARTS(log_descriptor.bc.buffer->last_lsn),
(ulong) log_descriptor.bc.buffer));
log_descriptor.bc.buffer));
translog_unlock();
......@@ -5172,7 +5172,7 @@ translog_write_variable_record_1group(LSN *lsn,
/* fill the pages */
translog_write_parts_on_page(&horizon, &cursor, first_page, parts);
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx)",
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon)));
......@@ -5181,7 +5181,7 @@ translog_write_variable_record_1group(LSN *lsn,
if (translog_write_variable_record_chunk2_page(parts, &horizon, &cursor))
goto error;
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx)",
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon)));
}
......@@ -5193,7 +5193,7 @@ translog_write_variable_record_1group(LSN *lsn,
page_capacity_chunk_2 - 2,
&horizon, &cursor))
goto error;
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx)",
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon)));
DBUG_ASSERT(cursor.current_page_fill == TRANSLOG_PAGE_SIZE);
......@@ -5203,11 +5203,11 @@ translog_write_variable_record_1group(LSN *lsn,
record_rest,
&horizon, &cursor))
goto error;
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx)",
(ulong) LSN_FILE_NO(log_descriptor.horizon),
(ulong) LSN_OFFSET(log_descriptor.horizon),
(ulong) LSN_FILE_NO(horizon),
(ulong) LSN_OFFSET(horizon)));
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT,
(uint) LSN_FILE_NO(log_descriptor.horizon),
(uint) LSN_OFFSET(log_descriptor.horizon),
(uint) LSN_FILE_NO(horizon),
(uint) LSN_OFFSET(horizon)));
translog_buffer_lock(cursor.buffer);
translog_buffer_decrease_writers(cursor.buffer);
......@@ -5279,9 +5279,9 @@ translog_write_variable_record_1chunk(LSN *lsn,
&log_descriptor.bc,
parts->total_record_length, parts);
log_descriptor.bc.buffer->last_lsn= *lsn;
DBUG_PRINT("info", ("last_lsn set to (%lu,0x%lx) buffer: 0x%lx",
DBUG_PRINT("info", ("last_lsn set to " LSN_FMT " buffer: %p",
LSN_IN_PARTS(log_descriptor.bc.buffer->last_lsn),
(ulong) log_descriptor.bc.buffer));
log_descriptor.bc.buffer));
translog_unlock();
/*
......@@ -5326,9 +5326,9 @@ static uchar *translog_put_LSN_diff(LSN base_lsn, LSN lsn, uchar *dst)
{
uint64 diff;
DBUG_ENTER("translog_put_LSN_diff");
DBUG_PRINT("enter", ("Base: (%lu,0x%lx) val: (%lu,0x%lx) dst: 0x%lx",
DBUG_PRINT("enter", ("Base: " LSN_FMT " val: " LSN_FMT " dst: %p",
LSN_IN_PARTS(base_lsn), LSN_IN_PARTS(lsn),
(ulong) dst));
dst));
DBUG_ASSERT(base_lsn > lsn);
diff= base_lsn - lsn;
DBUG_PRINT("info", ("Diff: 0x%llx", (ulonglong) diff));
......@@ -5372,7 +5372,7 @@ static uchar *translog_put_LSN_diff(LSN base_lsn, LSN lsn, uchar *dst)
dst[1]= 1;
lsn_store(dst + 2, lsn);
}
DBUG_PRINT("info", ("new dst: 0x%lx", (ulong) dst));
DBUG_PRINT("info", ("new dst: %p", dst));
DBUG_RETURN(dst);
}
......@@ -5411,7 +5411,7 @@ static uchar *translog_get_LSN_from_diff(LSN base_lsn, uchar *src, uchar *dst)
uint32 file_no, rec_offset;
uint8 code;
DBUG_ENTER("translog_get_LSN_from_diff");
DBUG_PRINT("enter", ("Base: (%lu,0x%lx) src: 0x%lx dst 0x%lx",
DBUG_PRINT("enter", ("Base: " LSN_FMT " src: 0x%lx dst 0x%lx",
LSN_IN_PARTS(base_lsn), (ulong) src, (ulong) dst));
first_byte= *((uint8*) src);
code= first_byte >> 6; /* Length is in 2 most significant bits */
......@@ -5729,7 +5729,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
translog_write_data_on_page(&horizon, &cursor, 1, chunk2_header);
translog_write_parts_on_page(&horizon, &cursor, first_page - 1, parts);
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx) "
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT " "
"Left %lu",
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon),
......@@ -5741,8 +5741,8 @@ translog_write_variable_record_mgroup(LSN *lsn,
if (translog_write_variable_record_chunk2_page(parts, &horizon, &cursor))
goto err;
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) "
"local: (%lu,0x%lx) "
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " "
"local: " LSN_FMT " "
"Left: %lu",
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon),
......@@ -5910,7 +5910,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
DBUG_PRINT("info", ("chunk 2 to finish first page"));
translog_write_data_on_page(&horizon, &cursor, 1, chunk2_header);
translog_write_parts_on_page(&horizon, &cursor, first_page - 1, parts);
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx) "
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT " "
"Left: %lu",
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon),
......@@ -5927,7 +5927,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
int2store(chunk3_header + 1, chunk3_size);
translog_write_data_on_page(&horizon, &cursor, 3, chunk3_header);
translog_write_parts_on_page(&horizon, &cursor, chunk3_size, parts);
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx) "
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT " "
"Left: %lu",
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon),
......@@ -5945,7 +5945,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
if (translog_write_variable_record_chunk2_page(parts, &horizon, &cursor))
goto err;
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx) "
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT " "
"Left: %lu",
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon),
......@@ -5959,7 +5959,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
chunk3_size,
&horizon, &cursor))
goto err;
DBUG_PRINT("info", ("absolute horizon: (%lu,0x%lx) local: (%lu,0x%lx)",
DBUG_PRINT("info", ("absolute horizon: " LSN_FMT " local: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon),
LSN_IN_PARTS(horizon)));
......@@ -5994,9 +5994,9 @@ translog_write_variable_record_mgroup(LSN *lsn,
translog_lock();
set_lsn(lsn, horizon);
buffer_of_last_lsn->last_lsn= *lsn;
DBUG_PRINT("info", ("last_lsn set to (%lu,0x%lx) buffer: 0x%lx",
DBUG_PRINT("info", ("last_lsn set to " LSN_FMT " buffer: %p",
LSN_IN_PARTS(buffer_of_last_lsn->last_lsn),
(ulong) buffer_of_last_lsn));
buffer_of_last_lsn));
if (log_record_type_descriptor[type].inwrite_hook &&
(*log_record_type_descriptor[type].inwrite_hook) (type, trn,
tbl_info,
......@@ -6131,7 +6131,7 @@ static my_bool translog_write_variable_record(LSN *lsn,
DBUG_ENTER("translog_write_variable_record");
translog_lock();
DBUG_PRINT("info", ("horizon: (%lu,0x%lx)",
DBUG_PRINT("info", ("horizon: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon)));
page_rest= TRANSLOG_PAGE_SIZE - log_descriptor.bc.current_page_fill;
DBUG_PRINT("info", ("header length: %u page_rest: %u",
......@@ -6247,7 +6247,7 @@ static my_bool translog_write_fixed_record(LSN *lsn,
log_record_type_descriptor[type].fixed_length));
translog_lock();
DBUG_PRINT("info", ("horizon: (%lu,0x%lx)",
DBUG_PRINT("info", ("horizon: " LSN_FMT,
LSN_IN_PARTS(log_descriptor.horizon)));
DBUG_ASSERT(log_descriptor.bc.current_page_fill <= TRANSLOG_PAGE_SIZE);
......@@ -6311,9 +6311,9 @@ static my_bool translog_write_fixed_record(LSN *lsn,
parts->total_record_length, parts);
log_descriptor.bc.buffer->last_lsn= *lsn;
DBUG_PRINT("info", ("last_lsn set to (%lu,0x%lx) buffer: 0x%lx",
DBUG_PRINT("info", ("last_lsn set to " LSN_FMT " buffer: %p",
LSN_IN_PARTS(log_descriptor.bc.buffer->last_lsn),
(ulong) log_descriptor.bc.buffer));
log_descriptor.bc.buffer));
err:
translog_unlock();
......@@ -6502,7 +6502,7 @@ my_bool translog_write_record(LSN *lsn,
}
}
DBUG_PRINT("info", ("LSN: (%lu,0x%lx)", LSN_IN_PARTS(*lsn)));
DBUG_PRINT("info", ("LSN: " LSN_FMT, LSN_IN_PARTS(*lsn)));
DBUG_RETURN(rc);
}
......@@ -6717,7 +6717,7 @@ my_bool translog_scanner_init(LSN lsn,
my_bool use_direct)
{
DBUG_ENTER("translog_scanner_init");
DBUG_PRINT("enter", ("Scanner: 0x%lx LSN: (%lu,0x%lx)",
DBUG_PRINT("enter", ("Scanner: 0x%lx LSN: " LSN_FMT,
(ulong) scanner, LSN_IN_PARTS(lsn)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
......@@ -6729,7 +6729,7 @@ my_bool translog_scanner_init(LSN lsn,
scanner->direct_link= NULL;
scanner->horizon= translog_get_horizon();
DBUG_PRINT("info", ("horizon: (%lu,0x%lx)", LSN_IN_PARTS(scanner->horizon)));
DBUG_PRINT("info", ("horizon: " LSN_FMT, LSN_IN_PARTS(scanner->horizon)));
/* lsn < horizon */
DBUG_ASSERT(lsn <= scanner->horizon);
......@@ -6777,11 +6777,11 @@ static my_bool translog_scanner_eol(TRANSLOG_SCANNER_DATA *scanner)
{
DBUG_ENTER("translog_scanner_eol");
DBUG_PRINT("enter",
("Horizon: (%lu, 0x%lx) Current: (%lu, 0x%lx+0x%x=0x%lx)",
("Horizon: " LSN_FMT " Current: (%u, 0x%x+0x%x=0x%x)",
LSN_IN_PARTS(scanner->horizon),
LSN_IN_PARTS(scanner->page_addr),
(uint) scanner->page_offset,
(ulong) (LSN_OFFSET(scanner->page_addr) + scanner->page_offset)));
(uint) (LSN_OFFSET(scanner->page_addr) + scanner->page_offset)));
if (scanner->horizon > (scanner->page_addr +
scanner->page_offset))
{
......@@ -6886,7 +6886,7 @@ translog_get_next_chunk(TRANSLOG_SCANNER_DATA *scanner)
translog_free_link(scanner->direct_link);
if (translog_scanner_eof(scanner))
{
DBUG_PRINT("info", ("horizon: (%lu,0x%lx) pageaddr: (%lu,0x%lx)",
DBUG_PRINT("info", ("horizon: " LSN_FMT " pageaddr: " LSN_FMT,
LSN_IN_PARTS(scanner->horizon),
LSN_IN_PARTS(scanner->page_addr)));
/* if it is log end it have to be caught before */
......@@ -6987,7 +6987,7 @@ translog_variable_length_header(uchar *page, translog_size_t page_offset,
src+= (2 + 2);
page_rest= (uint16) (TRANSLOG_PAGE_SIZE - (src - page));
curr= 0;
header_to_skip= src - (page + page_offset);
header_to_skip= (uint) (src - (page + page_offset));
buff->chunk0_pages= 0;
for (;;)
......@@ -7005,7 +7005,7 @@ translog_variable_length_header(uchar *page, translog_size_t page_offset,
DBUG_ASSERT(curr < buff->groups_no);
buff->groups[curr].addr= lsn_korr(src + i * (7 + 1));
buff->groups[curr].num= src[i * (7 + 1) + 7];
DBUG_PRINT("info", ("group #%u (%lu,0x%lx) chunks: %u",
DBUG_PRINT("info", ("group #%u " LSN_FMT " chunks: %u",
curr,
LSN_IN_PARTS(buff->groups[curr].addr),
(uint) buff->groups[curr].num));
......@@ -7027,7 +7027,7 @@ translog_variable_length_header(uchar *page, translog_size_t page_offset,
buff->chunk0_data_addr+= (header_to_skip + read_length * (7 + 1));
}
buff->chunk0_data_len= chunk_len - 2 - read_length * (7 + 1);
DBUG_PRINT("info", ("Data address: (%lu,0x%lx) len: %u",
DBUG_PRINT("info", ("Data address: " LSN_FMT " len: %u",
LSN_IN_PARTS(buff->chunk0_data_addr),
buff->chunk0_data_len));
break;
......@@ -7150,7 +7150,7 @@ int translog_read_record_header_from_buffer(uchar *page,
translog_status == TRANSLOG_READONLY);
buff->type= (page[page_offset] & TRANSLOG_REC_TYPE);
buff->short_trid= uint2korr(page + page_offset + 1);
DBUG_PRINT("info", ("Type %u, Short TrID %u, LSN (%lu,0x%lx)",
DBUG_PRINT("info", ("Type %u, Short TrID %u, LSN " LSN_FMT,
(uint) buff->type, (uint)buff->short_trid,
LSN_IN_PARTS(buff->lsn)));
/* Read required bytes from the header and call hook */
......@@ -7199,7 +7199,7 @@ int translog_read_record_header(LSN lsn, TRANSLOG_HEADER_BUFFER *buff)
TRANSLOG_ADDRESS addr;
TRANSLOG_VALIDATOR_DATA data;
DBUG_ENTER("translog_read_record_header");
DBUG_PRINT("enter", ("LSN: (%lu,0x%lx)", LSN_IN_PARTS(lsn)));
DBUG_PRINT("enter", ("LSN: " LSN_FMT, LSN_IN_PARTS(lsn)));
DBUG_ASSERT(LSN_OFFSET(lsn) % TRANSLOG_PAGE_SIZE != 0);
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
......@@ -7244,8 +7244,8 @@ int translog_read_record_header_scan(TRANSLOG_SCANNER_DATA *scanner,
{
translog_size_t res;
DBUG_ENTER("translog_read_record_header_scan");
DBUG_PRINT("enter", ("Scanner: Cur: (%lu,0x%lx) Hrz: (%lu,0x%lx) "
"Lst: (%lu,0x%lx) Offset: %u(%x) fixed %d",
DBUG_PRINT("enter", ("Scanner: Cur: " LSN_FMT " Hrz: " LSN_FMT " "
"Lst: " LSN_FMT " Offset: %u(%x) fixed %d",
LSN_IN_PARTS(scanner->page_addr),
LSN_IN_PARTS(scanner->horizon),
LSN_IN_PARTS(scanner->last_file_page),
......@@ -7291,8 +7291,8 @@ int translog_read_next_record_header(TRANSLOG_SCANNER_DATA *scanner,
DBUG_ENTER("translog_read_next_record_header");
buff->groups_no= 0; /* to be sure that we will free it right */
DBUG_PRINT("enter", ("scanner: 0x%lx", (ulong) scanner));
DBUG_PRINT("info", ("Scanner: Cur: (%lu,0x%lx) Hrz: (%lu,0x%lx) "
"Lst: (%lu,0x%lx) Offset: %u(%x) fixed: %d",
DBUG_PRINT("info", ("Scanner: Cur: " LSN_FMT " Hrz: " LSN_FMT " "
"Lst: " LSN_FMT " Offset: %u(%x) fixed: %d",
LSN_IN_PARTS(scanner->page_addr),
LSN_IN_PARTS(scanner->horizon),
LSN_IN_PARTS(scanner->last_file_page),
......@@ -7312,7 +7312,7 @@ int translog_read_next_record_header(TRANSLOG_SCANNER_DATA *scanner,
buff->lsn= LSN_IMPOSSIBLE;
DBUG_RETURN(RECHEADER_READ_EOF);
}
DBUG_PRINT("info", ("Page: (%lu,0x%lx) offset: %lu byte: %x",
DBUG_PRINT("info", ("Page: " LSN_FMT " offset: %lu byte: %x",
LSN_IN_PARTS(scanner->page_addr),
(ulong) scanner->page_offset,
(uint) scanner->page[scanner->page_offset]));
......@@ -7521,8 +7521,8 @@ translog_size_t translog_read_record(LSN lsn,
DBUG_RETURN(0);
}
DBUG_PRINT("info", ("Offset: %lu length: %lu "
"Scanner: Cur: (%lu,0x%lx) Hrz: (%lu,0x%lx) "
"Lst: (%lu,0x%lx) Offset: %u(%x) fixed: %d",
"Scanner: Cur: " LSN_FMT " Hrz: " LSN_FMT " "
"Lst: " LSN_FMT " Offset: %u(%x) fixed: %d",
(ulong) offset, (ulong) length,
LSN_IN_PARTS(data->scanner.page_addr),
LSN_IN_PARTS(data->scanner.horizon),
......@@ -7611,15 +7611,15 @@ static void translog_force_current_buffer_to_finish()
uint16 UNINIT_VAR(current_page_fill), write_counter, previous_offset;
DBUG_ENTER("translog_force_current_buffer_to_finish");
DBUG_PRINT("enter", ("Buffer #%u 0x%lx "
"Buffer addr: (%lu,0x%lx) "
"Page addr: (%lu,0x%lx) "
DBUG_PRINT("enter", ("Buffer #%u %p "
"Buffer addr: " LSN_FMT " "
"Page addr: " LSN_FMT " "
"size: %lu (%lu) Pg: %u left: %u in progress %u",
(uint) old_buffer_no,
(ulong) old_buffer,
old_buffer,
LSN_IN_PARTS(old_buffer->offset),
(ulong) LSN_FILE_NO(log_descriptor.horizon),
(ulong) (LSN_OFFSET(log_descriptor.horizon) -
LSN_FILE_NO(log_descriptor.horizon),
(uint) (LSN_OFFSET(log_descriptor.horizon) -
log_descriptor.bc.current_page_fill),
(ulong) old_buffer->size,
(ulong) (log_descriptor.bc.ptr -log_descriptor.bc.
......@@ -7654,10 +7654,10 @@ static void translog_force_current_buffer_to_finish()
memset(log_descriptor.bc.ptr, TRANSLOG_FILLER, left);
old_buffer->size+= left;
DBUG_PRINT("info", ("Finish Page buffer #%u: 0x%lx "
DBUG_PRINT("info", ("Finish Page buffer #%u: %p "
"Size: %lu",
(uint) old_buffer->buffer_no,
(ulong) old_buffer,
old_buffer,
(ulong) old_buffer->size));
DBUG_ASSERT(old_buffer->buffer_no ==
log_descriptor.bc.buffer_no);
......@@ -7691,9 +7691,9 @@ static void translog_force_current_buffer_to_finish()
log_descriptor.bc.write_counter= write_counter;
log_descriptor.bc.previous_offset= previous_offset;
new_buffer->prev_last_lsn= BUFFER_MAX_LSN(old_buffer);
DBUG_PRINT("info", ("prev_last_lsn set to (%lu,0x%lx) buffer: 0x%lx",
DBUG_PRINT("info", ("prev_last_lsn set to " LSN_FMT " buffer: %p",
LSN_IN_PARTS(new_buffer->prev_last_lsn),
(ulong) new_buffer));
new_buffer));
/*
Advances this log pointer, increases writers and let other threads to
......@@ -7729,8 +7729,8 @@ static void translog_force_current_buffer_to_finish()
*/
DBUG_ASSERT(!old_buffer->is_closing_buffer);
old_buffer->is_closing_buffer= 1; /* Other flushes will wait */
DBUG_PRINT("enter", ("Buffer #%u 0x%lx is_closing_buffer set",
(uint) old_buffer->buffer_no, (ulong) old_buffer));
DBUG_PRINT("enter", ("Buffer #%u %p is_closing_buffer set",
(uint) old_buffer->buffer_no, old_buffer));
translog_wait_for_writers(old_buffer);
#ifndef DBUG_OFF
/* We blocked flushing this buffer so the buffer should not changed */
......@@ -7760,12 +7760,12 @@ static void translog_force_current_buffer_to_finish()
uint32 crc= translog_crc(data + log_descriptor.page_overhead,
TRANSLOG_PAGE_SIZE -
log_descriptor.page_overhead);
DBUG_PRINT("info", ("CRC: 0x%lx", (ulong) crc));
DBUG_PRINT("info", ("CRC: 0x%x", crc));
int4store(data + 3 + 3 + 1, crc);
}
old_buffer->is_closing_buffer= 0;
DBUG_PRINT("enter", ("Buffer #%u 0x%lx is_closing_buffer cleared",
(uint) old_buffer->buffer_no, (ulong) old_buffer));
DBUG_PRINT("enter", ("Buffer #%u %p is_closing_buffer cleared",
(uint) old_buffer->buffer_no, old_buffer));
mysql_cond_broadcast(&old_buffer->waiting_filling_buffer);
if (left)
......@@ -7804,7 +7804,7 @@ static void translog_force_current_buffer_to_finish()
void translog_flush_wait_for_end(LSN lsn)
{
DBUG_ENTER("translog_flush_wait_for_end");
DBUG_PRINT("enter", ("LSN: (%lu,0x%lx)", LSN_IN_PARTS(lsn)));
DBUG_PRINT("enter", ("LSN: " LSN_FMT, LSN_IN_PARTS(lsn)));
mysql_mutex_assert_owner(&log_descriptor.log_flush_lock);
while (cmp_translog_addr(log_descriptor.flushed, lsn) < 0)
mysql_cond_wait(&log_descriptor.log_flush_cond,
......@@ -7824,7 +7824,7 @@ void translog_flush_set_new_goal_and_wait(TRANSLOG_ADDRESS lsn)
{
int flush_no= log_descriptor.flush_no;
DBUG_ENTER("translog_flush_set_new_goal_and_wait");
DBUG_PRINT("enter", ("LSN: (%lu,0x%lx)", LSN_IN_PARTS(lsn)));
DBUG_PRINT("enter", ("LSN: " LSN_FMT, LSN_IN_PARTS(lsn)));
mysql_mutex_assert_owner(&log_descriptor.log_flush_lock);
if (cmp_translog_addr(lsn, log_descriptor.next_pass_max_lsn) > 0)
{
......@@ -7930,7 +7930,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
start_buffer_no= i;
DBUG_PRINT("info",
("start from: %u current: %u prev last lsn: (%lu,0x%lx)",
("start from: %u current: %u prev last lsn: " LSN_FMT,
(uint) start_buffer_no, (uint) log_descriptor.bc.buffer_no,
LSN_IN_PARTS(log_descriptor.bc.buffer->prev_last_lsn)));
......@@ -7944,7 +7944,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
{
struct st_translog_buffer *buffer= log_descriptor.bc.buffer;
*lsn= log_descriptor.bc.buffer->last_lsn; /* fix lsn if it was horizon */
DBUG_PRINT("info", ("LSN to flush fixed to last lsn: (%lu,0x%lx)",
DBUG_PRINT("info", ("LSN to flush fixed to last lsn: " LSN_FMT,
LSN_IN_PARTS(*lsn)));
last_buffer_no= log_descriptor.bc.buffer_no;
log_descriptor.is_everything_flushed= 1;
......@@ -7971,7 +7971,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
DBUG_ASSERT(log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE);
/* fix lsn if it was horizon */
*lsn= log_descriptor.bc.buffer->prev_last_lsn;
DBUG_PRINT("info", ("LSN to flush fixed to prev last lsn: (%lu,0x%lx)",
DBUG_PRINT("info", ("LSN to flush fixed to prev last lsn: " LSN_FMT,
LSN_IN_PARTS(*lsn)));
last_buffer_no= ((log_descriptor.bc.buffer_no + TRANSLOG_BUFFERS_NO -1) %
TRANSLOG_BUFFERS_NO);
......@@ -7990,10 +7990,10 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
{
struct st_translog_buffer *buffer= log_descriptor.buffers + i;
translog_buffer_lock(buffer);
DBUG_PRINT("info", ("Check buffer: 0x%lx #: %u "
"prev last LSN: (%lu,0x%lx) "
"last LSN: (%lu,0x%lx) status: %s",
(ulong)(buffer),
DBUG_PRINT("info", ("Check buffer: %p #: %u "
"prev last LSN: " LSN_FMT " "
"last LSN: " LSN_FMT " status: %s",
buffer,
(uint) i,
LSN_IN_PARTS(buffer->prev_last_lsn),
LSN_IN_PARTS(buffer->last_lsn),
......@@ -8007,7 +8007,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
buffer->pre_force_close_horizon :
buffer->offset + buffer->size);
/* pre_force_close_horizon is reset during new buffer start */
DBUG_PRINT("info", ("flush_horizon: (%lu,0x%lx)",
DBUG_PRINT("info", ("flush_horizon: " LSN_FMT,
LSN_IN_PARTS(*flush_horizon)));
DBUG_ASSERT(*flush_horizon <= log_descriptor.horizon);
......@@ -8076,12 +8076,12 @@ my_bool translog_flush(TRANSLOG_ADDRESS lsn)
my_bool rc= 0;
my_bool hgroup_commit_at_start;
DBUG_ENTER("translog_flush");
DBUG_PRINT("enter", ("Flush up to LSN: (%lu,0x%lx)", LSN_IN_PARTS(lsn)));
DBUG_PRINT("enter", ("Flush up to LSN: " LSN_FMT, LSN_IN_PARTS(lsn)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
mysql_mutex_lock(&log_descriptor.log_flush_lock);
DBUG_PRINT("info", ("Everything is flushed up to (%lu,0x%lx)",
DBUG_PRINT("info", ("Everything is flushed up to " LSN_FMT,
LSN_IN_PARTS(log_descriptor.flushed)));
if (cmp_translog_addr(log_descriptor.flushed, lsn) >= 0)
{
......@@ -8110,7 +8110,7 @@ my_bool translog_flush(TRANSLOG_ADDRESS lsn)
}
log_descriptor.flush_in_progress= 1;
flush_horizon= log_descriptor.previous_flush_horizon;
DBUG_PRINT("info", ("flush_in_progress is set, flush_horizon: (%lu,0x%lx)",
DBUG_PRINT("info", ("flush_in_progress is set, flush_horizon: " LSN_FMT,
LSN_IN_PARTS(flush_horizon)));
mysql_mutex_unlock(&log_descriptor.log_flush_lock);
......@@ -8173,7 +8173,7 @@ my_bool translog_flush(TRANSLOG_ADDRESS lsn)
log_descriptor.next_pass_max_lsn= LSN_IMPOSSIBLE;
/* prevent other thread from continue */
log_descriptor.max_lsn_requester= pthread_self();
DBUG_PRINT("info", ("flush took next goal: (%lu,0x%lx)",
DBUG_PRINT("info", ("flush took next goal: " LSN_FMT,
LSN_IN_PARTS(lsn)));
mysql_mutex_unlock(&log_descriptor.log_flush_lock);
......@@ -8530,7 +8530,7 @@ LSN translog_first_lsn_in_log()
uint16 chunk_offset;
uchar *page;
DBUG_ENTER("translog_first_lsn_in_log");
DBUG_PRINT("info", ("Horizon: (%lu,0x%lx)", LSN_IN_PARTS(horizon)));
DBUG_PRINT("info", ("Horizon: " LSN_FMT, LSN_IN_PARTS(horizon)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
......@@ -8569,7 +8569,7 @@ LSN translog_first_theoretical_lsn()
uchar *page;
TRANSLOG_VALIDATOR_DATA data;
DBUG_ENTER("translog_first_theoretical_lsn");
DBUG_PRINT("info", ("Horizon: (%lu,0x%lx)", LSN_IN_PARTS(addr)));
DBUG_PRINT("info", ("Horizon: " LSN_FMT, LSN_IN_PARTS(addr)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
......@@ -8609,7 +8609,7 @@ my_bool translog_purge(TRANSLOG_ADDRESS low)
TRANSLOG_ADDRESS horizon= translog_get_horizon();
int rc= 0;
DBUG_ENTER("translog_purge");
DBUG_PRINT("enter", ("low: (%lu,0x%lx)", LSN_IN_PARTS(low)));
DBUG_PRINT("enter", ("low: " LSN_FMT, LSN_IN_PARTS(low)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);
......@@ -9034,7 +9034,7 @@ static void dump_header_page(uchar *buff)
printf(" WARNING: page size is not equal compiled in one %lu!!!\n",
(ulong) TRANSLOG_PAGE_SIZE);
printf(" File number %lu\n"
" Max lsn: (%lu,0x%lx)\n",
" Max lsn: " LSN_FMT "\n",
desc.file_number,
LSN_IN_PARTS(desc.max_lsn));
}
......@@ -9130,7 +9130,7 @@ static uchar *dump_chunk(uchar *buffer, uchar *ptr)
{
TRANSLOG_ADDRESS gpr_addr= lsn_korr(hdr_ptr);
uint pages= hdr_ptr[LSN_STORE_SIZE];
printf (" Group +#%u: (%lu,0x%lx) pages: %u\n",
printf (" Group +#%u: " LSN_FMT " pages: %u\n",
(uint) i, LSN_IN_PARTS(gpr_addr), pages);
}
}
......@@ -9264,8 +9264,8 @@ static void dump_datapage(uchar *buffer, File handler)
ptr= buffer + header_len;
while (ptr && ptr < buffer + TRANSLOG_PAGE_SIZE)
{
printf(" Chunk (%lu,0x%lx):\n",
(ulong)file, (ulong) offset + (ptr - buffer));
printf(" Chunk %d %lld:\n",
file,((longlong) (ptr - buffer)+ offset));
ptr= dump_chunk(buffer, ptr);
}
}
......
......@@ -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)
{
......
......@@ -558,7 +558,7 @@ static void display_record_position(const LOG_DESC *log_desc,
form a group, so we indent below the group's end record
*/
tprint(tracef,
"%sRec#%u LSN (%lu,0x%lx) short_trid %u %s(num_type:%u) len %lu\n",
"%sRec#%u LSN " LSN_FMT " short_trid %u %s(num_type:%u) len %lu\n",
number ? "" : " ", number, LSN_IN_PARTS(rec->lsn),
rec->short_trid, log_desc->name, rec->type,
(ulong)rec->record_length);
......@@ -617,7 +617,7 @@ prototype_redo_exec_hook(LONG_TRANSACTION_ID)
llstr(long_trid, llbuf);
eprint(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))",
" committed nor rollback (undo_lsn: " LSN_FMT ")",
llbuf, sid, LSN_IN_PARTS(ulsn));
goto err;
}
......@@ -640,7 +640,7 @@ static void new_transaction(uint16 sid, TrID long_id, LSN undo_lsn,
all_active_trans[sid].long_trid= long_id;
llstr(long_id, llbuf);
tprint(tracef, "Transaction long_trid %s short_trid %u starts,"
" undo_lsn (%lu,0x%lx) first_undo_lsn (%lu,0x%lx)\n",
" undo_lsn " LSN_FMT " first_undo_lsn " LSN_FMT "\n",
llbuf, sid, LSN_IN_PARTS(undo_lsn), LSN_IN_PARTS(first_undo_lsn));
all_active_trans[sid].undo_lsn= undo_lsn;
all_active_trans[sid].first_undo_lsn= first_undo_lsn;
......@@ -833,7 +833,7 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
}
if (cmp_translog_addr(share->state.create_rename_lsn, rec->lsn) >= 0)
{
tprint(tracef, "Table '%s' has create_rename_lsn (%lu,0x%lx) more "
tprint(tracef, "Table '%s' has create_rename_lsn " LSN_FMT " more "
"recent than record, ignoring creation",
name, LSN_IN_PARTS(share->state.create_rename_lsn));
error= 0;
......@@ -1009,7 +1009,7 @@ prototype_redo_exec_hook(REDO_RENAME_TABLE)
}
if (cmp_translog_addr(share->state.create_rename_lsn, rec->lsn) >= 0)
{
tprint(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
tprint(tracef, ", has create_rename_lsn " LSN_FMT " more recent than"
" record, ignoring renaming",
LSN_IN_PARTS(share->state.create_rename_lsn));
error= 0;
......@@ -1064,7 +1064,7 @@ prototype_redo_exec_hook(REDO_RENAME_TABLE)
}
if (cmp_translog_addr(share->state.create_rename_lsn, rec->lsn) >= 0)
{
tprint(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
tprint(tracef, ", has create_rename_lsn " LSN_FMT " more recent than"
" record, ignoring renaming",
LSN_IN_PARTS(share->state.create_rename_lsn));
/*
......@@ -1233,7 +1233,7 @@ prototype_redo_exec_hook(REDO_DROP_TABLE)
}
if (cmp_translog_addr(share->state.create_rename_lsn, rec->lsn) >= 0)
{
tprint(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
tprint(tracef, ", has create_rename_lsn " LSN_FMT " more recent than"
" record, ignoring removal",
LSN_IN_PARTS(share->state.create_rename_lsn));
error= 0;
......@@ -1403,8 +1403,8 @@ static int new_table(uint16 sid, const char *name, LSN lsn_of_file_id)
}
if (cmp_translog_addr(lsn_of_file_id, share->state.create_rename_lsn) <= 0)
{
tprint(tracef, ", has create_rename_lsn (%lu,0x%lx) more recent than"
" LOGREC_FILE_ID's LSN (%lu,0x%lx), ignoring open request",
tprint(tracef, ", has create_rename_lsn " LSN_FMT " more recent than"
" LOGREC_FILE_ID's LSN " LSN_FMT ", ignoring open request",
LSN_IN_PARTS(share->state.create_rename_lsn),
LSN_IN_PARTS(lsn_of_file_id));
recovery_warnings++;
......@@ -1873,7 +1873,7 @@ prototype_redo_exec_hook(UNDO_ROW_INSERT)
share= info->s;
if (cmp_translog_addr(rec->lsn, share->state.is_of_horizon) >= 0)
{
tprint(tracef, " state has LSN (%lu,0x%lx) older than record, updating"
tprint(tracef, " state has LSN " LSN_FMT " older than record, updating"
" rows' count\n", LSN_IN_PARTS(share->state.is_of_horizon));
share->state.state.records++;
if (share->calc_checksum)
......@@ -2136,7 +2136,7 @@ prototype_redo_exec_hook(CLR_END)
if (info == NULL)
DBUG_RETURN(0);
share= info->s;
tprint(tracef, " CLR_END was about %s, undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " CLR_END was about %s, undo_lsn now LSN " LSN_FMT "\n",
log_desc->name, LSN_IN_PARTS(previous_undo_lsn));
enlarge_buffer(rec);
......@@ -2296,7 +2296,7 @@ prototype_undo_exec_hook(UNDO_ROW_INSERT)
info->trn= 0;
/* trn->undo_lsn is updated in an inwrite_hook when writing the CLR_END */
tprint(tracef, " rows' count %lu\n", (ulong)info->s->state.state.records);
tprint(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " undo_lsn now LSN " LSN_FMT "\n",
LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2335,7 +2335,7 @@ prototype_undo_exec_hook(UNDO_ROW_DELETE)
rec->record_length -
(LSN_STORE_SIZE + FILEID_STORE_SIZE));
info->trn= 0;
tprint(tracef, " rows' count %lu\n undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " rows' count %lu\n undo_lsn now LSN " LSN_FMT "\n",
(ulong)share->state.state.records, LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2374,7 +2374,7 @@ prototype_undo_exec_hook(UNDO_ROW_UPDATE)
rec->record_length -
(LSN_STORE_SIZE + FILEID_STORE_SIZE));
info->trn= 0;
tprint(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " undo_lsn now LSN " LSN_FMT "\n",
LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2415,7 +2415,7 @@ prototype_undo_exec_hook(UNDO_KEY_INSERT)
FILEID_STORE_SIZE);
info->trn= 0;
/* trn->undo_lsn is updated in an inwrite_hook when writing the CLR_END */
tprint(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " undo_lsn now LSN " LSN_FMT "\n",
LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2456,7 +2456,7 @@ prototype_undo_exec_hook(UNDO_KEY_DELETE)
FILEID_STORE_SIZE, FALSE);
info->trn= 0;
/* trn->undo_lsn is updated in an inwrite_hook when writing the CLR_END */
tprint(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " undo_lsn now LSN " LSN_FMT "\n",
LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2497,7 +2497,7 @@ prototype_undo_exec_hook(UNDO_KEY_DELETE_WITH_ROOT)
FILEID_STORE_SIZE, TRUE);
info->trn= 0;
/* trn->undo_lsn is updated in an inwrite_hook when writing the CLR_END */
tprint(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " undo_lsn now LSN " LSN_FMT "\n",
LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2525,7 +2525,7 @@ prototype_undo_exec_hook(UNDO_BULK_INSERT)
error= _ma_apply_undo_bulk_insert(info, previous_undo_lsn);
info->trn= 0;
/* trn->undo_lsn is updated in an inwrite_hook when writing the CLR_END */
tprint(tracef, " undo_lsn now LSN (%lu,0x%lx)\n",
tprint(tracef, " undo_lsn now LSN " LSN_FMT "\n",
LSN_IN_PARTS(trn->undo_lsn));
return error;
}
......@@ -2663,7 +2663,7 @@ static int run_redo_phase(LSN lsn, LSN lsn_end, enum maria_apply_log_way apply)
if (lsn_end != LSN_IMPOSSIBLE && rec2.lsn >= lsn_end)
{
tprint(tracef,
"lsn_end reached at (%lu,0x%lx). "
"lsn_end reached at " LSN_FMT ". "
"Skipping rest of redo entries",
LSN_IN_PARTS(rec2.lsn));
translog_destroy_scanner(&scanner);
......@@ -2818,7 +2818,7 @@ static uint end_of_redo_phase(my_bool prepare_for_undo_phase)
TRN *trn;
if (gslsn != LSN_IMPOSSIBLE)
{
tprint(tracef, "Group at LSN (%lu,0x%lx) short_trid %u incomplete\n",
tprint(tracef, "Group at LSN " LSN_FMT " short_trid %u incomplete\n",
LSN_IN_PARTS(gslsn), sid);
all_active_trans[sid].group_start_lsn= LSN_IMPOSSIBLE;
}
......@@ -3109,7 +3109,7 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
table was).
*/
DBUG_ASSERT(cmp_translog_addr(rec->lsn, checkpoint_start) < 0);
tprint(tracef, ", table's LOGREC_FILE_ID has LSN (%lu,0x%lx) more recent"
tprint(tracef, ", table's LOGREC_FILE_ID has LSN " LSN_FMT " more recent"
" than record, skipping record",
LSN_IN_PARTS(share->lsn_of_file_id));
return NULL;
......@@ -3117,7 +3117,7 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
if (cmp_translog_addr(rec->lsn, share->state.skip_redo_lsn) <= 0)
{
/* probably a bulk insert repair */
tprint(tracef, ", has skip_redo_lsn (%lu,0x%lx) more recent than"
tprint(tracef, ", has skip_redo_lsn " LSN_FMT " more recent than"
" record, skipping record\n",
LSN_IN_PARTS(share->state.skip_redo_lsn));
return NULL;
......@@ -3176,7 +3176,7 @@ static MARIA_HA *get_MARIA_HA_from_UNDO_record(const
if (cmp_translog_addr(rec->lsn, share->lsn_of_file_id) <= 0)
{
tprint(tracef, ", table's LOGREC_FILE_ID has LSN (%lu,0x%lx) more recent"
tprint(tracef, ", table's LOGREC_FILE_ID has LSN " LSN_FMT " more recent"
" than record, skipping record",
LSN_IN_PARTS(share->lsn_of_file_id));
return NULL;
......@@ -3185,7 +3185,7 @@ static MARIA_HA *get_MARIA_HA_from_UNDO_record(const
cmp_translog_addr(rec->lsn, share->state.skip_redo_lsn) <= 0)
{
/* probably a bulk insert repair */
tprint(tracef, ", has skip_redo_lsn (%lu,0x%lx) more recent than"
tprint(tracef, ", has skip_redo_lsn " LSN_FMT " more recent than"
" record, skipping record\n",
LSN_IN_PARTS(share->state.skip_redo_lsn));
return NULL;
......@@ -3220,12 +3220,12 @@ static LSN parse_checkpoint_record(LSN lsn)
LSN minimum_rec_lsn_of_active_transactions, minimum_rec_lsn_of_dirty_pages;
struct st_dirty_page *next_dirty_page_in_pool;
tprint(tracef, "Loading data from checkpoint record at LSN (%lu,0x%lx)\n",
tprint(tracef, "Loading data from checkpoint record at LSN " LSN_FMT "\n",
LSN_IN_PARTS(lsn));
if ((len= translog_read_record_header(lsn, &rec)) == RECHEADER_READ_ERROR ||
rec.type != LOGREC_CHECKPOINT)
{
eprint(tracef, "Cannot find checkpoint record at LSN (%lu,0x%lx)",
eprint(tracef, "Cannot find checkpoint record at LSN " LSN_FMT "",
LSN_IN_PARTS(lsn));
return LSN_ERROR;
}
......@@ -3243,7 +3243,7 @@ static LSN parse_checkpoint_record(LSN lsn)
ptr= log_record_buffer.str;
start_address= lsn_korr(ptr);
ptr+= LSN_STORE_SIZE;
tprint(tracef, "Checkpoint record has start_horizon at (%lu,0x%lx)\n",
tprint(tracef, "Checkpoint record has start_horizon at " LSN_FMT "\n",
LSN_IN_PARTS(start_address));
/* transactions */
......@@ -3261,7 +3261,7 @@ static LSN parse_checkpoint_record(LSN lsn)
takes to write one or a few rows, roughly).
*/
tprint(tracef, "Checkpoint record has min_rec_lsn of active transactions"
" at (%lu,0x%lx)\n",
" at " LSN_FMT "\n",
LSN_IN_PARTS(minimum_rec_lsn_of_active_transactions));
set_if_smaller(start_address, minimum_rec_lsn_of_active_transactions);
......@@ -3349,7 +3349,7 @@ static LSN parse_checkpoint_record(LSN lsn)
page_id, rec_lsn, next_dirty_page_in_pool++))
return LSN_ERROR;
if (maria_recovery_verbose)
tprint(tracef, "%8u %8u %12lu %lu,0x%lx\n", (uint) table_id,
tprint(tracef, "%8u %8u %12lu " LSN_FMT "\n", (uint) table_id,
(uint) is_index, (ulong) page_id, LSN_IN_PARTS(rec_lsn));
set_if_smaller(minimum_rec_lsn_of_dirty_pages, rec_lsn);
}
......@@ -3372,7 +3372,7 @@ static LSN parse_checkpoint_record(LSN lsn)
start_address= checkpoint_start=
translog_next_LSN(start_address, LSN_IMPOSSIBLE);
tprint(tracef, "Checkpoint record start_horizon now adjusted to"
" LSN (%lu,0x%lx)\n", LSN_IN_PARTS(start_address));
" LSN " LSN_FMT "\n", LSN_IN_PARTS(start_address));
if (checkpoint_start == LSN_IMPOSSIBLE)
{
/*
......@@ -3383,10 +3383,10 @@ static LSN parse_checkpoint_record(LSN lsn)
}
/* now, where the REDO phase should start reading log: */
tprint(tracef, "Checkpoint has min_rec_lsn of dirty pages at"
" LSN (%lu,0x%lx)\n", LSN_IN_PARTS(minimum_rec_lsn_of_dirty_pages));
" LSN " LSN_FMT "\n", LSN_IN_PARTS(minimum_rec_lsn_of_dirty_pages));
set_if_smaller(start_address, minimum_rec_lsn_of_dirty_pages);
DBUG_PRINT("info",
("checkpoint_start: (%lu,0x%lx) start_address: (%lu,0x%lx)",
("checkpoint_start: " LSN_FMT " start_address: " LSN_FMT "",
LSN_IN_PARTS(checkpoint_start), LSN_IN_PARTS(start_address)));
return start_address;
}
......
......@@ -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