WL#6161 Integrating with InnoDB codebase in MySQL 5.5

      
Changes in the InnoDB codebase required to compile and
integrate the MEB codebase with MySQL 5.5.

@ storage/innobase/btr/btr0btr.c
  Excluded buffer pool usage from MEB build.
 
  buf_pool_from_bpage calls are in buf0buf.ic, and
  the buffer pool functions from that file are
  disabled in MEB.
@ storage/innobase/buf/buf0buf.c
  Disabling more buffer pool functions unused in MEB.
@ storage/innobase/dict/dict0dict.c
  Disabling dict_ind_free that is unused in MEB.
@ storage/innobase/dict/dict0mem.c
  The include

  #include "ha_prototypes.h"

  Was causing conflicts with definitions in my_global.h

  Linking C executable mysqlbackup
  libinnodb.a(dict0mem.c.o): In function `dict_mem_foreign_table_name_lookup_set':
  dict0mem.c:(.text+0x91c): undefined reference to `innobase_get_lower_case_table_names'
  libinnodb.a(dict0mem.c.o): In function `dict_mem_referenced_table_name_lookup_set':
  dict0mem.c:(.text+0x9fc): undefined reference to `innobase_get_lower_case_table_names'
  libinnodb.a(dict0mem.c.o): In function `dict_mem_foreign_table_name_lookup_set':
  dict0mem.c:(.text+0x96e): undefined reference to `innobase_casedn_str'
  libinnodb.a(dict0mem.c.o): In function `dict_mem_referenced_table_name_lookup_set':
  dict0mem.c:(.text+0xa4e): undefined reference to `innobase_casedn_str'
  collect2: ld returned 1 exit status
  make[2]: *** [mysqlbackup] Error 1

  innobase_get_lower_case_table_names
  innobase_casedn_str
  are functions that are part of ha_innodb.cc that is not part of the build
        
  dict_mem_foreign_table_name_lookup_set
  function is not there in the current codebase, meaning we do not use it in MEB.
@ storage/innobase/fil/fil0fil.c
  The srv_fast_shutdown variable is declared in
  srv0srv.c that is not compiled in the
  mysqlbackup codebase.

  This throws an undeclared error.

  From the Manual
  ---------------

  innodb_fast_shutdown
  --------------------

  The InnoDB shutdown mode. The default value is 1
  as of MySQL 3.23.50, which causes a “fast� shutdown
  (the normal type of shutdown). If the value is 0,
  InnoDB does a full purge and an insert buffer merge
  before a shutdown. These operations can take minutes,
  or even hours in extreme cases. If the value is 1,
  InnoDB skips these operations at shutdown.

  This ideally does not matter from mysqlbackup
  @ storage/innobase/ha/ha0ha.c
  In file included from /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/ha/ha0ha.c:34:0:
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/btr0sea.h:286:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  make[2]: *** [CMakeFiles/innodb.dir/home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/ha/ha0ha.c.o] Error 1
  make[1]: *** [CMakeFiles/innodb.dir/all] Error 2
  make: *** [all] Error 2

  # include "sync0rw.h" is excluded from hotbackup compilation in dict0dict.h

  This causes extern rw_lock_t*	btr_search_latch_temp; to throw a failure because
  the definition of rw_lock_t is not found.
@ storage/innobase/include/buf0buf.h
  Excluding buffer pool functions that are unused from the
  MEB codebase.
@ storage/innobase/include/buf0buf.ic
  replicated the exclusion of

  #include "buf0flu.h"
  #include "buf0lru.h"
  #include "buf0rea.h"

  by looking at the current codebase in <meb-trunk>/src/innodb
  @ storage/innobase/include/dict0dict.h
  dict_table_x_lock_indexes, dict_table_x_unlock_indexes, dict_table_is_corrupted,
  dict_index_is_corrupted, buf_block_buf_fix_inc_func are unused in MEB and was
  leading to compilation errors and hence excluded.
@ storage/innobase/include/dict0dict.ic
  dict_table_x_lock_indexes, dict_table_x_unlock_indexes, dict_table_is_corrupted,
  dict_index_is_corrupted, buf_block_buf_fix_inc_func are unused in MEB and was
  leading to compilation errors and hence excluded.
@ storage/innobase/include/log0log.h
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/log0log.h: At top level:
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/log0log.h:767:2: error: expected specifier-qualifier-list before Ã¢â  ‚¬Ëœmutex_t’

  mutex_t definitions were excluded as seen from ambient code
  hence excluding definition for log_flush_order_mutex also.
@ storage/innobase/include/os0file.h
  Bug in InnoDB code, create_mode should have been create.
@ storage/innobase/include/srv0srv.h
  In file included from /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/buf/buf0buf.c:50:0:
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/srv0srv.h: At top level:
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/srv0srv.h:120:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘srv_use_native_aio’

  srv_use_native_aio - we do not use native aio of the OS anyway from MEB. MEB does not compile
  InnoDB with this option. Hence disabling it.
@ storage/innobase/include/trx0sys.h
  [ 56%] Building C object CMakeFiles/innodb.dir/home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c.o
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c: In function ‘trx_sys_read_file_format_id’:
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c:1499:20: error: ‘TRX_SYS_FILE_FORMAT_TAG_MAGIC_N’   undeclared (first use in this function)
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c:1499:20: note: each undeclared identifier is reported only once for  each function it appears in
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c: At top level:
  /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/buf0buf.h:607:1: warning: ‘buf_block_buf_fix_inc_func’ declared ‘static’ but never defined
  make[2]: *** [CMakeFiles/innodb.dir/home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c.o] Error 1

  unused calls excluded to enable compilation
@ storage/innobase/mem/mem0dbg.c
    excluding #include "ha_prototypes.h" that lead to definitions in ha_innodb.cc
@ storage/innobase/os/os0file.c
    InnoDB not compiled with aio support from MEB anyway. Hence excluding this from
    the compilation.
@ storage/innobase/page/page0zip.c
  page0zip.c:(.text+0x4e9e): undefined reference to `buf_pool_from_block'
  collect2: ld returned 1 exit status

  buf_pool_from_block defined in buf0buf.ic, most of the file is excluded for compilation of MEB
@ storage/innobase/ut/ut0dbg.c
  excluding #include "ha_prototypes.h" since it leads to definitions in ha_innodb.cc
  innobase_basename(file) is defined in ha_innodb.cc. Hence excluding that also.
@ storage/innobase/ut/ut0ut.c
  cal_tm unused from MEB, was leading to earnings, hence disabling for MEB.
parent 71b101fc
...@@ -42,6 +42,7 @@ Created 6/2/1994 Heikki Tuuri ...@@ -42,6 +42,7 @@ Created 6/2/1994 Heikki Tuuri
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "trx0trx.h" #include "trx0trx.h"
#endif /* UNIV_HOTBACKUP */
/**************************************************************//** /**************************************************************//**
Report that an index page is corrupted. */ Report that an index page is corrupted. */
UNIV_INTERN UNIV_INTERN
...@@ -64,6 +65,7 @@ btr_corruption_report( ...@@ -64,6 +65,7 @@ btr_corruption_report(
buf_page_print(buf_block_get_frame(block), 0, 0); buf_page_print(buf_block_get_frame(block), 0, 0);
} }
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
# include "srv0srv.h" # include "srv0srv.h"
# include "ut0rbt.h" # include "ut0rbt.h"
...@@ -1575,7 +1577,9 @@ btr_page_reorganize_low( ...@@ -1575,7 +1577,9 @@ btr_page_reorganize_low(
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
#ifndef UNIV_HOTBACKUP
buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page); buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page);
#endif /* !UNIV_HOTBACKUP */
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
page_zip_des_t* page_zip = buf_block_get_page_zip(block); page_zip_des_t* page_zip = buf_block_get_page_zip(block);
buf_block_t* temp_block; buf_block_t* temp_block;
......
...@@ -302,7 +302,6 @@ struct buf_chunk_struct{ ...@@ -302,7 +302,6 @@ struct buf_chunk_struct{
was allocated for the frames */ was allocated for the frames */
buf_block_t* blocks; /*!< array of buffer control blocks */ buf_block_t* blocks; /*!< array of buffer control blocks */
}; };
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Gets the smallest oldest_modification lsn for any page in the pool. Returns Gets the smallest oldest_modification lsn for any page in the pool. Returns
...@@ -438,6 +437,7 @@ buf_block_alloc( ...@@ -438,6 +437,7 @@ buf_block_alloc(
return(block); return(block);
} }
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
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
......
...@@ -169,6 +169,7 @@ void ...@@ -169,6 +169,7 @@ void
dict_field_print_low( dict_field_print_low(
/*=================*/ /*=================*/
const dict_field_t* field); /*!< in: field */ const dict_field_t* field); /*!< in: field */
#ifndef UNIV_HOTBACKUP
/*********************************************************************//** /*********************************************************************//**
Frees a foreign key struct. */ Frees a foreign key struct. */
static static
...@@ -182,7 +183,7 @@ and unique key errors */ ...@@ -182,7 +183,7 @@ and unique key errors */
UNIV_INTERN FILE* dict_foreign_err_file = NULL; UNIV_INTERN FILE* dict_foreign_err_file = NULL;
/* mutex protecting the foreign and unique error buffers */ /* mutex protecting the foreign and unique error buffers */
UNIV_INTERN mutex_t dict_foreign_err_mutex; UNIV_INTERN mutex_t dict_foreign_err_mutex;
#endif /* !UNIV_HOTBACKUP */
/******************************************************************//** /******************************************************************//**
Makes all characters in a NUL-terminated UTF-8 string lower case. */ Makes all characters in a NUL-terminated UTF-8 string lower case. */
UNIV_INTERN UNIV_INTERN
...@@ -2247,6 +2248,7 @@ dict_index_build_internal_non_clust( ...@@ -2247,6 +2248,7 @@ dict_index_build_internal_non_clust(
return(new_index); return(new_index);
} }
#ifndef UNIV_HOTBACKUP
/*====================== FOREIGN KEY PROCESSING ========================*/ /*====================== FOREIGN KEY PROCESSING ========================*/
/*********************************************************************//** /*********************************************************************//**
...@@ -2511,6 +2513,7 @@ dict_foreign_find_equiv_index( ...@@ -2511,6 +2513,7 @@ dict_foreign_find_equiv_index(
FALSE/* allow columns to be NULL */)); FALSE/* allow columns to be NULL */));
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Returns an index object by matching on the name and column names and Returns an index object by matching on the name and column names and
if more than one index matches return the index with the max id if more than one index matches return the index with the max id
...@@ -2570,6 +2573,7 @@ dict_table_get_index_by_max_id( ...@@ -2570,6 +2573,7 @@ dict_table_get_index_by_max_id(
return(found); return(found);
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Report an error in a foreign key definition. */ Report an error in a foreign key definition. */
static static
...@@ -2735,6 +2739,7 @@ dict_foreign_add_to_cache( ...@@ -2735,6 +2739,7 @@ dict_foreign_add_to_cache(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//** /*********************************************************************//**
Scans from pointer onwards. Stops if is at the start of a copy of Scans from pointer onwards. Stops if is at the start of a copy of
'string' where characters are compared without case sensitivity, and 'string' where characters are compared without case sensitivity, and
...@@ -3214,6 +3219,7 @@ end_of_string: ...@@ -3214,6 +3219,7 @@ end_of_string:
} }
} }
#ifndef UNIV_HOTBACKUP
/*********************************************************************//** /*********************************************************************//**
Finds the highest [number] for foreign key constraints of the table. Looks Finds the highest [number] for foreign key constraints of the table. Looks
only at the >= 4.0.18-format id's, which are of the form only at the >= 4.0.18-format id's, which are of the form
...@@ -4050,7 +4056,7 @@ syntax_error: ...@@ -4050,7 +4056,7 @@ syntax_error:
} }
/*==================== END OF FOREIGN KEY PROCESSING ====================*/ /*==================== END OF FOREIGN KEY PROCESSING ====================*/
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Returns an index object if it is found in the dictionary cache. Returns an index object if it is found in the dictionary cache.
Assumes that dict_sys->mutex is already being held. Assumes that dict_sys->mutex is already being held.
...@@ -4411,6 +4417,7 @@ fake_statistics: ...@@ -4411,6 +4417,7 @@ fake_statistics:
dict_table_stats_unlock(table, RW_X_LATCH); dict_table_stats_unlock(table, RW_X_LATCH);
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Prints info of a foreign key constraint. */ Prints info of a foreign key constraint. */
static static
...@@ -4441,6 +4448,7 @@ dict_foreign_print_low( ...@@ -4441,6 +4448,7 @@ dict_foreign_print_low(
fputs(" )\n", stderr); fputs(" )\n", stderr);
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Prints a table data. */ Prints a table data. */
UNIV_INTERN UNIV_INTERN
...@@ -4622,6 +4630,7 @@ dict_field_print_low( ...@@ -4622,6 +4630,7 @@ dict_field_print_low(
} }
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Outputs info on a foreign key of a table in a format suitable for Outputs info on a foreign key of a table in a format suitable for
CREATE TABLE. */ CREATE TABLE. */
...@@ -4810,6 +4819,7 @@ dict_print_info_on_foreign_keys( ...@@ -4810,6 +4819,7 @@ dict_print_info_on_foreign_keys(
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
} }
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Displays the names of the index and the table. */ Displays the names of the index and the table. */
UNIV_INTERN UNIV_INTERN
......
...@@ -33,8 +33,8 @@ Created 1/8/1996 Heikki Tuuri ...@@ -33,8 +33,8 @@ Created 1/8/1996 Heikki Tuuri
#include "data0type.h" #include "data0type.h"
#include "mach0data.h" #include "mach0data.h"
#include "dict0dict.h" #include "dict0dict.h"
#include "ha_prototypes.h" /* innobase_casedn_str()*/
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
# include "ha_prototypes.h" /* innobase_casedn_str()*/
# include "lock0lock.h" # include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
...@@ -272,6 +272,7 @@ dict_mem_index_create( ...@@ -272,6 +272,7 @@ dict_mem_index_create(
return(index); return(index);
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Creates and initializes a foreign constraint memory object. Creates and initializes a foreign constraint memory object.
@return own: foreign constraint struct */ @return own: foreign constraint struct */
...@@ -346,6 +347,7 @@ dict_mem_referenced_table_name_lookup_set( ...@@ -346,6 +347,7 @@ dict_mem_referenced_table_name_lookup_set(
} }
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Adds a field definition to an index. NOTE: does not take a copy Adds a field definition to an index. NOTE: does not take a copy
of the column name if the field is a column. The memory occupied of the column name if the field is a column. The memory occupied
......
...@@ -857,8 +857,10 @@ fil_node_close_file( ...@@ -857,8 +857,10 @@ fil_node_close_file(
ut_a(node->open); ut_a(node->open);
ut_a(node->n_pending == 0); ut_a(node->n_pending == 0);
ut_a(node->n_pending_flushes == 0); ut_a(node->n_pending_flushes == 0);
#ifndef UNIV_HOTBACKUP
ut_a(node->modification_counter == node->flush_counter ut_a(node->modification_counter == node->flush_counter
|| srv_fast_shutdown == 2); || srv_fast_shutdown == 2);
#endif /* !UNIV_HOTBACKUP */
ret = os_file_close(node->handle); ret = os_file_close(node->handle);
ut_a(ret); ut_a(ret);
......
...@@ -28,6 +28,7 @@ Created 8/22/1994 Heikki Tuuri ...@@ -28,6 +28,7 @@ Created 8/22/1994 Heikki Tuuri
#include "ha0ha.ic" #include "ha0ha.ic"
#endif #endif
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
# include "buf0buf.h" # include "buf0buf.h"
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
...@@ -51,17 +52,13 @@ ha_create_func( ...@@ -51,17 +52,13 @@ ha_create_func(
hash table: must be a power of 2, or 0 */ hash table: must be a power of 2, or 0 */
{ {
hash_table_t* table; hash_table_t* table;
#ifndef UNIV_HOTBACKUP
ulint i; ulint i;
#endif /* !UNIV_HOTBACKUP */
ut_ad(ut_is_2pow(n_mutexes)); ut_ad(ut_is_2pow(n_mutexes));
table = hash_create(n); table = hash_create(n);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
table->adaptive = TRUE; table->adaptive = TRUE;
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
/* Creating MEM_HEAP_BTR_SEARCH type heaps can potentially fail, /* Creating MEM_HEAP_BTR_SEARCH type heaps can potentially fail,
but in practise it never should in this case, hence the asserts. */ but in practise it never should in this case, hence the asserts. */
...@@ -74,7 +71,6 @@ ha_create_func( ...@@ -74,7 +71,6 @@ ha_create_func(
return(table); return(table);
} }
#ifndef UNIV_HOTBACKUP
hash_create_mutexes(table, n_mutexes, mutex_level); hash_create_mutexes(table, n_mutexes, mutex_level);
table->heaps = mem_alloc(n_mutexes * sizeof(void*)); table->heaps = mem_alloc(n_mutexes * sizeof(void*));
...@@ -83,7 +79,6 @@ ha_create_func( ...@@ -83,7 +79,6 @@ ha_create_func(
table->heaps[i] = mem_heap_create_in_btr_search(4096); table->heaps[i] = mem_heap_create_in_btr_search(4096);
ut_a(table->heaps[i]); ut_a(table->heaps[i]);
} }
#endif /* !UNIV_HOTBACKUP */
return(table); return(table);
} }
...@@ -134,7 +129,6 @@ ha_insert_for_fold_func( ...@@ -134,7 +129,6 @@ ha_insert_for_fold_func(
while (prev_node != NULL) { while (prev_node != NULL) {
if (prev_node->fold == fold) { if (prev_node->fold == fold) {
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
buf_block_t* prev_block = prev_node->block; buf_block_t* prev_block = prev_node->block;
ut_a(prev_block->frame ut_a(prev_block->frame
...@@ -143,7 +137,6 @@ ha_insert_for_fold_func( ...@@ -143,7 +137,6 @@ ha_insert_for_fold_func(
prev_block->n_pointers--; prev_block->n_pointers--;
block->n_pointers++; block->n_pointers++;
} }
# endif /* !UNIV_HOTBACKUP */
prev_node->block = block; prev_node->block = block;
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
...@@ -171,11 +164,9 @@ ha_insert_for_fold_func( ...@@ -171,11 +164,9 @@ ha_insert_for_fold_func(
ha_node_set_data(node, block, data); ha_node_set_data(node, block, data);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
block->n_pointers++; block->n_pointers++;
} }
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
node->fold = fold; node->fold = fold;
...@@ -217,13 +208,11 @@ ha_delete_hash_node( ...@@ -217,13 +208,11 @@ ha_delete_hash_node(
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_ad(btr_search_enabled); ut_ad(btr_search_enabled);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
ut_a(del_node->block->frame = page_align(del_node->data)); ut_a(del_node->block->frame = page_align(del_node->data));
ut_a(del_node->block->n_pointers > 0); ut_a(del_node->block->n_pointers > 0);
del_node->block->n_pointers--; del_node->block->n_pointers--;
} }
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
HASH_DELETE_AND_COMPACT(ha_node_t, next, table, del_node); HASH_DELETE_AND_COMPACT(ha_node_t, next, table, del_node);
...@@ -264,13 +253,11 @@ ha_search_and_update_if_found_func( ...@@ -264,13 +253,11 @@ ha_search_and_update_if_found_func(
if (node) { if (node) {
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
ut_a(node->block->n_pointers > 0); ut_a(node->block->n_pointers > 0);
node->block->n_pointers--; node->block->n_pointers--;
new_block->n_pointers++; new_block->n_pointers++;
} }
# endif /* !UNIV_HOTBACKUP */
node->block = new_block; node->block = new_block;
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
...@@ -278,7 +265,6 @@ ha_search_and_update_if_found_func( ...@@ -278,7 +265,6 @@ ha_search_and_update_if_found_func(
} }
} }
#ifndef UNIV_HOTBACKUP
/*****************************************************************//** /*****************************************************************//**
Removes from the chain determined by fold all nodes whose data pointer Removes from the chain determined by fold all nodes whose data pointer
points to the page given. */ points to the page given. */
......
...@@ -92,6 +92,8 @@ insert/delete buffer when the record is not in the buffer pool. */ ...@@ -92,6 +92,8 @@ insert/delete buffer when the record is not in the buffer pool. */
buffer when the record is not in the buffer pool. */ buffer when the record is not in the buffer pool. */
#define BTR_DELETE 8192 #define BTR_DELETE 8192
#endif /* UNIV_HOTBACKUP */
/**************************************************************//** /**************************************************************//**
Report that an index page is corrupted. */ Report that an index page is corrupted. */
UNIV_INTERN UNIV_INTERN
...@@ -112,6 +114,7 @@ btr_corruption_report( ...@@ -112,6 +114,7 @@ btr_corruption_report(
ut_error; \ ut_error; \
} }
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
# include "ut0rbt.h" # include "ut0rbt.h"
/** An index->blobs entry for keeping track of off-page column references */ /** An index->blobs entry for keeping track of off-page column references */
......
...@@ -39,6 +39,8 @@ typedef struct btr_cur_struct btr_cur_t; ...@@ -39,6 +39,8 @@ typedef struct btr_cur_struct btr_cur_t;
/** B-tree search information for the adaptive hash index */ /** B-tree search information for the adaptive hash index */
typedef struct btr_search_struct btr_search_t; typedef struct btr_search_struct btr_search_t;
#ifndef UNIV_HOTBACKUP
/** @brief The latch protecting the adaptive search system /** @brief The latch protecting the adaptive search system
This latch protects the This latch protects the
...@@ -54,6 +56,8 @@ Bear in mind (3) and (4) when using the hash index. ...@@ -54,6 +56,8 @@ Bear in mind (3) and (4) when using the hash index.
*/ */
extern rw_lock_t* btr_search_latch_temp; extern rw_lock_t* btr_search_latch_temp;
#endif /* UNIV_HOTBACKUP */
/** The latch protecting the adaptive search system */ /** The latch protecting the adaptive search system */
#define btr_search_latch (*btr_search_latch_temp) #define btr_search_latch (*btr_search_latch_temp)
......
...@@ -593,34 +593,34 @@ ib_uint64_t ...@@ -593,34 +593,34 @@ ib_uint64_t
buf_block_get_modify_clock( buf_block_get_modify_clock(
/*=======================*/ /*=======================*/
buf_block_t* block); /*!< in: block */ buf_block_t* block); /*!< in: block */
#else /* !UNIV_HOTBACKUP */
# define buf_block_modify_clock_inc(block) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************//** /*******************************************************************//**
Increments the bufferfix count. */ Increments the bufferfix count. */
UNIV_INLINE UNIV_INLINE
void void
buf_block_buf_fix_inc_func( buf_block_buf_fix_inc_func(
/*=======================*/ /*=======================*/
#ifdef UNIV_SYNC_DEBUG # ifdef UNIV_SYNC_DEBUG
const char* file, /*!< in: file name */ const char* file, /*!< in: file name */
ulint line, /*!< in: line */ ulint line, /*!< in: line */
#endif /* UNIV_SYNC_DEBUG */ # endif /* UNIV_SYNC_DEBUG */
buf_block_t* block) /*!< in/out: block to bufferfix */ buf_block_t* block) /*!< in/out: block to bufferfix */
__attribute__((nonnull)); __attribute__((nonnull));
#ifdef UNIV_SYNC_DEBUG # ifdef UNIV_SYNC_DEBUG
/** Increments the bufferfix count. /** Increments the bufferfix count.
@param b in/out: block to bufferfix @param b in/out: block to bufferfix
@param f in: file name where requested @param f in: file name where requested
@param l in: line number where requested */ @param l in: line number where requested */
# define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(f,l,b) # define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(f,l,b)
#else /* UNIV_SYNC_DEBUG */ # else /* UNIV_SYNC_DEBUG */
/** Increments the bufferfix count. /** Increments the bufferfix count.
@param b in/out: block to bufferfix @param b in/out: block to bufferfix
@param f in: file name where requested @param f in: file name where requested
@param l in: line number where requested */ @param l in: line number where requested */
# define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b) # define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b)
#endif /* UNIV_SYNC_DEBUG */ # endif /* UNIV_SYNC_DEBUG */
#else /* !UNIV_HOTBACKUP */
# define buf_block_modify_clock_inc(block) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
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 to a file. Note that we must be careful to calculate the same value
......
...@@ -31,6 +31,7 @@ Created 11/5/1995 Heikki Tuuri ...@@ -31,6 +31,7 @@ Created 11/5/1995 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "mtr0mtr.h" #include "mtr0mtr.h"
#ifndef UNIV_HOTBACKUP
#include "buf0flu.h" #include "buf0flu.h"
#include "buf0lru.h" #include "buf0lru.h"
#include "buf0rea.h" #include "buf0rea.h"
...@@ -180,6 +181,7 @@ buf_page_peek_if_too_old( ...@@ -180,6 +181,7 @@ buf_page_peek_if_too_old(
return(!buf_page_peek_if_young(bpage)); return(!buf_page_peek_if_young(bpage));
} }
} }
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//** /*********************************************************************//**
Gets the state of a block. Gets the state of a block.
......
...@@ -750,6 +750,7 @@ ulint ...@@ -750,6 +750,7 @@ ulint
dict_table_zip_size( dict_table_zip_size(
/*================*/ /*================*/
const dict_table_t* table); /*!< in: table */ const dict_table_t* table); /*!< in: table */
#ifndef UNIV_HOTBACKUP
/*********************************************************************//** /*********************************************************************//**
Obtain exclusive locks on all index trees of the table. This is to prevent Obtain exclusive locks on all index trees of the table. This is to prevent
accessing index trees while InnoDB is updating internal metadata for accessing index trees while InnoDB is updating internal metadata for
...@@ -766,6 +767,7 @@ void ...@@ -766,6 +767,7 @@ void
dict_table_x_unlock_indexes( dict_table_x_unlock_indexes(
/*========================*/ /*========================*/
dict_table_t* table); /*!< in: table */ dict_table_t* table); /*!< in: table */
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Checks if a column is in the ordering columns of the clustered index of a Checks if a column is in the ordering columns of the clustered index of a
table. Column prefixes are treated like whole columns. table. Column prefixes are treated like whole columns.
...@@ -1251,7 +1253,7 @@ UNIV_INTERN ...@@ -1251,7 +1253,7 @@ UNIV_INTERN
void void
dict_close(void); dict_close(void);
/*============*/ /*============*/
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Check whether the table is corrupted. Check whether the table is corrupted.
@return nonzero for corrupted table, zero for valid tables */ @return nonzero for corrupted table, zero for valid tables */
...@@ -1272,6 +1274,7 @@ dict_index_is_corrupted( ...@@ -1272,6 +1274,7 @@ dict_index_is_corrupted(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
__attribute__((nonnull, pure, warn_unused_result)); __attribute__((nonnull, pure, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Flags an index and table corrupted both in the data dictionary cache Flags an index and table corrupted both in the data dictionary cache
and in the system table SYS_INDEXES. */ and in the system table SYS_INDEXES. */
......
...@@ -491,6 +491,7 @@ dict_table_zip_size( ...@@ -491,6 +491,7 @@ dict_table_zip_size(
return(dict_table_flags_to_zip_size(table->flags)); 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 Obtain exclusive locks on all index trees of the table. This is to prevent
accessing index trees while InnoDB is updating internal metadata for accessing index trees while InnoDB is updating internal metadata for
...@@ -533,6 +534,7 @@ dict_table_x_unlock_indexes( ...@@ -533,6 +534,7 @@ dict_table_x_unlock_indexes(
rw_lock_x_unlock(dict_index_get_lock(index)); rw_lock_x_unlock(dict_index_get_lock(index));
} }
} }
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Gets the number of fields in the internal representation of an index, Gets the number of fields in the internal representation of an index,
including fields added by the dictionary system. including fields added by the dictionary system.
......
...@@ -762,7 +762,6 @@ struct log_struct{ ...@@ -762,7 +762,6 @@ struct log_struct{
buffer */ buffer */
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
mutex_t mutex; /*!< mutex protecting the log */ mutex_t mutex; /*!< mutex protecting the log */
#endif /* !UNIV_HOTBACKUP */
mutex_t log_flush_order_mutex;/*!< mutex to serialize access to mutex_t log_flush_order_mutex;/*!< mutex to serialize access to
the flush list when we are putting the flush list when we are putting
...@@ -772,6 +771,7 @@ struct log_struct{ ...@@ -772,6 +771,7 @@ struct log_struct{
mtr_commit and still ensure that mtr_commit and still ensure that
insertions in the flush_list happen insertions in the flush_list happen
in the LSN order. */ in the LSN order. */
#endif /* !UNIV_HOTBACKUP */
byte* buf_ptr; /* unaligned log buffer */ byte* buf_ptr; /* unaligned log buffer */
byte* buf; /*!< log buffer */ byte* buf; /*!< log buffer */
ulint buf_size; /*!< log buffer size in bytes */ ulint buf_size; /*!< log buffer size in bytes */
......
...@@ -309,7 +309,7 @@ to original un-instrumented file I/O APIs */ ...@@ -309,7 +309,7 @@ to original un-instrumented file I/O APIs */
os_file_create_func(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, access, success) \
os_file_create_simple_func(name, create_mode, access, success) os_file_create_simple_func(name, create, access, success)
# define os_file_create_simple_no_error_handling( \ # define os_file_create_simple_no_error_handling( \
key, name, create_mode, access, success) \ key, name, create_mode, access, success) \
......
...@@ -111,13 +111,13 @@ extern ulint srv_max_file_format_at_startup; ...@@ -111,13 +111,13 @@ extern ulint srv_max_file_format_at_startup;
/** Place locks to records only i.e. do not use next-key locking except /** Place locks to records only i.e. do not use next-key locking except
on duplicate key checking and foreign key checking */ on duplicate key checking and foreign key checking */
extern ibool srv_locks_unsafe_for_binlog; extern ibool srv_locks_unsafe_for_binlog;
#endif /* !UNIV_HOTBACKUP */
/* If this flag is TRUE, then we will use the native aio of the /* 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 OS (provided we compiled Innobase with it in), otherwise we will
use simulated aio we build below with threads. use simulated aio we build below with threads.
Currently we support native aio on windows and linux */ Currently we support native aio on windows and linux */
extern my_bool srv_use_native_aio; extern my_bool srv_use_native_aio;
#endif /* !UNIV_HOTBACKUP */
#ifdef __WIN__ #ifdef __WIN__
extern ibool srv_use_native_conditions; extern ibool srv_use_native_conditions;
#endif #endif
......
...@@ -222,7 +222,6 @@ UNIV_INLINE ...@@ -222,7 +222,6 @@ UNIV_INLINE
trx_id_t trx_id_t
trx_sys_get_new_trx_id(void); trx_sys_get_new_trx_id(void);
/*========================*/ /*========================*/
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */
...@@ -239,7 +238,6 @@ trx_write_trx_id( ...@@ -239,7 +238,6 @@ trx_write_trx_id(
/*=============*/ /*=============*/
byte* ptr, /*!< in: pointer to memory where written */ byte* ptr, /*!< in: pointer to memory where written */
trx_id_t id); /*!< in: id */ trx_id_t id); /*!< in: id */
#ifndef UNIV_HOTBACKUP
/*****************************************************************//** /*****************************************************************//**
Reads a trx id from an index page. In case that the id size changes in Reads a trx id from an index page. In case that the id size changes in
some future version, this function should be used instead of some future version, this function should be used instead of
...@@ -572,7 +570,6 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO. */ ...@@ -572,7 +570,6 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO. */
#define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE #define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE
/* @} */ /* @} */
#ifndef UNIV_HOTBACKUP
/** File format tag */ /** File format tag */
/* @{ */ /* @{ */
/** The offset of the file format tag on the trx system header page /** The offset of the file format tag on the trx system header page
...@@ -591,6 +588,7 @@ identifier is added to this 64-bit constant. */ ...@@ -591,6 +588,7 @@ identifier is added to this 64-bit constant. */
| TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW) | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW)
/* @} */ /* @} */
#ifndef UNIV_HOTBACKUP
/** Doublewrite control struct */ /** Doublewrite control struct */
struct trx_doublewrite_struct{ struct trx_doublewrite_struct{
mutex_t mutex; /*!< mutex protecting the first_free field and mutex_t mutex; /*!< mutex protecting the first_free field and
......
...@@ -24,7 +24,9 @@ but is included in mem0mem.* ! ...@@ -24,7 +24,9 @@ but is included in mem0mem.* !
Created 6/9/1994 Heikki Tuuri Created 6/9/1994 Heikki Tuuri
*************************************************************************/ *************************************************************************/
#include "ha_prototypes.h" #ifndef UNIV_HOTBACKUP
# include "ha_prototypes.h"
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_MEM_DEBUG #ifdef UNIV_MEM_DEBUG
# ifndef UNIV_HOTBACKUP # ifndef UNIV_HOTBACKUP
......
...@@ -303,6 +303,7 @@ UNIV_INTERN ulint os_n_pending_writes = 0; ...@@ -303,6 +303,7 @@ UNIV_INTERN ulint os_n_pending_writes = 0;
UNIV_INTERN ulint os_n_pending_reads = 0; UNIV_INTERN ulint os_n_pending_reads = 0;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Validates the consistency the aio system some of the time. Validates the consistency the aio system some of the time.
@return TRUE if ok or the check was skipped */ @return TRUE if ok or the check was skipped */
...@@ -329,6 +330,7 @@ os_aio_validate_skip(void) ...@@ -329,6 +330,7 @@ os_aio_validate_skip(void)
os_aio_validate_count = OS_AIO_VALIDATE_SKIP; os_aio_validate_count = OS_AIO_VALIDATE_SKIP;
return(os_aio_validate()); return(os_aio_validate());
} }
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
#ifdef __WIN__ #ifdef __WIN__
......
...@@ -4433,7 +4433,9 @@ page_zip_reorganize( ...@@ -4433,7 +4433,9 @@ page_zip_reorganize(
dict_index_t* index, /*!< in: index of the B-tree node */ dict_index_t* index, /*!< in: index of the B-tree node */
mtr_t* mtr) /*!< in: mini-transaction */ mtr_t* mtr) /*!< in: mini-transaction */
{ {
#ifndef UNIV_HOTBACKUP
buf_pool_t* buf_pool = buf_pool_from_block(block); 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_zip_des_t* page_zip = buf_block_get_page_zip(block);
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
buf_block_t* temp_block; buf_block_t* temp_block;
......
...@@ -134,12 +134,12 @@ UNIV_INTERN mysql_pfs_key_t trx_doublewrite_mutex_key; ...@@ -134,12 +134,12 @@ UNIV_INTERN mysql_pfs_key_t trx_doublewrite_mutex_key;
UNIV_INTERN mysql_pfs_key_t file_format_max_mutex_key; UNIV_INTERN mysql_pfs_key_t file_format_max_mutex_key;
#endif /* UNIV_PFS_MUTEX */ #endif /* UNIV_PFS_MUTEX */
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */
uint trx_rseg_n_slots_debug = 0; uint trx_rseg_n_slots_debug = 0;
#endif #endif
#ifndef UNIV_HOTBACKUP
/** This is used to track the maximum file format id known to InnoDB. It's /** This is used to track the maximum file format id known to InnoDB. It's
updated via SET GLOBAL innodb_file_format_max = 'x' or when we open updated via SET GLOBAL innodb_file_format_max = 'x' or when we open
or create a table. */ or create a table. */
......
...@@ -25,7 +25,9 @@ Created 1/30/1994 Heikki Tuuri ...@@ -25,7 +25,9 @@ Created 1/30/1994 Heikki Tuuri
#include "univ.i" #include "univ.i"
#include "ut0dbg.h" #include "ut0dbg.h"
#include "ha_prototypes.h" #ifndef UNIV_HOTBACKUP
# include "ha_prototypes.h"
#endif /* !UNIV_HOTBACKUP */
#if defined(__GNUC__) && (__GNUC__ > 2) #if defined(__GNUC__) && (__GNUC__ > 2)
#else #else
...@@ -56,7 +58,7 @@ ut_dbg_assertion_failed( ...@@ -56,7 +58,7 @@ ut_dbg_assertion_failed(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n", fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n",
innobase_basename(file), line); file, line);
#else /* UNIV_HOTBACKUP */ #else /* UNIV_HOTBACKUP */
fprintf(stderr, fprintf(stderr,
" InnoDB: Assertion failure in thread %lu" " InnoDB: Assertion failure in thread %lu"
......
...@@ -245,7 +245,9 @@ ut_print_timestamp( ...@@ -245,7 +245,9 @@ ut_print_timestamp(
(int)cal_tm.wMinute, (int)cal_tm.wMinute,
(int)cal_tm.wSecond); (int)cal_tm.wSecond);
#else #else
#ifdef HAVE_LOCALTIME_R
struct tm cal_tm; struct tm cal_tm;
#endif
struct tm* cal_tm_ptr; struct tm* cal_tm_ptr;
time_t tm; time_t tm;
...@@ -288,7 +290,9 @@ ut_sprintf_timestamp( ...@@ -288,7 +290,9 @@ ut_sprintf_timestamp(
(int)cal_tm.wMinute, (int)cal_tm.wMinute,
(int)cal_tm.wSecond); (int)cal_tm.wSecond);
#else #else
#ifdef HAVE_LOCALTIME_R
struct tm cal_tm; struct tm cal_tm;
#endif
struct tm* cal_tm_ptr; struct tm* cal_tm_ptr;
time_t tm; time_t tm;
...@@ -333,7 +337,9 @@ ut_sprintf_timestamp_without_extra_chars( ...@@ -333,7 +337,9 @@ ut_sprintf_timestamp_without_extra_chars(
(int)cal_tm.wMinute, (int)cal_tm.wMinute,
(int)cal_tm.wSecond); (int)cal_tm.wSecond);
#else #else
#ifdef HAVE_LOCALTIME_R
struct tm cal_tm; struct tm cal_tm;
#endif
struct tm* cal_tm_ptr; struct tm* cal_tm_ptr;
time_t tm; time_t tm;
...@@ -374,7 +380,9 @@ ut_get_year_month_day( ...@@ -374,7 +380,9 @@ ut_get_year_month_day(
*month = (ulint)cal_tm.wMonth; *month = (ulint)cal_tm.wMonth;
*day = (ulint)cal_tm.wDay; *day = (ulint)cal_tm.wDay;
#else #else
#ifdef HAVE_LOCALTIME_R
struct tm cal_tm; struct tm cal_tm;
#endif
struct tm* cal_tm_ptr; struct tm* cal_tm_ptr;
time_t tm; time_t tm;
......
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