Commit 4ef632ba authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

InnoDB: Remove unreachable debug code from non-debug builds.

parent 9084d3dd
...@@ -223,13 +223,14 @@ in the free list to the frames. ...@@ -223,13 +223,14 @@ in the free list to the frames.
buf_pool_t* buf_pool = NULL; /* The buffer buf_pool of the database */ buf_pool_t* buf_pool = NULL; /* The buffer buf_pool of the database */
#ifdef UNIV_DEBUG
ulint buf_dbg_counter = 0; /* This is used to insert validation ulint buf_dbg_counter = 0; /* This is used to insert validation
operations in excution in the operations in excution in the
debug version */ debug version */
ibool buf_debug_prints = FALSE; /* If this is set TRUE, ibool buf_debug_prints = FALSE; /* If this is set TRUE,
the program prints info whenever the program prints info whenever
read-ahead or flush occurs */ read-ahead or flush occurs */
#endif /* UNIV_DEBUG */
/************************************************************************ /************************************************************************
Calculates a page checksum which is stored to the page when it is written Calculates a page checksum which is stored to the page when it is written
to a file. Note that we must be careful to calculate the same value on to a file. Note that we must be careful to calculate the same value on
...@@ -1739,10 +1740,12 @@ buf_page_create( ...@@ -1739,10 +1740,12 @@ buf_page_create(
/* If we get here, the page was not in buf_pool: init it there */ /* If we get here, the page was not in buf_pool: init it there */
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, "Creating space %lu page %lu to buffer\n", fprintf(stderr, "Creating space %lu page %lu to buffer\n",
(ulong) space, (ulong) offset); (ulong) space, (ulong) offset);
} }
#endif /* UNIV_DEBUG */
block = free_block; block = free_block;
...@@ -1893,9 +1896,11 @@ buf_page_io_complete( ...@@ -1893,9 +1896,11 @@ buf_page_io_complete(
rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ); rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ);
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fputs("Has read ", stderr); fputs("Has read ", stderr);
} }
#endif /* UNIV_DEBUG */
} else { } else {
ut_ad(io_type == BUF_IO_WRITE); ut_ad(io_type == BUF_IO_WRITE);
...@@ -1908,17 +1913,21 @@ buf_page_io_complete( ...@@ -1908,17 +1913,21 @@ buf_page_io_complete(
buf_pool->n_pages_written++; buf_pool->n_pages_written++;
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fputs("Has written ", stderr); fputs("Has written ", stderr);
} }
#endif /* UNIV_DEBUG */
} }
mutex_exit(&(buf_pool->mutex)); mutex_exit(&(buf_pool->mutex));
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, "page space %lu page no %lu\n", fprintf(stderr, "page space %lu page no %lu\n",
(ulong) block->space, (ulong) block->offset); (ulong) block->space, (ulong) block->offset);
} }
#endif /* UNIV_DEBUG */
} }
/************************************************************************* /*************************************************************************
......
...@@ -586,11 +586,13 @@ buf_flush_try_page( ...@@ -586,11 +586,13 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE); rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
} }
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Flushing page space %lu, page no %lu \n", "Flushing page space %lu, page no %lu \n",
(ulong) block->space, (ulong) block->offset); (ulong) block->space, (ulong) block->offset);
} }
#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block); buf_flush_write_block_low(block);
...@@ -674,12 +676,14 @@ buf_flush_try_page( ...@@ -674,12 +676,14 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE); rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Flushing single page space %lu, page no %lu \n", "Flushing single page space %lu, page no %lu \n",
(ulong) block->space, (ulong) block->space,
(ulong) block->offset); (ulong) block->offset);
} }
#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block); buf_flush_write_block_low(block);
...@@ -906,6 +910,7 @@ buf_flush_batch( ...@@ -906,6 +910,7 @@ buf_flush_batch(
buf_flush_buffered_writes(); buf_flush_buffered_writes();
#ifdef UNIV_DEBUG
if (buf_debug_prints && page_count > 0) { if (buf_debug_prints && page_count > 0) {
ut_a(flush_type == BUF_FLUSH_LRU ut_a(flush_type == BUF_FLUSH_LRU
|| flush_type == BUF_FLUSH_LIST); || flush_type == BUF_FLUSH_LIST);
...@@ -914,6 +919,7 @@ buf_flush_batch( ...@@ -914,6 +919,7 @@ buf_flush_batch(
: "Flushed %lu pages in flush list flush\n", : "Flushed %lu pages in flush list flush\n",
(ulong) page_count); (ulong) page_count);
} }
#endif /* UNIV_DEBUG */
if (page_count != ULINT_UNDEFINED) if (page_count != ULINT_UNDEFINED)
srv_buf_pool_flushed+= page_count; srv_buf_pool_flushed+= page_count;
......
...@@ -213,12 +213,14 @@ buf_LRU_search_and_free_block( ...@@ -213,12 +213,14 @@ buf_LRU_search_and_free_block(
ut_a(block->in_LRU_list); ut_a(block->in_LRU_list);
if (buf_flush_ready_for_replace(block)) { if (buf_flush_ready_for_replace(block)) {
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Putting space %lu page %lu to free list\n", "Putting space %lu page %lu to free list\n",
(ulong) block->space, (ulong) block->space,
(ulong) block->offset); (ulong) block->offset);
} }
#endif /* UNIV_DEBUG */
buf_LRU_block_remove_hashed_page(block); buf_LRU_block_remove_hashed_page(block);
......
...@@ -288,12 +288,14 @@ buf_read_ahead_random( ...@@ -288,12 +288,14 @@ buf_read_ahead_random(
os_aio_simulated_wake_handler_threads(); os_aio_simulated_wake_handler_threads();
#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) { if (buf_debug_prints && (count > 0)) {
fprintf(stderr, fprintf(stderr,
"Random read-ahead space %lu offset %lu pages %lu\n", "Random read-ahead space %lu offset %lu pages %lu\n",
(ulong) space, (ulong) offset, (ulong) space, (ulong) offset,
(ulong) count); (ulong) count);
} }
#endif /* UNIV_DEBUG */
++srv_read_ahead_rnd; ++srv_read_ahead_rnd;
return(count); return(count);
...@@ -575,11 +577,13 @@ buf_read_ahead_linear( ...@@ -575,11 +577,13 @@ buf_read_ahead_linear(
/* Flush pages from the end of the LRU list if necessary */ /* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin(); buf_flush_free_margin();
#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) { if (buf_debug_prints && (count > 0)) {
fprintf(stderr, fprintf(stderr,
"LINEAR read-ahead space %lu offset %lu pages %lu\n", "LINEAR read-ahead space %lu offset %lu pages %lu\n",
(ulong) space, (ulong) offset, (ulong) count); (ulong) space, (ulong) offset, (ulong) count);
} }
#endif /* UNIV_DEBUG */
++srv_read_ahead_seq; ++srv_read_ahead_seq;
return(count); return(count);
...@@ -641,11 +645,13 @@ buf_read_ibuf_merge_pages( ...@@ -641,11 +645,13 @@ buf_read_ibuf_merge_pages(
/* Flush pages from the end of the LRU list if necessary */ /* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin(); buf_flush_free_margin();
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Ibuf merge read-ahead space %lu pages %lu\n", "Ibuf merge read-ahead space %lu pages %lu\n",
(ulong) space_ids[0], (ulong) n_stored); (ulong) space_ids[0], (ulong) n_stored);
} }
#endif /* UNIV_DEBUG */
} }
/************************************************************************ /************************************************************************
...@@ -711,8 +717,10 @@ buf_read_recv_pages( ...@@ -711,8 +717,10 @@ buf_read_recv_pages(
/* Flush pages from the end of the LRU list if necessary */ /* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin(); buf_flush_free_margin();
#ifdef UNIV_DEBUG
if (buf_debug_prints) { if (buf_debug_prints) {
fprintf(stderr, fprintf(stderr,
"Recovery applies read-ahead pages %lu\n", (ulong) n_stored); "Recovery applies read-ahead pages %lu\n", (ulong) n_stored);
} }
#endif /* UNIV_DEBUG */
} }
...@@ -56,9 +56,11 @@ Created 11/5/1995 Heikki Tuuri ...@@ -56,9 +56,11 @@ Created 11/5/1995 Heikki Tuuri
#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL #define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL
extern buf_pool_t* buf_pool; /* The buffer pool of the database */ extern buf_pool_t* buf_pool; /* The buffer pool of the database */
#ifdef UNIV_DEBUG
extern ibool buf_debug_prints;/* If this is set TRUE, the program extern ibool buf_debug_prints;/* If this is set TRUE, the program
prints info whenever read or flush prints info whenever read or flush
occurs */ occurs */
#endif /* UNIV_DEBUG */
extern ulint srv_buf_pool_write_requests; /* variable to count write request extern ulint srv_buf_pool_write_requests; /* variable to count write request
issued */ issued */
......
...@@ -11,10 +11,11 @@ Created 11/5/1995 Heikki Tuuri ...@@ -11,10 +11,11 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0rea.h" #include "buf0rea.h"
#include "mtr0mtr.h" #include "mtr0mtr.h"
#ifdef UNIV_DEBUG
extern ulint buf_dbg_counter; /* This is used to insert validation extern ulint buf_dbg_counter; /* This is used to insert validation
operations in execution in the operations in execution in the
debug version */ debug version */
#endif /* UNIV_DEBUG */
/************************************************************************ /************************************************************************
Recommends a move of a block to the start of the LRU list if there is danger Recommends a move of a block to the start of the LRU list if there is danger
of dropping from the buffer pool. NOTE: does not reserve the buffer pool of dropping from the buffer pool. NOTE: does not reserve the buffer pool
......
...@@ -17,8 +17,12 @@ Created 12/9/1995 Heikki Tuuri ...@@ -17,8 +17,12 @@ Created 12/9/1995 Heikki Tuuri
typedef struct log_struct log_t; typedef struct log_struct log_t;
typedef struct log_group_struct log_group_t; typedef struct log_group_struct log_group_t;
#ifdef UNIV_DEBUG
extern ibool log_do_write; extern ibool log_do_write;
extern ibool log_debug_writes; extern ibool log_debug_writes;
#else /* UNIV_DEBUG */
# define log_do_write TRUE
#endif /* UNIV_DEBUG */
/* Wait modes for log_write_up_to */ /* Wait modes for log_write_up_to */
#define LOG_NO_WAIT 91 #define LOG_NO_WAIT 91
......
...@@ -57,10 +57,11 @@ ulint log_fsp_current_free_limit = 0; ...@@ -57,10 +57,11 @@ ulint log_fsp_current_free_limit = 0;
/* Global log system variable */ /* Global log system variable */
log_t* log_sys = NULL; log_t* log_sys = NULL;
#ifdef UNIV_DEBUG
ibool log_do_write = TRUE; ibool log_do_write = TRUE;
ibool log_debug_writes = FALSE; ibool log_debug_writes = FALSE;
#endif /* UNIV_DEBUG */
/* These control how often we print warnings if the last checkpoint is too /* These control how often we print warnings if the last checkpoint is too
old */ old */
...@@ -974,22 +975,24 @@ log_group_check_flush_completion( ...@@ -974,22 +975,24 @@ log_group_check_flush_completion(
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
if (!log_sys->one_flushed && group->n_pending_writes == 0) { if (!log_sys->one_flushed && group->n_pending_writes == 0) {
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Log flushed first to group %lu\n", (ulong) group->id); "Log flushed first to group %lu\n", (ulong) group->id);
} }
#endif /* UNIV_DEBUG */
log_sys->written_to_some_lsn = log_sys->write_lsn; log_sys->written_to_some_lsn = log_sys->write_lsn;
log_sys->one_flushed = TRUE; log_sys->one_flushed = TRUE;
return(LOG_UNLOCK_NONE_FLUSHED_LOCK); return(LOG_UNLOCK_NONE_FLUSHED_LOCK);
} }
#ifdef UNIV_DEBUG
if (log_debug_writes && (group->n_pending_writes == 0)) { if (log_debug_writes && (group->n_pending_writes == 0)) {
fprintf(stderr, "Log flushed to group %lu\n", (ulong) group->id); fprintf(stderr, "Log flushed to group %lu\n", (ulong) group->id);
} }
#endif /* UNIV_DEBUG */
return(0); return(0);
} }
...@@ -1066,12 +1069,13 @@ log_io_complete( ...@@ -1066,12 +1069,13 @@ log_io_complete(
fil_flush(group->space_id); fil_flush(group->space_id);
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Checkpoint info written to group %lu\n", "Checkpoint info written to group %lu\n",
group->id); group->id);
} }
#endif /* UNIV_DEBUG */
log_io_complete_checkpoint(); log_io_complete_checkpoint();
return; return;
...@@ -1133,12 +1137,13 @@ log_group_file_header_flush( ...@@ -1133,12 +1137,13 @@ log_group_file_header_flush(
dest_offset = nth_file * group->file_size; dest_offset = nth_file * group->file_size;
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Writing log file header to group %lu file %lu\n", "Writing log file header to group %lu file %lu\n",
(ulong) group->id, (ulong) nth_file); (ulong) group->id, (ulong) nth_file);
} }
#endif /* UNIV_DEBUG */
if (log_do_write) { if (log_do_write) {
log_sys->n_log_ios++; log_sys->n_log_ios++;
...@@ -1226,7 +1231,8 @@ log_group_write_buf( ...@@ -1226,7 +1231,8 @@ log_group_write_buf(
} else { } else {
write_len = len; write_len = len;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
...@@ -1250,7 +1256,7 @@ log_group_write_buf( ...@@ -1250,7 +1256,7 @@ log_group_write_buf(
+ i * OS_FILE_LOG_BLOCK_SIZE)); + i * OS_FILE_LOG_BLOCK_SIZE));
} }
} }
#endif /* UNIV_DEBUG */
/* Calculate the checksums for each log block and write them to /* Calculate the checksums for each log block and write them to
the trailer fields of the log blocks */ the trailer fields of the log blocks */
...@@ -1384,6 +1390,7 @@ log_write_up_to( ...@@ -1384,6 +1390,7 @@ log_write_up_to(
return; return;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Writing log from %lu %lu up to lsn %lu %lu\n", "Writing log from %lu %lu up to lsn %lu %lu\n",
...@@ -1392,7 +1399,7 @@ log_write_up_to( ...@@ -1392,7 +1399,7 @@ log_write_up_to(
(ulong) ut_dulint_get_high(log_sys->lsn), (ulong) ut_dulint_get_high(log_sys->lsn),
(ulong) ut_dulint_get_low(log_sys->lsn)); (ulong) ut_dulint_get_low(log_sys->lsn));
} }
#endif /* UNIV_DEBUG */
log_sys->n_pending_writes++; log_sys->n_pending_writes++;
group = UT_LIST_GET_FIRST(log_sys->log_groups); group = UT_LIST_GET_FIRST(log_sys->log_groups);
...@@ -1961,12 +1968,14 @@ log_checkpoint( ...@@ -1961,12 +1968,14 @@ log_checkpoint(
log_sys->next_checkpoint_lsn = oldest_lsn; log_sys->next_checkpoint_lsn = oldest_lsn;
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, "Making checkpoint no %lu at lsn %lu %lu\n", fprintf(stderr, "Making checkpoint no %lu at lsn %lu %lu\n",
(ulong) ut_dulint_get_low(log_sys->next_checkpoint_no), (ulong) ut_dulint_get_low(log_sys->next_checkpoint_no),
(ulong) ut_dulint_get_high(oldest_lsn), (ulong) ut_dulint_get_high(oldest_lsn),
(ulong) ut_dulint_get_low(oldest_lsn)); (ulong) ut_dulint_get_low(oldest_lsn));
} }
#endif /* UNIV_DEBUG */
log_groups_write_checkpoint_info(); log_groups_write_checkpoint_info();
...@@ -2347,9 +2356,11 @@ log_group_archive( ...@@ -2347,9 +2356,11 @@ log_group_archive(
exit(1); exit(1);
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, "Created archive file %s\n", name); fprintf(stderr, "Created archive file %s\n", name);
} }
#endif /* UNIV_DEBUG */
ret = os_file_close(file_handle); ret = os_file_close(file_handle);
...@@ -2375,7 +2386,8 @@ log_group_archive( ...@@ -2375,7 +2386,8 @@ log_group_archive(
len = group->file_size - (next_offset % group->file_size); len = group->file_size - (next_offset % group->file_size);
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Archiving starting at lsn %lu %lu, len %lu to group %lu\n", "Archiving starting at lsn %lu %lu, len %lu to group %lu\n",
...@@ -2383,6 +2395,7 @@ log_group_archive( ...@@ -2383,6 +2395,7 @@ log_group_archive(
(ulong) ut_dulint_get_low(start_lsn), (ulong) ut_dulint_get_low(start_lsn),
(ulong) len, (ulong) group->id); (ulong) len, (ulong) group->id);
} }
#endif /* UNIV_DEBUG */
log_sys->n_pending_archive_ios++; log_sys->n_pending_archive_ios++;
...@@ -2473,11 +2486,13 @@ log_archive_write_complete_groups(void) ...@@ -2473,11 +2486,13 @@ log_archive_write_complete_groups(void)
trunc_files = n_files - 1; trunc_files = n_files - 1;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes && trunc_files) { if (log_debug_writes && trunc_files) {
fprintf(stderr, fprintf(stderr,
"Complete file(s) archived to group %lu\n", "Complete file(s) archived to group %lu\n",
(ulong) group->id); (ulong) group->id);
} }
#endif /* UNIV_DEBUG */
/* Calculate the archive file space start lsn */ /* Calculate the archive file space start lsn */
start_lsn = ut_dulint_subtract(log_sys->next_archived_lsn, start_lsn = ut_dulint_subtract(log_sys->next_archived_lsn,
...@@ -2500,9 +2515,11 @@ log_archive_write_complete_groups(void) ...@@ -2500,9 +2515,11 @@ log_archive_write_complete_groups(void)
fil_space_truncate_start(group->archive_space_id, fil_space_truncate_start(group->archive_space_id,
trunc_files * group->file_size); trunc_files * group->file_size);
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fputs("Archiving writes completed\n", stderr); fputs("Archiving writes completed\n", stderr);
} }
#endif /* UNIV_DEBUG */
} }
/********************************************************** /**********************************************************
...@@ -2519,9 +2536,11 @@ log_archive_check_completion_low(void) ...@@ -2519,9 +2536,11 @@ log_archive_check_completion_low(void)
if (log_sys->n_pending_archive_ios == 0 if (log_sys->n_pending_archive_ios == 0
&& log_sys->archiving_phase == LOG_ARCHIVE_READ) { && log_sys->archiving_phase == LOG_ARCHIVE_READ) {
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fputs("Archiving read completed\n", stderr); fputs("Archiving read completed\n", stderr);
} }
#endif /* UNIV_DEBUG */
/* Archive buffer has now been read in: start archive writes */ /* Archive buffer has now been read in: start archive writes */
...@@ -2665,6 +2684,7 @@ log_archive_do( ...@@ -2665,6 +2684,7 @@ log_archive_do(
log_sys->next_archived_lsn = limit_lsn; log_sys->next_archived_lsn = limit_lsn;
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Archiving from lsn %lu %lu to lsn %lu %lu\n", "Archiving from lsn %lu %lu to lsn %lu %lu\n",
...@@ -2673,6 +2693,7 @@ log_archive_do( ...@@ -2673,6 +2693,7 @@ log_archive_do(
(ulong) ut_dulint_get_high(limit_lsn), (ulong) ut_dulint_get_high(limit_lsn),
(ulong) ut_dulint_get_low(limit_lsn)); (ulong) ut_dulint_get_low(limit_lsn));
} }
#endif /* UNIV_DEBUG */
/* Read the log segment to the archive buffer */ /* Read the log segment to the archive buffer */
...@@ -2775,12 +2796,14 @@ log_archive_close_groups( ...@@ -2775,12 +2796,14 @@ log_archive_close_groups(
group->archived_file_no += 2; group->archived_file_no += 2;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"Incrementing arch file no to %lu in log group %lu\n", "Incrementing arch file no to %lu in log group %lu\n",
(ulong) group->archived_file_no + 2, (ulong) group->archived_file_no + 2,
(ulong) group->id); (ulong) group->id);
} }
#endif /* UNIV_DEBUG */
} }
} }
......
...@@ -489,6 +489,7 @@ recv_find_max_checkpoint( ...@@ -489,6 +489,7 @@ recv_find_max_checkpoint(
log_group_read_checkpoint_info(group, field); log_group_read_checkpoint_info(group, field);
if (!recv_check_cp_is_consistent(buf)) { if (!recv_check_cp_is_consistent(buf)) {
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Checkpoint in group %lu at %lu invalid, %lu\n", "InnoDB: Checkpoint in group %lu at %lu invalid, %lu\n",
...@@ -498,7 +499,7 @@ recv_find_max_checkpoint( ...@@ -498,7 +499,7 @@ recv_find_max_checkpoint(
+ LOG_CHECKPOINT_CHECKSUM_1)); + LOG_CHECKPOINT_CHECKSUM_1));
} }
#endif /* UNIV_DEBUG */
goto not_consistent; goto not_consistent;
} }
...@@ -511,13 +512,15 @@ recv_find_max_checkpoint( ...@@ -511,13 +512,15 @@ recv_find_max_checkpoint(
checkpoint_no = checkpoint_no =
mach_read_from_8(buf + LOG_CHECKPOINT_NO); mach_read_from_8(buf + LOG_CHECKPOINT_NO);
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Checkpoint number %lu found in group %lu\n", "InnoDB: Checkpoint number %lu found in group %lu\n",
(ulong) ut_dulint_get_low(checkpoint_no), (ulong) ut_dulint_get_low(checkpoint_no),
(ulong) group->id); (ulong) group->id);
} }
#endif /* UNIV_DEBUG */
if (ut_dulint_cmp(checkpoint_no, max_no) >= 0) { if (ut_dulint_cmp(checkpoint_no, max_no) >= 0) {
*max_group = group; *max_group = group;
*max_field = field; *max_field = field;
...@@ -1198,6 +1201,7 @@ recv_recover_page( ...@@ -1198,6 +1201,7 @@ recv_recover_page(
start_lsn = recv->start_lsn; start_lsn = recv->start_lsn;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Applying log rec type %lu len %lu to space %lu page no %lu\n", "InnoDB: Applying log rec type %lu len %lu to space %lu page no %lu\n",
...@@ -1205,6 +1209,7 @@ recv_recover_page( ...@@ -1205,6 +1209,7 @@ recv_recover_page(
(ulong) recv_addr->space, (ulong) recv_addr->space,
(ulong) recv_addr->page_no); (ulong) recv_addr->page_no);
} }
#endif /* UNIV_DEBUG */
recv_parse_or_apply_log_rec_body(recv->type, buf, recv_parse_or_apply_log_rec_body(recv->type, buf,
buf + recv->len, page, &mtr); buf + recv->len, page, &mtr);
...@@ -2025,12 +2030,14 @@ recv_parse_log_recs( ...@@ -2025,12 +2030,14 @@ recv_parse_log_recs(
recv_sys->recovered_offset += len; recv_sys->recovered_offset += len;
recv_sys->recovered_lsn = new_recovered_lsn; recv_sys->recovered_lsn = new_recovered_lsn;
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Parsed a single log rec type %lu len %lu space %lu page no %lu\n", "InnoDB: Parsed a single log rec type %lu len %lu space %lu page no %lu\n",
(ulong) type, (ulong) len, (ulong) space, (ulong) type, (ulong) len, (ulong) space,
(ulong) page_no); (ulong) page_no);
} }
#endif /* UNIV_DEBUG */
if (type == MLOG_DUMMY_RECORD) { if (type == MLOG_DUMMY_RECORD) {
/* Do nothing */ /* Do nothing */
...@@ -2113,13 +2120,15 @@ recv_parse_log_recs( ...@@ -2113,13 +2120,15 @@ recv_parse_log_recs(
body, ptr + len); body, ptr + len);
#endif /* UNIV_LOG_REPLICATE */ #endif /* UNIV_LOG_REPLICATE */
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Parsed a multi log rec type %lu len %lu space %lu page no %lu\n", "InnoDB: Parsed a multi log rec type %lu len %lu space %lu page no %lu\n",
(ulong) type, (ulong) len, (ulong) space, (ulong) type, (ulong) len, (ulong) space,
(ulong) page_no); (ulong) page_no);
} }
#endif /* UNIV_DEBUG */
total_len += len; total_len += len;
n_recs++; n_recs++;
...@@ -2526,6 +2535,7 @@ recv_group_scan_log_recs( ...@@ -2526,6 +2535,7 @@ recv_group_scan_log_recs(
start_lsn = end_lsn; start_lsn = end_lsn;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Scanned group %lu up to log sequence number %lu %lu\n", "InnoDB: Scanned group %lu up to log sequence number %lu %lu\n",
...@@ -2533,6 +2543,7 @@ recv_group_scan_log_recs( ...@@ -2533,6 +2543,7 @@ recv_group_scan_log_recs(
(ulong) ut_dulint_get_high(*group_scanned_lsn), (ulong) ut_dulint_get_high(*group_scanned_lsn),
(ulong) ut_dulint_get_low(*group_scanned_lsn)); (ulong) ut_dulint_get_low(*group_scanned_lsn));
} }
#endif /* UNIV_DEBUG */
} }
/************************************************************ /************************************************************
...@@ -2918,10 +2929,12 @@ recv_recovery_from_checkpoint_finish(void) ...@@ -2918,10 +2929,12 @@ recv_recovery_from_checkpoint_finish(void)
recv_apply_hashed_log_recs(TRUE); recv_apply_hashed_log_recs(TRUE);
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Log records applied to the database\n"); "InnoDB: Log records applied to the database\n");
} }
#endif /* UNIV_DEBUG */
if (recv_needed_recovery) { if (recv_needed_recovery) {
trx_sys_print_mysql_master_log_pos(); trx_sys_print_mysql_master_log_pos();
...@@ -3258,6 +3271,7 @@ log_group_recover_from_archive_file( ...@@ -3258,6 +3271,7 @@ log_group_recover_from_archive_file(
break; break;
} }
#ifdef UNIV_DEBUG
if (log_debug_writes) { if (log_debug_writes) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Archive read starting at lsn %lu %lu, len %lu from file %s\n", "InnoDB: Archive read starting at lsn %lu %lu, len %lu from file %s\n",
...@@ -3265,6 +3279,7 @@ log_group_recover_from_archive_file( ...@@ -3265,6 +3279,7 @@ log_group_recover_from_archive_file(
(ulong) ut_dulint_get_low(start_lsn), (ulong) ut_dulint_get_low(start_lsn),
(ulong) len, name); (ulong) len, name);
} }
#endif /* UNIV_DEBUG */
fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE,
group->archive_space_id, read_offset / UNIV_PAGE_SIZE, group->archive_space_id, read_offset / UNIV_PAGE_SIZE,
......
...@@ -1040,7 +1040,9 @@ innobase_start_or_create_for_mysql(void) ...@@ -1040,7 +1040,9 @@ innobase_start_or_create_for_mysql(void)
srv_start_has_been_called = TRUE; srv_start_has_been_called = TRUE;
#ifdef UNIV_DEBUG
log_do_write = TRUE; log_do_write = TRUE;
#endif /* UNIV_DEBUG */
/* yydebug = TRUE; */ /* yydebug = TRUE; */
srv_is_being_started = TRUE; srv_is_being_started = TRUE;
...@@ -1554,8 +1556,9 @@ NetWare. */ ...@@ -1554,8 +1556,9 @@ NetWare. */
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 + os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
SRV_MAX_N_IO_THREADS); SRV_MAX_N_IO_THREADS);
#ifdef UNIV_DEBUG
/* buf_debug_prints = TRUE; */ /* buf_debug_prints = TRUE; */
#endif /* UNIV_DEBUG */
sum_of_data_file_sizes = 0; sum_of_data_file_sizes = 0;
for (i = 0; i < srv_n_data_files; i++) { for (i = 0; i < srv_n_data_files; i++) {
......
...@@ -1136,8 +1136,12 @@ sync_thread_add_level( ...@@ -1136,8 +1136,12 @@ sync_thread_add_level(
} else if (level == SYNC_DICT_HEADER) { } else if (level == SYNC_DICT_HEADER) {
ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER)); ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER));
} else if (level == SYNC_DICT) { } else if (level == SYNC_DICT) {
#ifdef UNIV_DEBUG
ut_a(buf_debug_prints ut_a(buf_debug_prints
|| sync_thread_levels_g(array, SYNC_DICT)); || sync_thread_levels_g(array, SYNC_DICT));
#else /* UNIV_DEBUG */
ut_a(sync_thread_levels_g(array, SYNC_DICT));
#endif /* UNIV_DEBUG */
} else { } else {
ut_error; ut_error;
} }
......
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