#At file:///home/marko/innobase/dev/mysql2a/5.6-innodb/ based on revid:marko.makela@strippedhjz5rmqxcqap
3580 Marko Mäkelä 2011-04-13
Allow the code to compile when UNIV_HOTBACKUP is defined.
rb:648 approved by Jimmy Yang
modified:
storage/innobase/btr/btr0btr.c
storage/innobase/buf/buf0buf.c
storage/innobase/buf/buf0lru.c
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0mem.c
storage/innobase/ha/ha0ha.c
storage/innobase/include/buf0buf.ic
storage/innobase/include/buf0flu.h
storage/innobase/include/buf0lru.h
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0priv.ic
storage/innobase/include/log0log.h
storage/innobase/include/os0file.h
storage/innobase/include/srv0srv.h
storage/innobase/include/trx0sys.h
storage/innobase/log/log0recv.c
storage/innobase/mem/mem0dbg.c
storage/innobase/page/page0zip.c
storage/innobase/trx/trx0sys.c
storage/innobase/ut/ut0dbg.c
storage/innobase/ut/ut0ut.c
=== modified file 'storage/innobase/btr/btr0btr.c'
--- a/storage/innobase/btr/btr0btr.c revid:marko.makela@stripped
+++ b/storage/innobase/btr/btr0btr.c revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -1515,7 +1515,9 @@ btr_page_reorganize_low(
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
{
+#ifndef UNIV_HOTBACKUP
buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page);
+#endif /* !UNIV_HOTBACKUP */
page_t* page = buf_block_get_frame(block);
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
buf_block_t* temp_block;
=== modified file 'storage/innobase/buf/buf0buf.c'
--- a/storage/innobase/buf/buf0buf.c revid:marko.makela@strippedap
+++ b/storage/innobase/buf/buf0buf.c revid:marko.makela@stripped
@@ -294,7 +294,6 @@ be effective only if PFS_GROUP_BUFFER_SY
# endif /* !PFS_SKIP_BUFFER_MUTEX_RWLOCK */
#endif /* UNIV_PFS_MUTEX || UNIV_PFS_RWLOCK */
-#endif /* !UNIV_HOTBACKUP */
/** Macro to determine whether the read of write counter is used depending
on the io_type */
@@ -445,6 +444,7 @@ buf_block_alloc(
return(block);
}
+#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
Calculates a page checksum which is stored to the page when it is written
=== modified file 'storage/innobase/buf/buf0lru.c'
--- a/storage/innobase/buf/buf0lru.c revid:marko.makela@oracle.com-20110413082211-e6ouhjz5rmqxcqap
+++ b/storage/innobase/buf/buf0lru.c revid:marko.makela@stripped416-i98bfd2h3uwlybjz
@@ -25,6 +25,7 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0lru.h"
+#ifndef UNIV_HOTBACKUP
#ifdef UNIV_NONINL
#include "buf0lru.ic"
#endif
@@ -2390,3 +2391,4 @@ buf_LRU_print(void)
}
}
#endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
+#endif /* !UNIV_HOTBACKUP */
=== modified file 'storage/innobase/dict/dict0dict.c'
--- a/storage/innobase/dict/dict0dict.c revid:marko.makela@strippeduhjz5rmqxcqap
+++ b/storage/innobase/dict/dict0dict.c revid:marko.makela@strippedz
@@ -5111,6 +5111,7 @@ dict_ind_init(void)
dict_ind_redundant->cached = dict_ind_compact->cached = TRUE;
}
+#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Frees dict_ind_redundant and dict_ind_compact. */
static
@@ -5131,7 +5132,6 @@ dict_ind_free(void)
dict_mem_table_free(table);
}
-#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Get index by name
@return index, NULL if does not exist */
=== modified file 'storage/innobase/dict/dict0mem.c'
--- a/storage/innobase/dict/dict0mem.c revid:marko.makela@oracle.com-20110413082211-e6ouhjz5rmqxcqap
+++ b/storage/innobase/dict/dict0mem.c revid:marko.makela@stripped413083416-i98bfd2h3uwlybjz
@@ -34,8 +34,8 @@ Created 1/8/1996 Heikki Tuuri
#include "mach0data.h"
#include "dict0dict.h"
#include "srv0srv.h" /* srv_lower_case_table_names */
-#include "ha_prototypes.h" /* innobase_casedn_str()*/
#ifndef UNIV_HOTBACKUP
+# include "ha_prototypes.h" /* innobase_casedn_str()*/
# include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_BLOB_DEBUG
@@ -275,6 +275,7 @@ dict_mem_index_create(
return(index);
}
+#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Creates and initializes a foreign constraint memory object.
@return own: foreign constraint struct */
@@ -348,6 +349,7 @@ dict_mem_referenced_table_name_lookup_se
= foreign->referenced_table_name;
}
}
+#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
Adds a field definition to an index. NOTE: does not take a copy
=== modified file 'storage/innobase/ha/ha0ha.c'
--- a/storage/innobase/ha/ha0ha.c revid:marko.makela@strippedqap
+++ b/storage/innobase/ha/ha0ha.c revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -31,7 +31,9 @@ Created 8/22/1994 Heikki Tuuri
#ifdef UNIV_DEBUG
# include "buf0buf.h"
#endif /* UNIV_DEBUG */
-#include "btr0sea.h"
+#ifndef UNIV_HOTBACKUP
+# include "btr0sea.h"
+#endif /* !UNIV_HOTBACKUP */
#include "page0page.h"
/*************************************************************//**
@@ -223,12 +225,14 @@ ha_insert_for_fold_func(
prev_node = prev_node->next;
}
+#ifndef UNIV_HOTBACKUP
/* We are in the process of disabling hash index, do not add
new chain node */
if (!btr_search_enabled) {
ut_ad(!btr_search_fully_disabled);
return(TRUE);
}
+#endif /* !UNIV_HOTBACKUP */
/* We have to allocate a new chain node */
=== modified file 'storage/innobase/include/buf0buf.ic'
--- a/storage/innobase/include/buf0buf.ic revid:marko.makela@strippede6ouhjz5rmqxcqap
+++ b/storage/innobase/include/buf0buf.ic revid:marko.makela@strippedwlybjz
@@ -35,6 +35,7 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0lru.h"
#include "buf0rea.h"
+#ifndef UNIV_HOTBACKUP
/** A chunk of buffers. The buffer pool is allocated in chunks. */
struct buf_chunk_struct{
ulint mem_size; /*!< allocated size of the chunk */
@@ -171,6 +172,7 @@ buf_page_peek_if_too_old(
/ (BUF_LRU_OLD_RATIO_DIV * 4))));
}
}
+#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Gets the state of a block.
@@ -1076,7 +1078,8 @@ buf_page_hash_get_locked(
bpage = buf_page_hash_get_low(buf_pool, space, offset, fold);
- if (!bpage || UNIV_UNLIKELY(buf_pool_watch_is_sentinel(buf_pool, bpage))) {
+ if (!bpage
+ || UNIV_UNLIKELY(buf_pool_watch_is_sentinel(buf_pool, bpage))) {
bpage = NULL;
goto unlock_and_exit;
}
@@ -1221,7 +1224,6 @@ buf_page_release_zip(
break;
}
-
ut_error;
}
=== modified file 'storage/innobase/include/buf0flu.h'
--- a/storage/innobase/include/buf0flu.h revid:marko.makela@oracle.com-20110413082211-e6ouhjz5rmqxcqap
+++ b/storage/innobase/include/buf0flu.h revid:marko.makela@stripped-20110413083416-i98bfd2h3uwlybjz
@@ -28,10 +28,10 @@ Created 11/5/1995 Heikki Tuuri
#include "univ.i"
#include "ut0byte.h"
+#include "log0log.h"
#ifndef UNIV_HOTBACKUP
#include "mtr0types.h"
#include "buf0types.h"
-#include "log0log.h"
/** Flag indicating if the page_cleaner is in active state. */
extern ibool buf_page_cleaner_is_active;
=== modified file 'storage/innobase/include/buf0lru.h'
--- a/storage/innobase/include/buf0lru.h revid:marko.makela@stripped
+++ b/storage/innobase/include/buf0lru.h revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -27,6 +27,7 @@ Created 11/5/1995 Heikki Tuuri
#define buf0lru_h
#include "univ.i"
+#ifndef UNIV_HOTBACKUP
#include "ut0byte.h"
#include "buf0types.h"
@@ -293,4 +294,6 @@ Increments the page_zip_decompress() cou
#include "buf0lru.ic"
#endif
+#endif /* !UNIV_HOTBACKUP */
+
#endif
=== modified file 'storage/innobase/include/dict0dict.ic'
--- a/storage/innobase/include/dict0dict.ic revid:marko.makela@stripped
+++ b/storage/innobase/include/dict0dict.ic revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -490,6 +490,7 @@ dict_table_zip_size(
return(dict_table_flags_to_zip_size(table->flags));
}
+#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Obtain exclusive locks on all index trees of the table. This is to prevent
accessing index trees while InnoDB is updating internal metadata for
@@ -532,6 +533,8 @@ dict_table_x_unlock_indexes(
rw_lock_x_unlock(dict_index_get_lock(index));
}
}
+#endif /* !UNIV_HOTBACKUP */
+
/********************************************************************//**
Gets the number of fields in the internal representation of an index,
including fields added by the dictionary system.
=== modified file 'storage/innobase/include/dict0priv.ic'
--- a/storage/innobase/include/dict0priv.ic revid:marko.makela@stripped0413082211-e6ouhjz5rmqxcqap
+++ b/storage/innobase/include/dict0priv.ic revid:marko.makela@stripped16-i98bfd2h3uwlybjz
@@ -26,6 +26,7 @@ Created Wed 13 Oct 2010 16:10:14 EST Su
#include "dict0dict.h"
#include "dict0load.h"
#include "dict0priv.h"
+#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Gets a table; loads it to the dictionary cache if necessary. A low-level
@@ -107,3 +108,4 @@ dict_table_check_if_in_cache_low(
!strcmp(table->name, table_name));
return(table);
}
+#endif /*! UNIV_HOTBACKUP */
=== modified file 'storage/innobase/include/log0log.h'
--- a/storage/innobase/include/log0log.h revid:marko.makela@strippedxcqap
+++ b/storage/innobase/include/log0log.h revid:marko.makela@stripped
@@ -765,7 +765,6 @@ struct log_struct{
buffer */
#ifndef UNIV_HOTBACKUP
mutex_t mutex; /*!< mutex protecting the log */
-#endif /* !UNIV_HOTBACKUP */
mutex_t log_flush_order_mutex;/*!< mutex to serialize access to
the flush list when we are putting
@@ -775,6 +774,7 @@ struct log_struct{
mtr_commit and still ensure that
insertions in the flush_list happen
in the LSN order. */
+#endif /* !UNIV_HOTBACKUP */
byte* buf_ptr; /* unaligned log buffer */
byte* buf; /*!< log buffer */
ulint buf_size; /*!< log buffer size in bytes */
=== modified file 'storage/innobase/include/os0file.h'
--- a/storage/innobase/include/os0file.h revid:marko.makela@stripped
+++ b/storage/innobase/include/os0file.h revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -308,7 +308,7 @@ to original un-instrumented file I/O API
# define os_file_create(key, name, create, purpose, type, success) \
os_file_create_func(name, create, purpose, type, success)
-# define os_file_create_simple(key, name, create, access, success) \
+# define os_file_create_simple(key, name, create_mode, access, success) \
os_file_create_simple_func(name, create_mode, access, success)
# define os_file_create_simple_no_error_handling( \
=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h revid:marko.makela@stripped110413082211-e6ouhjz5rmqxcqap
+++ b/storage/innobase/include/srv0srv.h revid:marko.makela@stripped6-i98bfd2h3uwlybjz
@@ -115,7 +115,6 @@ extern ulint srv_max_file_format_at_star
/** Place locks to records only i.e. do not use next-key locking except
on duplicate key checking and foreign key checking */
extern ibool srv_locks_unsafe_for_binlog;
-#endif /* !UNIV_HOTBACKUP */
/* If this flag is TRUE, then we will use the native aio of the
OS (provided we compiled Innobase with it in), otherwise we will
@@ -125,6 +124,7 @@ extern my_bool srv_use_native_aio;
#ifdef __WIN__
extern ibool srv_use_native_conditions;
#endif
+#endif /* !UNIV_HOTBACKUP */
extern ulint srv_n_data_files;
extern char** srv_data_file_names;
extern ulint* srv_data_file_sizes;
=== modified file 'storage/innobase/include/trx0sys.h'
--- a/storage/innobase/include/trx0sys.h revid:marko.makela@stripped10413082211-e6ouhjz5rmqxcqap
+++ b/storage/innobase/include/trx0sys.h revid:marko.makela@stripped-i98bfd2h3uwlybjz
@@ -632,7 +632,6 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO. */
#define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE
/* @} */
-#ifndef UNIV_HOTBACKUP
/** File format tag */
/* @{ */
/** The offset of the file format tag on the trx system header page
@@ -651,6 +650,7 @@ identifier is added to this 64-bit const
| TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW)
/* @} */
+#ifndef UNIV_HOTBACKUP
/** Doublewrite control struct */
struct trx_doublewrite_struct{
mutex_t mutex; /*!< mutex protecting the first_free field and
=== modified file 'storage/innobase/log/log0recv.c'
--- a/storage/innobase/log/log0recv.c revid:marko.makela@stripped5rmqxcqap
+++ b/storage/innobase/log/log0recv.c revid:marko.makela@stripped
@@ -801,8 +801,8 @@ recv_read_checkpoint_info_for_backup(
*lsn = mach_read_from_8(cp_buf + LOG_CHECKPOINT_LSN);
*offset = mach_read_from_4(
cp_buf + LOG_CHECKPOINT_OFFSET_LOW32);
- *offset |= mach_read_from_4(
- cp_buf + LOG_CHECKPOINT_OFFSET_HIGH32) << 32;
+ *offset |= ((lsn_t) mach_read_from_4(
+ cp_buf + LOG_CHECKPOINT_OFFSET_HIGH32)) << 32;
*cp_no = mach_read_from_8(cp_buf + LOG_CHECKPOINT_NO);
@@ -1934,7 +1934,7 @@ recv_apply_log_recs_for_backup(void)
if (!success) {
fprintf(stderr,
"InnoDB: Fatal error: cannot extend"
- " tablespace %lu to hold %lu pages\n",
+ " tablespace %u to hold %u pages\n",
recv_addr->space, recv_addr->page_no);
exit(1);
=== modified file 'storage/innobase/mem/mem0dbg.c'
--- a/storage/innobase/mem/mem0dbg.c revid:marko.makela@strippedxcqap
+++ b/storage/innobase/mem/mem0dbg.c revid:marko.makela@stripped
@@ -24,10 +24,9 @@ but is included in mem0mem.* !
Created 6/9/1994 Heikki Tuuri
*************************************************************************/
-#include "ha_prototypes.h"
-
#ifdef UNIV_MEM_DEBUG
# ifndef UNIV_HOTBACKUP
+# include "ha_prototypes.h"
/* The mutex which protects in the debug version the hash table
containing the list of live memory heaps, and also the global
variables below. */
=== modified file 'storage/innobase/page/page0zip.c'
--- a/storage/innobase/page/page0zip.c revid:marko.makela@stripped
+++ b/storage/innobase/page/page0zip.c revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -46,6 +46,7 @@ Created June 2005 by Marko Makela
#else /* !UNIV_HOTBACKUP */
# define lock_move_reorganize_page(block, temp_block) ((void) 0)
# define buf_LRU_stat_inc_unzip() ((void) 0)
+# define MONITOR_INC(x) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_HOTBACKUP
@@ -4426,7 +4427,9 @@ page_zip_reorganize(
dict_index_t* index, /*!< in: index of the B-tree node */
mtr_t* mtr) /*!< in: mini-transaction */
{
+#ifndef UNIV_HOTBACKUP
buf_pool_t* buf_pool = buf_pool_from_block(block);
+#endif /* !UNIV_HOTBACKUP */
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
page_t* page = buf_block_get_frame(block);
buf_block_t* temp_block;
=== modified file 'storage/innobase/trx/trx0sys.c'
--- a/storage/innobase/trx/trx0sys.c revid:marko.makela@strippeduhjz5rmqxcqap
+++ b/storage/innobase/trx/trx0sys.c revid:marko.makela@stripped
@@ -1429,23 +1429,6 @@ trx_sys_print_mysql_binlog_offset_from_p
}
}
-
-/* THESE ARE COPIED FROM NON-HOTBACKUP PART OF THE INNODB SOURCE TREE
- (This code duplicaton should be fixed at some point!)
-*/
-
-#define TRX_SYS_SPACE 0 /* the SYSTEM tablespace */
-/* The offset of the file format tag on the trx system header page */
-#define TRX_SYS_FILE_FORMAT_TAG (UNIV_PAGE_SIZE - 16)
-/* We use these random constants to reduce the probability of reading
-garbage (from previous versions) that maps to an actual format id. We
-use these as bit masks at the time of reading and writing from/to disk. */
-#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW 3645922177UL
-#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_HIGH 2745987765UL
-
-/* END OF COPIED DEFINITIONS */
-
-
/*****************************************************************//**
Reads the file format id from the first system table space file.
Even if the call succeeds and returns TRUE, the returned format id
@@ -1724,7 +1707,6 @@ trx_sys_close(void)
trx_sys = NULL;
}
-#endif /* !UNIV_HOTBACKUP */
/*********************************************************************
Check if there are any active (non-prepared) transactions.
@@ -1775,3 +1757,4 @@ trx_sys_validate_trx_list(void)
return(TRUE);
}
#endif /* UNIV_DEBUG */
+#endif /* !UNIV_HOTBACKUP */
=== modified file 'storage/innobase/ut/ut0dbg.c'
--- a/storage/innobase/ut/ut0dbg.c revid:marko.makela@stripped
+++ b/storage/innobase/ut/ut0dbg.c revid:marko.makela@stripped20110413083416-i98bfd2h3uwlybjz
@@ -25,7 +25,9 @@ Created 1/30/1994 Heikki Tuuri
#include "univ.i"
#include "ut0dbg.h"
-#include "ha_prototypes.h"
+#ifndef UNIV_HOTBACKUP
+# include "ha_prototypes.h"
+#endif /* !UNIV_HOTBACKUP */
#if defined(__GNUC__) && (__GNUC__ > 2)
#else
@@ -56,7 +58,7 @@ ut_dbg_assertion_failed(
ut_print_timestamp(stderr);
#ifdef UNIV_HOTBACKUP
fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n",
- innobase_basename(file), line);
+ file, line);
#else /* UNIV_HOTBACKUP */
fprintf(stderr,
" InnoDB: Assertion failure in thread %lu"
=== modified file 'storage/innobase/ut/ut0ut.c'
--- a/storage/innobase/ut/ut0ut.c revid:marko.makela@stripped
+++ b/storage/innobase/ut/ut0ut.c revid:marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz
@@ -245,16 +245,16 @@ ut_print_timestamp(
(int)cal_tm.wMinute,
(int)cal_tm.wSecond);
#else
- struct tm cal_tm;
struct tm* cal_tm_ptr;
time_t tm;
- time(&tm);
-
#ifdef HAVE_LOCALTIME_R
+ struct tm cal_tm;
+ time(&tm);
localtime_r(&tm, &cal_tm);
cal_tm_ptr = &cal_tm;
#else
+ time(&tm);
cal_tm_ptr = localtime(&tm);
#endif
fprintf(file,"%02d%02d%02d %2d:%02d:%02d",
@@ -288,16 +288,16 @@ ut_sprintf_timestamp(
(int)cal_tm.wMinute,
(int)cal_tm.wSecond);
#else
- struct tm cal_tm;
struct tm* cal_tm_ptr;
time_t tm;
- time(&tm);
-
#ifdef HAVE_LOCALTIME_R
+ struct tm cal_tm;
+ time(&tm);
localtime_r(&tm, &cal_tm);
cal_tm_ptr = &cal_tm;
#else
+ time(&tm);
cal_tm_ptr = localtime(&tm);
#endif
sprintf(buf, "%02d%02d%02d %2d:%02d:%02d",
@@ -333,16 +333,16 @@ ut_sprintf_timestamp_without_extra_chars
(int)cal_tm.wMinute,
(int)cal_tm.wSecond);
#else
- struct tm cal_tm;
struct tm* cal_tm_ptr;
time_t tm;
- time(&tm);
-
#ifdef HAVE_LOCALTIME_R
+ struct tm cal_tm;
+ time(&tm);
localtime_r(&tm, &cal_tm);
cal_tm_ptr = &cal_tm;
#else
+ time(&tm);
cal_tm_ptr = localtime(&tm);
#endif
sprintf(buf, "%02d%02d%02d_%2d_%02d_%02d",
@@ -374,16 +374,16 @@ ut_get_year_month_day(
*month = (ulint)cal_tm.wMonth;
*day = (ulint)cal_tm.wDay;
#else
- struct tm cal_tm;
struct tm* cal_tm_ptr;
time_t tm;
- time(&tm);
-
#ifdef HAVE_LOCALTIME_R
+ struct tm cal_tm;
+ time(&tm);
localtime_r(&tm, &cal_tm);
cal_tm_ptr = &cal_tm;
#else
+ time(&tm);
cal_tm_ptr = localtime(&tm);
#endif
*year = (ulint)cal_tm_ptr->tm_year + 1900;
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110413083416-i98bfd2h3uwlybjz.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk-innodb branch (marko.makela:3580) | marko.makela | 13 Apr |