Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1876 05/06/15 12:50:27 marko@stripped +11 -0
InnoDB: Remove unreachable debug code from non-debug builds.
innobase/sync/sync0sync.c
1.35 05/06/15 12:50:19 marko@stripped +4 -0
Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/srv/srv0start.c
1.81 05/06/15 12:50:19 marko@stripped +4 -1
Remove log_do_write and buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/log/log0recv.c
1.48 05/06/15 12:50:19 marko@stripped +18 -3
Remove log_debug_writes unless #ifdef UNIV_DEBUG
innobase/log/log0log.c
1.43 05/06/15 12:50:18 marko@stripped +32 -9
Remove log_do_write and log_debug_writes unless #ifdef UNIV_DEBUG
innobase/include/log0log.h
1.16 05/06/15 12:50:18 marko@stripped +4 -0
Remove log_do_write and log_debug_writes unless #ifdef UNIV_DEBUG
innobase/include/buf0buf.ic
1.20 05/06/15 12:50:18 marko@stripped +2 -1
Remove buf_dbg_counter unless #ifdef UNIV_DEBUG
innobase/include/buf0buf.h
1.31 05/06/15 12:50:18 marko@stripped +2 -0
Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0rea.c
1.18 05/06/15 12:50:18 marko@stripped +8 -0
Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0lru.c
1.26 05/06/15 12:50:18 marko@stripped +2 -0
Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0flu.c
1.29 05/06/15 12:50:18 marko@stripped +6 -0
Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0buf.c
1.48 05/06/15 12:50:18 marko@stripped +10 -1
Remove buf_dbg_counter unless #ifdef UNIV_DEBUG
Remove buf_debug_prints unless #ifdef UNIV_DEBUG
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: marko
# Host: hundin.mysql.fi
# Root: /home/marko/mysql-5.0
--- 1.47/innobase/buf/buf0buf.c Mon Jun 13 11:39:23 2005
+++ 1.48/innobase/buf/buf0buf.c Wed Jun 15 12:50:18 2005
@@ -223,13 +223,14 @@
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
operations in excution in the
debug version */
ibool buf_debug_prints = FALSE; /* If this is set TRUE,
the program prints info whenever
read-ahead or flush occurs */
-
+#endif /* UNIV_DEBUG */
/************************************************************************
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
@@ -1739,10 +1740,12 @@
/* If we get here, the page was not in buf_pool: init it there */
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr, "Creating space %lu page %lu to buffer\n",
(ulong) space, (ulong) offset);
}
+#endif /* UNIV_DEBUG */
block = free_block;
@@ -1893,9 +1896,11 @@
rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ);
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fputs("Has read ", stderr);
}
+#endif /* UNIV_DEBUG */
} else {
ut_ad(io_type == BUF_IO_WRITE);
@@ -1908,17 +1913,21 @@
buf_pool->n_pages_written++;
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fputs("Has written ", stderr);
}
+#endif /* UNIV_DEBUG */
}
mutex_exit(&(buf_pool->mutex));
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr, "page space %lu page no %lu\n",
(ulong) block->space, (ulong) block->offset);
}
+#endif /* UNIV_DEBUG */
}
/*************************************************************************
--- 1.28/innobase/buf/buf0flu.c Tue Mar 15 11:22:11 2005
+++ 1.29/innobase/buf/buf0flu.c Wed Jun 15 12:50:18 2005
@@ -586,11 +586,13 @@
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
}
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing page space %lu, page no %lu \n",
(ulong) block->space, (ulong) block->offset);
}
+#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
@@ -674,12 +676,14 @@
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing single page space %lu, page no %lu \n",
(ulong) block->space,
(ulong) block->offset);
}
+#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
@@ -906,6 +910,7 @@
buf_flush_buffered_writes();
+#ifdef UNIV_DEBUG
if (buf_debug_prints && page_count > 0) {
ut_a(flush_type == BUF_FLUSH_LRU
|| flush_type == BUF_FLUSH_LIST);
@@ -914,6 +919,7 @@
: "Flushed %lu pages in flush list flush\n",
(ulong) page_count);
}
+#endif /* UNIV_DEBUG */
if (page_count != ULINT_UNDEFINED)
srv_buf_pool_flushed+= page_count;
--- 1.25/innobase/buf/buf0lru.c Mon Jun 13 11:39:23 2005
+++ 1.26/innobase/buf/buf0lru.c Wed Jun 15 12:50:18 2005
@@ -213,12 +213,14 @@
ut_a(block->in_LRU_list);
if (buf_flush_ready_for_replace(block)) {
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Putting space %lu page %lu to free list\n",
(ulong) block->space,
(ulong) block->offset);
}
+#endif /* UNIV_DEBUG */
buf_LRU_block_remove_hashed_page(block);
--- 1.17/innobase/buf/buf0rea.c Wed Feb 2 22:50:28 2005
+++ 1.18/innobase/buf/buf0rea.c Wed Jun 15 12:50:18 2005
@@ -288,12 +288,14 @@
os_aio_simulated_wake_handler_threads();
+#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
fprintf(stderr,
"Random read-ahead space %lu offset %lu pages %lu\n",
(ulong) space, (ulong) offset,
(ulong) count);
}
+#endif /* UNIV_DEBUG */
++srv_read_ahead_rnd;
return(count);
@@ -575,11 +577,13 @@
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
+#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
fprintf(stderr,
"LINEAR read-ahead space %lu offset %lu pages %lu\n",
(ulong) space, (ulong) offset, (ulong) count);
}
+#endif /* UNIV_DEBUG */
++srv_read_ahead_seq;
return(count);
@@ -641,11 +645,13 @@
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Ibuf merge read-ahead space %lu pages %lu\n",
(ulong) space_ids[0], (ulong) n_stored);
}
+#endif /* UNIV_DEBUG */
}
/************************************************************************
@@ -711,8 +717,10 @@
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Recovery applies read-ahead pages %lu\n", (ulong) n_stored);
}
+#endif /* UNIV_DEBUG */
}
--- 1.30/innobase/include/buf0buf.h Mon Jun 13 11:39:23 2005
+++ 1.31/innobase/include/buf0buf.h Wed Jun 15 12:50:18 2005
@@ -56,9 +56,11 @@
#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL
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
prints info whenever read or flush
occurs */
+#endif /* UNIV_DEBUG */
extern ulint srv_buf_pool_write_requests; /* variable to count write request
issued */
--- 1.19/innobase/include/buf0buf.ic Mon Apr 25 10:14:25 2005
+++ 1.20/innobase/include/buf0buf.ic Wed Jun 15 12:50:18 2005
@@ -11,10 +11,11 @@
#include "buf0rea.h"
#include "mtr0mtr.h"
+#ifdef UNIV_DEBUG
extern ulint buf_dbg_counter; /* This is used to insert validation
operations in execution in the
debug version */
-
+#endif /* UNIV_DEBUG */
/************************************************************************
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
--- 1.15/innobase/include/log0log.h Fri Jun 18 04:23:12 2004
+++ 1.16/innobase/include/log0log.h Wed Jun 15 12:50:18 2005
@@ -17,8 +17,12 @@
typedef struct log_struct log_t;
typedef struct log_group_struct log_group_t;
+#ifdef UNIV_DEBUG
extern ibool log_do_write;
extern ibool log_debug_writes;
+#else /* UNIV_DEBUG */
+# define log_do_write TRUE
+#endif /* UNIV_DEBUG */
/* Wait modes for log_write_up_to */
#define LOG_NO_WAIT 91
--- 1.42/innobase/log/log0log.c Fri Apr 15 19:00:27 2005
+++ 1.43/innobase/log/log0log.c Wed Jun 15 12:50:18 2005
@@ -57,10 +57,11 @@
/* Global log system variable */
log_t* log_sys = NULL;
+#ifdef UNIV_DEBUG
ibool log_do_write = TRUE;
ibool log_debug_writes = FALSE;
-
+#endif /* UNIV_DEBUG */
/* These control how often we print warnings if the last checkpoint is too
old */
@@ -974,22 +975,24 @@
#endif /* UNIV_SYNC_DEBUG */
if (!log_sys->one_flushed && group->n_pending_writes == 0) {
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"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->one_flushed = TRUE;
return(LOG_UNLOCK_NONE_FLUSHED_LOCK);
}
+#ifdef UNIV_DEBUG
if (log_debug_writes && (group->n_pending_writes == 0)) {
fprintf(stderr, "Log flushed to group %lu\n", (ulong) group->id);
}
-
+#endif /* UNIV_DEBUG */
return(0);
}
@@ -1066,12 +1069,13 @@
fil_flush(group->space_id);
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"Checkpoint info written to group %lu\n",
group->id);
}
-
+#endif /* UNIV_DEBUG */
log_io_complete_checkpoint();
return;
@@ -1133,12 +1137,13 @@
dest_offset = nth_file * group->file_size;
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"Writing log file header to group %lu file %lu\n",
(ulong) group->id, (ulong) nth_file);
}
-
+#endif /* UNIV_DEBUG */
if (log_do_write) {
log_sys->n_log_ios++;
@@ -1226,7 +1231,8 @@
} else {
write_len = len;
}
-
+
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
@@ -1250,7 +1256,7 @@
+ i * OS_FILE_LOG_BLOCK_SIZE));
}
}
-
+#endif /* UNIV_DEBUG */
/* Calculate the checksums for each log block and write them to
the trailer fields of the log blocks */
@@ -1384,6 +1390,7 @@
return;
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"Writing log from %lu %lu up to lsn %lu %lu\n",
@@ -1392,7 +1399,7 @@
(ulong) ut_dulint_get_high(log_sys->lsn),
(ulong) ut_dulint_get_low(log_sys->lsn));
}
-
+#endif /* UNIV_DEBUG */
log_sys->n_pending_writes++;
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -1961,12 +1968,14 @@
log_sys->next_checkpoint_lsn = oldest_lsn;
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
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_high(oldest_lsn),
(ulong) ut_dulint_get_low(oldest_lsn));
}
+#endif /* UNIV_DEBUG */
log_groups_write_checkpoint_info();
@@ -2347,9 +2356,11 @@
exit(1);
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr, "Created archive file %s\n", name);
}
+#endif /* UNIV_DEBUG */
ret = os_file_close(file_handle);
@@ -2375,7 +2386,8 @@
len = group->file_size - (next_offset % group->file_size);
}
-
+
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"Archiving starting at lsn %lu %lu, len %lu to group %lu\n",
@@ -2383,6 +2395,7 @@
(ulong) ut_dulint_get_low(start_lsn),
(ulong) len, (ulong) group->id);
}
+#endif /* UNIV_DEBUG */
log_sys->n_pending_archive_ios++;
@@ -2473,11 +2486,13 @@
trunc_files = n_files - 1;
}
+#ifdef UNIV_DEBUG
if (log_debug_writes && trunc_files) {
fprintf(stderr,
"Complete file(s) archived to group %lu\n",
(ulong) group->id);
}
+#endif /* UNIV_DEBUG */
/* Calculate the archive file space start lsn */
start_lsn = ut_dulint_subtract(log_sys->next_archived_lsn,
@@ -2500,9 +2515,11 @@
fil_space_truncate_start(group->archive_space_id,
trunc_files * group->file_size);
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fputs("Archiving writes completed\n", stderr);
}
+#endif /* UNIV_DEBUG */
}
/**********************************************************
@@ -2519,9 +2536,11 @@
if (log_sys->n_pending_archive_ios == 0
&& log_sys->archiving_phase == LOG_ARCHIVE_READ) {
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fputs("Archiving read completed\n", stderr);
}
+#endif /* UNIV_DEBUG */
/* Archive buffer has now been read in: start archive writes */
@@ -2665,6 +2684,7 @@
log_sys->next_archived_lsn = limit_lsn;
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"Archiving from lsn %lu %lu to lsn %lu %lu\n",
@@ -2673,6 +2693,7 @@
(ulong) ut_dulint_get_high(limit_lsn),
(ulong) ut_dulint_get_low(limit_lsn));
}
+#endif /* UNIV_DEBUG */
/* Read the log segment to the archive buffer */
@@ -2775,12 +2796,14 @@
group->archived_file_no += 2;
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"Incrementing arch file no to %lu in log group %lu\n",
(ulong) group->archived_file_no + 2,
(ulong) group->id);
}
+#endif /* UNIV_DEBUG */
}
}
--- 1.47/innobase/log/log0recv.c Mon Apr 18 15:12:21 2005
+++ 1.48/innobase/log/log0recv.c Wed Jun 15 12:50:19 2005
@@ -489,6 +489,7 @@
log_group_read_checkpoint_info(group, field);
if (!recv_check_cp_is_consistent(buf)) {
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Checkpoint in group %lu at %lu invalid, %lu\n",
@@ -498,7 +499,7 @@
+ LOG_CHECKPOINT_CHECKSUM_1));
}
-
+#endif /* UNIV_DEBUG */
goto not_consistent;
}
@@ -511,13 +512,15 @@
checkpoint_no =
mach_read_from_8(buf + LOG_CHECKPOINT_NO);
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Checkpoint number %lu found in group %lu\n",
(ulong) ut_dulint_get_low(checkpoint_no),
(ulong) group->id);
}
-
+#endif /* UNIV_DEBUG */
+
if (ut_dulint_cmp(checkpoint_no, max_no) >= 0) {
*max_group = group;
*max_field = field;
@@ -1198,6 +1201,7 @@
start_lsn = recv->start_lsn;
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Applying log rec type %lu len %lu to space %lu page no %lu\n",
@@ -1205,6 +1209,7 @@
(ulong) recv_addr->space,
(ulong) recv_addr->page_no);
}
+#endif /* UNIV_DEBUG */
recv_parse_or_apply_log_rec_body(recv->type, buf,
buf + recv->len, page, &mtr);
@@ -2025,12 +2030,14 @@
recv_sys->recovered_offset += len;
recv_sys->recovered_lsn = new_recovered_lsn;
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Parsed a single log rec type %lu len %lu space %lu page no %lu\n",
(ulong) type, (ulong) len, (ulong) space,
(ulong) page_no);
}
+#endif /* UNIV_DEBUG */
if (type == MLOG_DUMMY_RECORD) {
/* Do nothing */
@@ -2113,13 +2120,15 @@
body, ptr + len);
#endif /* UNIV_LOG_REPLICATE */
}
-
+
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Parsed a multi log rec type %lu len %lu space %lu page no %lu\n",
(ulong) type, (ulong) len, (ulong) space,
(ulong) page_no);
}
+#endif /* UNIV_DEBUG */
total_len += len;
n_recs++;
@@ -2526,6 +2535,7 @@
start_lsn = end_lsn;
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Scanned group %lu up to log sequence number %lu %lu\n",
@@ -2533,6 +2543,7 @@
(ulong) ut_dulint_get_high(*group_scanned_lsn),
(ulong) ut_dulint_get_low(*group_scanned_lsn));
}
+#endif /* UNIV_DEBUG */
}
/************************************************************
@@ -2918,10 +2929,12 @@
recv_apply_hashed_log_recs(TRUE);
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Log records applied to the database\n");
}
+#endif /* UNIV_DEBUG */
if (recv_needed_recovery) {
trx_sys_print_mysql_master_log_pos();
@@ -3258,6 +3271,7 @@
break;
}
+#ifdef UNIV_DEBUG
if (log_debug_writes) {
fprintf(stderr,
"InnoDB: Archive read starting at lsn %lu %lu, len %lu from file %s\n",
@@ -3265,6 +3279,7 @@
(ulong) ut_dulint_get_low(start_lsn),
(ulong) len, name);
}
+#endif /* UNIV_DEBUG */
fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE,
group->archive_space_id, read_offset / UNIV_PAGE_SIZE,
--- 1.80/innobase/srv/srv0start.c Fri Apr 15 19:00:27 2005
+++ 1.81/innobase/srv/srv0start.c Wed Jun 15 12:50:19 2005
@@ -1040,7 +1040,9 @@
srv_start_has_been_called = TRUE;
+#ifdef UNIV_DEBUG
log_do_write = TRUE;
+#endif /* UNIV_DEBUG */
/* yydebug = TRUE; */
srv_is_being_started = TRUE;
@@ -1554,8 +1556,9 @@
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
SRV_MAX_N_IO_THREADS);
+#ifdef UNIV_DEBUG
/* buf_debug_prints = TRUE; */
-
+#endif /* UNIV_DEBUG */
sum_of_data_file_sizes = 0;
for (i = 0; i < srv_n_data_files; i++) {
--- 1.34/innobase/sync/sync0sync.c Tue Mar 1 13:52:03 2005
+++ 1.35/innobase/sync/sync0sync.c Wed Jun 15 12:50:19 2005
@@ -1136,8 +1136,12 @@
} else if (level == SYNC_DICT_HEADER) {
ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER));
} else if (level == SYNC_DICT) {
+#ifdef UNIV_DEBUG
ut_a(buf_debug_prints
|| sync_thread_levels_g(array, SYNC_DICT));
+#else /* UNIV_DEBUG */
+ ut_a(sync_thread_levels_g(array, SYNC_DICT));
+#endif /* UNIV_DEBUG */
} else {
ut_error;
}
| Thread |
|---|
| • bk commit into 5.0 tree (marko:1.1876) | Marko Mäkelä | 15 Jun |