diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2016-12-30 15:04:10 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2016-12-30 16:05:42 +0200 |
commit | 63574f1275eda0f0ed439f4896b6e7daf6832a8f (patch) | |
tree | aead50be1af894234be2be8d06c341e328bf8636 /storage/innobase | |
parent | 9ebd76733198578e0ac8ca854d667ab114b3d581 (diff) | |
download | mariadb-git-63574f1275eda0f0ed439f4896b6e7daf6832a8f.tar.gz |
MDEV-11690 Remove UNIV_HOTBACKUP
The InnoDB source code contains quite a few references to a closed-source
hot backup tool which was originally called InnoDB Hot Backup (ibbackup)
and later incorporated in MySQL Enterprise Backup.
The open source backup tool XtraBackup uses the full database for recovery.
So, the references to UNIV_HOTBACKUP are only cluttering the source code.
Diffstat (limited to 'storage/innobase')
106 files changed, 261 insertions, 2930 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 6bda054503e..8acb96f1910 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -37,7 +37,6 @@ Created 6/2/1994 Heikki Tuuri #include "page0zip.h" #include "gis0rtree.h" -#ifndef UNIV_HOTBACKUP #include "btr0cur.h" #include "btr0sea.h" #include "btr0pcur.h" @@ -64,8 +63,6 @@ btr_can_merge_with_page( buf_block_t** merge_block, /*!< out: the merge block */ mtr_t* mtr); /*!< in: mini-transaction */ -#endif /* UNIV_HOTBACKUP */ - /**************************************************************//** Report that an index page is corrupted. */ void @@ -80,7 +77,6 @@ btr_corruption_report( << " of table " << index->table->name; } -#ifndef UNIV_HOTBACKUP /* Latching strategy of the InnoDB B-tree -------------------------------------- @@ -174,7 +170,6 @@ btr_root_block_get( buf_block_t* block = btr_block_get(page_id, page_size, mode, index, mtr); - if (!block) { if (index && index->table) { index->table->is_encrypted = TRUE; @@ -1526,7 +1521,6 @@ btr_write_autoinc(dict_index_t* index, ib_uint64_t autoinc, bool reset) fil_space_release(space); } } -#endif /* !UNIV_HOTBACKUP */ /*************************************************************//** Reorganizes an index page. @@ -1554,9 +1548,7 @@ btr_page_reorganize_low( mtr_t* mtr) /*!< in/out: mini-transaction */ { buf_block_t* block = page_cur_get_block(cursor); -#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; @@ -1581,12 +1573,7 @@ btr_page_reorganize_low( /* Turn logging off */ mtr_log_t log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE); -#ifndef UNIV_HOTBACKUP temp_block = buf_block_alloc(buf_pool); -#else /* !UNIV_HOTBACKUP */ - ut_ad(block == back_block1); - temp_block = back_block2; -#endif /* !UNIV_HOTBACKUP */ temp_page = temp_block->frame; MONITOR_INC(MONITOR_INDEX_REORG_ATTEMPTS); @@ -1599,11 +1586,9 @@ btr_page_reorganize_low( /* Copy the old page to temporary space */ buf_frame_copy(temp_page, page); -#ifndef UNIV_HOTBACKUP if (!recovery) { btr_search_drop_page_hash_index(block); } -#endif /* !UNIV_HOTBACKUP */ /* Save the cursor position. */ pos = page_rec_get_n_recs_before(page_cur_get_rec(cursor)); @@ -1678,12 +1663,10 @@ btr_page_reorganize_low( goto func_exit; } -#ifndef UNIV_HOTBACKUP if (!recovery && !dict_table_is_locking_disabled(index->table)) { /* Update the record lock bitmaps */ lock_move_reorganize_page(block, temp_block); } -#endif /* !UNIV_HOTBACKUP */ data_size2 = page_get_data_size(page); max_ins_size2 = page_get_max_insert_size_after_reorganize(page, 1); @@ -1712,14 +1695,11 @@ func_exit: #ifdef UNIV_ZIP_DEBUG ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ -#ifndef UNIV_HOTBACKUP buf_block_free(temp_block); -#endif /* !UNIV_HOTBACKUP */ /* Restore logging mode */ mtr_set_log_mode(mtr, log_mode); -#ifndef UNIV_HOTBACKUP if (success) { mlog_id_t type; byte* log_ptr; @@ -1748,7 +1728,6 @@ func_exit: MONITOR_INC(MONITOR_INDEX_REORG_SUCCESSFUL); } -#endif /* !UNIV_HOTBACKUP */ return(success); } @@ -1784,7 +1763,6 @@ btr_page_reorganize_block( return(btr_page_reorganize_low(recovery, z_level, &cur, index, mtr)); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Reorganizes an index page. @@ -1806,7 +1784,6 @@ btr_page_reorganize( return(btr_page_reorganize_low(false, page_zip_level, cursor, index, mtr)); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of reorganizing a page. @@ -1850,7 +1827,6 @@ btr_parse_page_reorganize( return(ptr); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Empties an index page. @see btr_page_create(). */ static @@ -3345,9 +3321,6 @@ btr_set_min_rec_mark_log( /* Write rec offset as a 2-byte ulint */ mlog_catenate_ulint(mtr, page_offset(rec), MLOG_2BYTES); } -#else /* !UNIV_HOTBACKUP */ -# define btr_set_min_rec_mark_log(rec,comp,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Parses the redo log record for setting an index record as the predefined @@ -3405,7 +3378,6 @@ btr_set_min_rec_mark( } } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Deletes on the upper level the node pointer to a page. */ void @@ -5497,7 +5469,6 @@ btr_can_merge_with_page( goto error; } - max_ins_size = page_get_max_insert_size(mpage, n_recs); if (data_size > max_ins_size) { @@ -5531,5 +5502,3 @@ error: *merge_block = NULL; DBUG_RETURN(false); } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index d8a2e15d1eb..87d88cea820 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -50,7 +50,6 @@ Created 10/16/1994 Heikki Tuuri #endif #include "row0upd.h" -#ifndef UNIV_HOTBACKUP #include "mtr0log.h" #include "page0page.h" #include "page0zip.h" @@ -151,9 +150,7 @@ can be released by page reorganize, then it is reorganized */ + (sample) - 1 + (ext_size) + (not_empty)) / ((sample) + (ext_size))) /* @} */ -#endif /* !UNIV_HOTBACKUP */ -#ifndef UNIV_HOTBACKUP /*******************************************************************//** Marks all extern fields in a record as owned by the record. This function should be called if the delete mark of a record is removed: a not delete @@ -212,9 +209,7 @@ btr_rec_free_externally_stored_fields( mtr_t* mtr); /*!< in: mini-transaction handle which contains an X-latch to record page and to the index tree */ -#endif /* !UNIV_HOTBACKUP */ -#ifndef UNIV_HOTBACKUP /*==================== B-TREE SEARCH =========================*/ #if MTR_MEMO_PAGE_S_FIX != RW_S_LATCH @@ -3257,7 +3252,6 @@ btr_cur_pessimistic_insert( ut_ad(page_rec_get_next(btr_cur_get_rec(cursor)) == *rec || dict_index_is_spatial(index)); - if (!(flags & BTR_NO_LOCKING_FLAG)) { ut_ad(!dict_table_is_temporary(index->table)); if (dict_index_is_spatial(index)) { @@ -3425,7 +3419,6 @@ btr_cur_update_in_place_log( row_upd_index_write_log(update, log_ptr, mtr); } -#endif /* UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of updating a record in-place. @@ -3504,7 +3497,6 @@ func_exit: return(ptr); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** See if there is enough place in the page modification log to log an update-in-place. @@ -4525,7 +4517,6 @@ btr_cur_del_mark_set_clust_rec_log( mlog_close(mtr, log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Parses the redo log record for delete marking or unmarking of a clustered @@ -4607,7 +4598,6 @@ btr_cur_parse_del_mark_set_clust_rec( return(ptr); } -#ifndef UNIV_HOTBACKUP /***********************************************************//** Marks a clustered index record deleted. Writes an undo log record to undo log on this delete marking. Writes in the trx id field the id @@ -4729,7 +4719,6 @@ btr_cur_del_mark_set_sec_rec_log( mlog_close(mtr, log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Parses the redo log record for delete marking or unmarking of a secondary @@ -4774,7 +4763,6 @@ btr_cur_parse_del_mark_set_sec_rec( return(ptr); } -#ifndef UNIV_HOTBACKUP /***********************************************************//** Sets a secondary index record delete mark to TRUE or FALSE. @return DB_SUCCESS, DB_LOCK_WAIT, or error number */ @@ -5367,7 +5355,6 @@ btr_estimate_n_rows_in_range_on_level( goto inexact; } - page = buf_block_get_frame(block); /* It is possible that the tree has been reorganized in the @@ -5603,7 +5590,6 @@ btr_estimate_n_rows_in_range_low( << " index: " << index->name; } - ut_ad(page_rec_is_supremum(btr_cur_get_rec(&cursor))); /* The range specified is wihout a right border, just @@ -6090,7 +6076,6 @@ btr_estimate_number_of_different_key_vals( } } - if (n_cols == dict_index_get_n_unique_in_tree(index)) { /* If there is more than one leaf page in the tree, @@ -6606,7 +6591,6 @@ struct btr_blob_log_check_t { } }; - /*******************************************************************//** Stores the fields in big_rec_vec to the tablespace and puts pointers to them in rec. The extern flags in rec will have to be set beforehand. @@ -7790,4 +7774,3 @@ btr_rec_copy_externally_stored_field( return(btr_copy_externally_stored_field(len, data, page_size, local_len, heap)); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 71a93744ef4..7f06aed9ff0 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -26,7 +26,6 @@ Modified 30/07/2014 Jan Lindström jan.lindstrom@mariadb.com *******************************************************/ #include "btr0defragment.h" -#ifndef UNIV_HOTBACKUP #include "btr0btr.h" #include "btr0cur.h" #include "btr0sea.h" @@ -847,5 +846,3 @@ DECLARE_THREAD(btr_defragment_thread)( os_thread_exit(); OS_THREAD_DUMMY_RETURN; } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index ffd739bc686..935b7fadafa 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -49,7 +49,6 @@ Created 11/5/1995 Heikki Tuuri #include "fil0fil.h" #include "fil0crypt.h" #include "fsp0sysspace.h" -#ifndef UNIV_HOTBACKUP #include "buf0buddy.h" #include "lock0lock.h" #include "sync0rw.h" @@ -59,7 +58,6 @@ Created 11/5/1995 Heikki Tuuri #include "trx0purge.h" #include "log0log.h" #include "dict0stats_bg.h" -#endif /* !UNIV_HOTBACKUP */ #include "srv0srv.h" #include "srv0start.h" #include "dict0dict.h" @@ -323,7 +321,7 @@ that the whole area may be needed in the near future, and issue the read requests for the whole area. */ -#if (!(defined(UNIV_HOTBACKUP) || defined(UNIV_INNOCHECKSUM))) +#ifndef UNIV_INNOCHECKSUM /** Value in microseconds */ static const int WAIT_FOR_READ = 100; static const int WAIT_FOR_WRITE = 100; @@ -591,7 +589,7 @@ buf_block_alloc( return(block); } -#endif /* !UNIV_HOTBACKUP && !UNIV_INNOCHECKSUM */ +#endif /* !UNIV_INNOCHECKSUM */ /** Checks if a page contains only zeroes. @param[in] read_buf database page @@ -883,7 +881,7 @@ buf_page_is_corrupted( return(TRUE); } -#if !defined(UNIV_HOTBACKUP) && !defined(UNIV_INNOCHECKSUM) +#ifndef UNIV_INNOCHECKSUM if (check_lsn && recv_lsn_checks_on) { lsn_t current_lsn; const lsn_t page_lsn @@ -913,7 +911,7 @@ buf_page_is_corrupted( } } -#endif /* !UNIV_HOTBACKUP && !UNIV_INNOCHECKSUM */ +#endif /* !UNIV_INNOCHECKSUM */ /* Check whether the checksum fields have correct values */ @@ -1264,9 +1262,7 @@ buf_page_print( const page_size_t& page_size, ulint flags) { -#ifndef UNIV_HOTBACKUP dict_index_t* index; -#endif /* !UNIV_HOTBACKUP */ if (!(flags & BUF_PAGE_PRINT_NO_FULL)) { @@ -1372,7 +1368,6 @@ buf_page_print( read_buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); } -#ifndef UNIV_HOTBACKUP if (mach_read_from_2(read_buf + TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE) == TRX_UNDO_INSERT) { fprintf(stderr, @@ -1383,7 +1378,6 @@ buf_page_print( fprintf(stderr, "InnoDB: Page may be an update undo log page\n"); } -#endif /* !UNIV_HOTBACKUP */ switch (fil_page_get_type(read_buf)) { index_id_t index_id; @@ -1394,7 +1388,6 @@ buf_page_print( "InnoDB: Page may be an index page where" " index id is " << index_id; -#ifndef UNIV_HOTBACKUP index = dict_index_find_on_id_low(index_id); if (index) { ib::info() @@ -1402,7 +1395,6 @@ buf_page_print( << " is " << index->name << " in table " << index->table->name; } -#endif /* !UNIV_HOTBACKUP */ break; case FIL_PAGE_INODE: fputs("InnoDB: Page may be an 'inode' page\n", stderr); @@ -1449,8 +1441,6 @@ buf_page_print( ut_ad(flags & BUF_PAGE_PRINT_NO_CRASH); } -#ifndef UNIV_HOTBACKUP - # ifdef PFS_GROUP_BUFFER_SYNC extern mysql_pfs_key_t buffer_block_mutex_key; @@ -3936,7 +3926,6 @@ buf_block_init_low( block->n_bytes = 0; block->left_side = TRUE; } -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Decompress a block. @@ -4007,7 +3996,6 @@ buf_zip_decompress( return(FALSE); } -#ifndef UNIV_HOTBACKUP /** Get a buffer block from an adaptive hash index pointer. This function does not return if the block is not identified. @param[in] ptr pointer to within a page frame @@ -7339,57 +7327,6 @@ buf_pool_check_no_pending_io(void) return(pending_io); } -#if 0 -Code currently not used -/*********************************************************************//** -Gets the current length of the free list of buffer blocks. -@return length of the free list */ -ulint -buf_get_free_list_len(void) -/*=======================*/ -{ - ulint len; - - buf_pool_mutex_enter(buf_pool); - - len = UT_LIST_GET_LEN(buf_pool->free); - - buf_pool_mutex_exit(buf_pool); - - return(len); -} -#endif - -#else /* !UNIV_HOTBACKUP */ - -/** Inits a page to the buffer buf_pool, for use in mysqlbackup --restore. -@param[in] page_id page id -@param[in] page_size page size -@param[in,out] block block to init */ -void -buf_page_init_for_backup_restore( - const page_id_t& page_id, - const page_size_t& page_size, - buf_block_t* block) -{ - block->page.state = BUF_BLOCK_FILE_PAGE; - block->page.id = page_id; - block->page.size.copy_from(page_size); - - page_zip_des_init(&block->page.zip); - - /* We assume that block->page.data has been allocated - with page_size == univ_page_size. */ - if (page_size.is_compressed()) { - page_zip_set_size(&block->page.zip, page_size.physical()); - block->page.zip.data = block->frame + page_size.logical(); - } else { - page_zip_set_size(&block->page.zip, 0); - } -} - -#endif /* !UNIV_HOTBACKUP */ - /** Print the given page_id_t object. @param[in,out] out the output stream @param[in] page_id the page_id_t object to be printed diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index ff1d2057e6a..5f46576ad7e 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -40,8 +40,6 @@ Created 2011/12/19 #include "fil0crypt.h" #include "fil0pagecompress.h" -#ifndef UNIV_HOTBACKUP - /** The doublewrite buffer */ buf_dblwr_t* buf_dblwr = NULL; @@ -1195,7 +1193,6 @@ try_again: } else { ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE); - UNIV_MEM_ASSERT_RW(frame, bpage->size.logical()); @@ -1360,4 +1357,3 @@ retry: blocks. Next do the write to the intended position. */ buf_dblwr_write_block_to_datafile(bpage, sync); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 179430a0d27..b82c4db18ad 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -41,7 +41,6 @@ Created 11/11/1995 Heikki Tuuri #include "srv0start.h" #include "srv0srv.h" #include "page0zip.h" -#ifndef UNIV_HOTBACKUP #include "ut0byte.h" #include "page0page.h" #include "fil0fil.h" @@ -806,7 +805,6 @@ buf_flush_write_complete( buf_dblwr_update(bpage, flush_type); } -#endif /* !UNIV_HOTBACKUP */ /** Calculate the checksum of a page from compressed table and update the page. @@ -995,7 +993,6 @@ buf_flush_init_for_writing( checksum); } -#ifndef UNIV_HOTBACKUP /********************************************************************//** Does an asynchronous write of a buffer page. NOTE: in simulated aio and also when the doublewrite buffer is used, we must call @@ -2264,8 +2261,6 @@ buf_flush_single_page_from_LRU( scanned); } - - ut_ad(!buf_pool_mutex_own(buf_pool)); return(freed); } @@ -2521,7 +2516,6 @@ page_cleaner_flush_pages_recommendation( lsn_avg_rate = (lsn_avg_rate + lsn_rate) / 2; - /* aggregate stats of all slots */ mutex_enter(&page_cleaner->mutex); @@ -3679,7 +3673,6 @@ buf_flush_validate( } #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ /******************************************************************//** Check if there are any dirty pages that belong to a space id in the flush diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 5d2077763a6..6a57e6746ff 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -28,7 +28,6 @@ Created 11/5/1995 Heikki Tuuri #include "buf0lru.ic" #endif /* UNIV_NOINL */ -#ifndef UNIV_HOTBACKUP #include "ut0byte.h" #include "ut0rnd.h" #include "sync0rw.h" @@ -2791,4 +2790,3 @@ buf_LRU_print(void) } } #endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc index 4b788c8952c..0ccf5868d14 100644 --- a/storage/innobase/data/data0data.cc +++ b/storage/innobase/data/data0data.cc @@ -31,7 +31,6 @@ Created 5/30/1994 Heikki Tuuri #include "data0data.ic" #endif -#ifndef UNIV_HOTBACKUP #include "rem0rec.h" #include "rem0cmp.h" #include "page0page.h" @@ -40,8 +39,6 @@ Created 5/30/1994 Heikki Tuuri #include "btr0cur.h" #include "row0upd.h" -#endif /* !UNIV_HOTBACKUP */ - #ifdef UNIV_DEBUG /** Dummy variable to catch access to uninitialized fields. In the debug version, dtuple_create() will make all fields of dtuple_t point @@ -54,7 +51,6 @@ ulint data_dummy; # endif /* !UNIV_DEBUG_VALGRIND */ #endif /* UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP /** Compare two data tuples. @param[in] tuple1 first data tuple @param[in] tuple2 second data tuple @@ -159,7 +155,6 @@ dump: return(TRUE); } -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /**********************************************************//** @@ -255,7 +250,6 @@ dtuple_validate( } #endif /* UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP /*************************************************************//** Pretty prints a dfield value according to its data type. */ void @@ -848,4 +842,3 @@ dfield_t::clone( return(obj); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/data/data0type.cc b/storage/innobase/data/data0type.cc index 8fb3761531c..cad165d1489 100644 --- a/storage/innobase/data/data0type.cc +++ b/storage/innobase/data/data0type.cc @@ -31,7 +31,6 @@ Created 1/16/1996 Heikki Tuuri #include "data0type.ic" #endif -#ifndef UNIV_HOTBACKUP /* At the database startup we store the default-charset collation number of this MySQL installation to this global variable. If we have < 4.1.2 format column definitions, or records in the insert buffer, we use this @@ -78,7 +77,6 @@ dtype_get_at_most_n_mbchars( return(data_len); } -#endif /* UNIV_HOTBACKUP */ /*********************************************************************//** Checks if a data main type is a string type. Also a BLOB is considered a @@ -174,14 +172,11 @@ dtype_validate( ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS); } -#ifndef UNIV_HOTBACKUP ut_a(dtype_get_mbminlen(type) <= dtype_get_mbmaxlen(type)); -#endif /* !UNIV_HOTBACKUP */ return(TRUE); } -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Prints a data type structure. */ void @@ -299,4 +294,3 @@ dtype_print( fprintf(stderr, " len %lu", (ulong) len); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index d7d81661722..37c6341a293 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -55,7 +55,6 @@ Issue a warning that the row is too big. */ void ib_warn_row_too_big(const dict_table_t* table); -#ifndef UNIV_HOTBACKUP #include "btr0btr.h" #include "btr0cur.h" #include "btr0sea.h" @@ -551,7 +550,6 @@ dict_table_close( } } } -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Closes the only open handle to a table and drops a table while assuring @@ -753,7 +751,6 @@ dict_table_get_nth_v_col_mysql( return(dict_table_get_nth_v_col(table, i)); } -#ifndef UNIV_HOTBACKUP /** Allocate and init the autoinc latch of a given table. This function must not be called concurrently on the same table object. @param[in,out] table_void table whose autoinc latch to create */ @@ -782,7 +779,6 @@ dict_index_zip_pad_alloc( mutex_create(LATCH_ID_ZIP_PAD_MUTEX, index->zip_pad.mutex); } - /********************************************************************//** Acquire the autoinc lock. */ void @@ -844,7 +840,6 @@ dict_table_autoinc_unlock( { mutex_exit(table->autoinc_mutex); } -#endif /* !UNIV_HOTBACKUP */ /** Looks for column n in an index. @param[in] index index @@ -903,7 +898,6 @@ dict_index_get_nth_col_or_prefix_pos( return(ULINT_UNDEFINED); } -#ifndef UNIV_HOTBACKUP /** Returns TRUE if the index contains a column or a prefix of that column. @param[in] index index @param[in] n column number @@ -1242,7 +1236,6 @@ dict_table_open_on_name( DBUG_RETURN(table); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Adds system columns to a table object. */ @@ -1292,7 +1285,6 @@ dict_table_add_system_columns( #endif } -#ifndef UNIV_HOTBACKUP /** Mark if table has big rows. @param[in,out] table table handler */ void @@ -2874,7 +2866,6 @@ found: return(TRUE); } -#endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** Adds a column to index. */ @@ -2957,7 +2948,6 @@ dict_index_add_col( } } -#ifndef UNIV_HOTBACKUP /*******************************************************************//** Copies fields contained in index2 to index1. */ static @@ -3171,7 +3161,6 @@ dict_index_build_internal_clust( new_index, table, dict_table_get_sys_col(table, DATA_TRX_ID), 0); - for (i = 0; i < trx_id_pos; i++) { ulint fixed_size = dict_col_get_fixed_size( @@ -3489,7 +3478,6 @@ dict_foreign_find( return(NULL); } - /*********************************************************************//** Tries to find an index whose first fields are the columns in the array, in the same order and is not marked for deletion and is not the same @@ -3675,7 +3663,6 @@ dict_foreign_add_to_cache( } - if (ref_table && !for_in_cache->referenced_table) { ulint index_error; ulint err_col; @@ -4052,7 +4039,6 @@ dict_scan_col( return(ptr); } - /*********************************************************************//** Open a table from its database and table name, this is currently used by foreign constraint parser to get the referenced table. @@ -6348,7 +6334,6 @@ dict_set_merge_threshold_all_debug( } #endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Inits dict_ind_redundant. */ @@ -6372,7 +6357,6 @@ dict_ind_init(void) dict_ind_redundant->cached = TRUE; } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Frees dict_ind_redundant. */ static @@ -7228,7 +7212,6 @@ dict_index_zip_failure( dict_index_zip_pad_unlock(index); } - /*********************************************************************//** Return the optimal page size, for which page will likely compress. @return page size beyond which page might not compress */ @@ -7444,7 +7427,6 @@ dict_space_get_id( return(id); } -#endif /* !UNIV_HOTBACKUP */ /** Determine the extent size (in pages) for the given table @param[in] table the table whose extent size is being diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index b150c1eb7a0..f4726ecd329 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -24,10 +24,8 @@ Data dictionary memory object creation Created 1/8/1996 Heikki Tuuri ***********************************************************************/ -#ifndef UNIV_HOTBACKUP #include "ha_prototypes.h" #include <mysql_com.h> -#endif /* !UNIV_HOTBACKUP */ #include "dict0mem.h" @@ -41,11 +39,7 @@ Created 1/8/1996 Heikki Tuuri #include "dict0dict.h" #include "fts0priv.h" #include "ut0crc32.h" - -#ifndef UNIV_HOTBACKUP -# include "lock0lock.h" -#endif /* !UNIV_HOTBACKUP */ - +#include "lock0lock.h" #include "sync0sync.h" #include <iostream> @@ -152,7 +146,6 @@ dict_mem_table_create( dict_table_stats_lock() will not be noop. */ dict_table_stats_latch_create(table, true); -#ifndef UNIV_HOTBACKUP table->autoinc_lock = static_cast<ib_lock_t*>( mem_heap_alloc(heap, lock_get_size())); @@ -169,7 +162,6 @@ dict_mem_table_create( } else { table->fts = NULL; } -#endif /* !UNIV_HOTBACKUP */ if (DICT_TF_HAS_SHARED_SPACE(table->flags)) { dict_get_and_save_space_name(table, true); @@ -201,10 +193,8 @@ dict_mem_table_free( fts_free(table); } } -#ifndef UNIV_HOTBACKUP - dict_table_autoinc_destroy(table); -#endif /* UNIV_HOTBACKUP */ + dict_table_autoinc_destroy(table); dict_mem_table_free_foreign_vcol_set(table); dict_table_stats_latch_destroy(table); @@ -432,7 +422,6 @@ dict_mem_table_add_s_col( table->s_cols->push_back(s_col); } - /**********************************************************************//** Renames a column of a table in the data dictionary cache. */ static MY_ATTRIBUTE((nonnull)) @@ -632,10 +621,8 @@ dict_mem_fill_column_struct( ulint prtype, /*!< in: precise type */ ulint col_len) /*!< in: column length */ { -#ifndef UNIV_HOTBACKUP ulint mbminlen; ulint mbmaxlen; -#endif /* !UNIV_HOTBACKUP */ column->ind = (unsigned int) col_pos; column->ord_part = 0; @@ -643,10 +630,9 @@ dict_mem_fill_column_struct( column->mtype = (unsigned int) mtype; column->prtype = (unsigned int) prtype; column->len = (unsigned int) col_len; -#ifndef UNIV_HOTBACKUP - dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen); + + dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen); dict_col_set_mbminmaxlen(column, mbminlen, mbmaxlen); -#endif /* !UNIV_HOTBACKUP */ } /**********************************************************************//** @@ -693,7 +679,6 @@ dict_mem_index_create( return(index); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Creates and initializes a foreign constraint memory object. @return own: foreign constraint struct */ @@ -953,8 +938,6 @@ dict_mem_table_free_foreign_vcol_set( } } -#endif /* !UNIV_HOTBACKUP */ - /**********************************************************************//** 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 @@ -1150,4 +1133,3 @@ dict_mem_table_is_system( return true; } } - diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 5cb6d9714c8..87502ef130c 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -23,8 +23,6 @@ Code used for calculating and manipulating table statistics. Created Jan 06, 2010 Vasil Dimov *******************************************************/ -#ifndef UNIV_HOTBACKUP - #include "univ.i" #include "ut0ut.h" @@ -4290,5 +4288,3 @@ test_dict_stats_all() #endif /* UNIV_ENABLE_UNIT_TEST_DICT_STATS */ /* @} */ - -#endif /* UNIV_HOTBACKUP */ diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index fae9ee3dbc1..60ed4e01422 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -29,7 +29,6 @@ Created 10/25/1995 Heikki Tuuri #include "fsp0pagecompress.h" #include "fil0crypt.h" -#ifndef UNIV_HOTBACKUP #include "btr0btr.h" #include "buf0buf.h" #include "dict0boot.h" @@ -51,11 +50,10 @@ Created 10/25/1995 Heikki Tuuri #include "srv0start.h" #include "trx0purge.h" #include "ut0new.h" -# include "buf0lru.h" -# include "ibuf0ibuf.h" -# include "os0event.h" -# include "sync0sync.h" -#endif /* !UNIV_HOTBACKUP */ +#include "buf0lru.h" +#include "ibuf0ibuf.h" +#include "os0event.h" +#include "sync0sync.h" #include "buf0flu.h" #include "srv0start.h" #include "trx0purge.h" @@ -161,11 +159,6 @@ fil_addr_t fil_addr_null = {FIL_NULL, 0}; initialized. */ fil_system_t* fil_system = NULL; -#ifdef UNIV_HOTBACKUP -static ulint srv_data_read; -static ulint srv_data_written; -#endif /* UNIV_HOTBACKUP */ - /** Determine if user has explicitly disabled fsync(). */ #ifndef _WIN32 # define fil_buffering_disabled(s) \ @@ -384,7 +377,6 @@ fil_space_get( return(space); } -#ifndef UNIV_HOTBACKUP /** Returns the latch of a file space. @param[in] id space id @param[out] flags tablespace flags @@ -456,7 +448,6 @@ fil_space_set_imported( mutex_exit(&fil_system->mutex); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Checks if all the file nodes in a space are flushed. The caller must hold @@ -698,13 +689,6 @@ retry: size_bytes = os_file_get_size(node->handle); ut_a(size_bytes != (os_offset_t) -1); -#ifdef UNIV_HOTBACKUP - if (space->id == 0) { - node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); - os_file_close(node->handle); - goto add_size; - } -#endif /* UNIV_HOTBACKUP */ ut_a(space->purpose != FIL_TYPE_LOG); /* Read the first page of the tablespace */ @@ -813,19 +797,16 @@ retry: /* After apply-incremental, tablespaces are not extended to a whole megabyte. Do not cut off valid data. */ -#ifndef UNIV_HOTBACKUP + /* Truncate the size to a multiple of extent size. */ if (size_bytes >= extent_size) { size_bytes = ut_2pow_round(size_bytes, extent_size); } -#endif /* !UNIV_HOTBACKUP */ + node->size = (ulint) (size_bytes / page_size.physical()); -#ifdef UNIV_HOTBACKUP -add_size: -#endif /* UNIV_HOTBACKUP */ space->size += node->size; } } @@ -880,11 +861,9 @@ fil_node_close_file( ut_a(node->n_pending == 0); ut_a(node->n_pending_flushes == 0); ut_a(!node->being_extended); -#ifndef UNIV_HOTBACKUP ut_a(node->modification_counter == node->flush_counter || node->space->purpose == FIL_TYPE_TEMPORARY || srv_fast_shutdown == 2); -#endif /* !UNIV_HOTBACKUP */ ret = os_file_close(node->handle); ut_a(ret); @@ -1133,17 +1112,10 @@ fil_write_zeros( IORequest request(IORequest::WRITE); while (offset < end) { - -#ifdef UNIV_HOTBACKUP - err = os_file_write( - request, node->name, node->handle, buf, offset, - n_bytes); -#else err = os_aio( request, OS_AIO_SYNC, node->name, node->handle, buf, offset, n_bytes, read_only_mode, NULL, NULL, NULL); -#endif /* UNIV_HOTBACKUP */ if (err != DB_SUCCESS) { break; @@ -1690,8 +1662,6 @@ fil_space_create( UT_LIST_INIT(space->chain, &fil_node_t::chain); - /* This warning is not applicable while MEB scanning the redo logs */ -#ifndef UNIV_HOTBACKUP if ((purpose == FIL_TYPE_TABLESPACE || purpose == FIL_TYPE_IMPORT) && !recv_recovery_on && id > fil_system->max_assigned_id) { @@ -1706,7 +1676,7 @@ fil_space_create( fil_system->max_assigned_id = id; } -#endif /* !UNIV_HOTBACKUP */ + space->purpose = purpose; space->flags = flags; @@ -1733,9 +1703,7 @@ fil_space_create( rw_lock_create(fil_space_latch_key, &space->latch, SYNC_FSP); if (space->purpose == FIL_TYPE_TEMPORARY) { -#ifndef UNIV_HOTBACKUP ut_d(space->latch.set_temp_fsp()); -#endif /* !UNIV_HOTBACKUP */ } HASH_INSERT(fil_space_t, hash, fil_system->spaces, id, space); @@ -2320,7 +2288,6 @@ fil_write_flushed_lsn( return(err); } -#ifndef UNIV_HOTBACKUP /** Acquire a tablespace when it could be dropped concurrently. Used by background threads that do not necessarily hold proper locks for concurrency control. @@ -2391,7 +2358,6 @@ fil_space_release( space->n_pending_ops--; mutex_exit(&fil_system->mutex); } -#endif /* !UNIV_HOTBACKUP */ /********************************************************//** Creates the database directory for a table if it does not exist yet. */ @@ -2502,7 +2468,7 @@ fil_op_write_log( ut_ad(0); } } -#ifndef UNIV_HOTBACKUP + /** Write redo log for renaming a file. @param[in] space_id tablespace id @param[in] first_page_no first page number in the file @@ -2524,7 +2490,7 @@ fil_name_write_rename( MLOG_FILE_RENAME2, space_id, first_page_no, old_name, new_name, 0, mtr); } -#endif /* !UNIV_HOTBACKUP */ + /** Write MLOG_FILE_NAME for a file. @param[in] space_id tablespace id @param[in] first_page_no first page number in the file @@ -2557,7 +2523,6 @@ fil_name_write( fil_name_write(space->id, first_page_no, file->name, mtr); } -#ifndef UNIV_HOTBACKUP /********************************************************//** Recreates table indexes by applying TRUNCATE log record during recovery. @@ -2798,7 +2763,7 @@ fil_recreate_tablespace( return(err); } -#endif /* UNIV_HOTBACKUP */ + /** Replay a file rename operation if possible. @param[in] space_id tablespace identifier @param[in] first_page_no first page number in the file @@ -2814,9 +2779,6 @@ fil_op_replay_rename( const char* name, const char* new_name) { -#ifdef UNIV_HOTBACKUP - ut_ad(recv_replay_file_ops); -#endif /* UNIV_HOTBACKUP */ ut_ad(first_page_no == 0); /* In order to replay the rename, the following must hold: @@ -3147,7 +3109,6 @@ fil_delete_tablespace( ut_a(space); ut_a(path != 0); -#ifndef UNIV_HOTBACKUP /* IMPORTANT: Because we have set space::stop_new_ops there can't be any new ibuf merges, reads or flushes. We are here because node::n_pending was zero above. However, it is still @@ -3171,15 +3132,9 @@ fil_delete_tablespace( buf_LRU_flush_or_remove_pages(id, buf_remove, 0); -#endif /* !UNIV_HOTBACKUP */ - /* If it is a delete then also delete any generated files, otherwise when we drop the database the remove directory will fail. */ { -#ifdef UNIV_HOTBACKUP - /* When replaying the operation in MySQL Enterprise - Backup, we do not try to write any log record. */ -#else /* UNIV_HOTBACKUP */ /* Before deleting the file, write a log record about it, so that InnoDB crash recovery will expect the file to be gone. */ @@ -3192,7 +3147,6 @@ fil_delete_tablespace( tablespace file, the record must have already been written to the redo log. */ log_write_up_to(mtr.commit_lsn(), true); -#endif /* UNIV_HOTBACKUP */ char* cfg_name = fil_make_filepath(path, NULL, CFG, false); if (cfg_name != NULL) { @@ -3255,7 +3209,6 @@ fil_delete_tablespace( return(err); } -#ifndef UNIV_HOTBACKUP /** Truncate the tablespace to needed size. @param[in] space_id id of tablespace to truncate @param[in] size_in_pages truncate size. @@ -3489,7 +3442,6 @@ fil_discard_tablespace( return(err); } -#endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** Allocates and builds a file name from a path, a table or tablespace name @@ -3756,7 +3708,7 @@ func_exit: ut_ad(strchr(old_file_name, OS_PATH_SEPARATOR) != NULL); ut_ad(strchr(new_file_name, OS_PATH_SEPARATOR) != NULL); -#ifndef UNIV_HOTBACKUP + if (!recv_recovery_on) { mtr_t mtr; @@ -3766,7 +3718,6 @@ func_exit: mtr.commit(); log_mutex_enter(); } -#endif /* !UNIV_HOTBACKUP */ /* log_sys->mutex is above fil_system->mutex in the latching order */ ut_ad(log_mutex_own()); @@ -3794,11 +3745,9 @@ func_exit: node->name = new_file_name; } -#ifndef UNIV_HOTBACKUP if (!recv_recovery_on) { log_mutex_exit(); } -#endif /* !UNIV_HOTBACKUP */ ut_ad(space->name == old_space_name); if (success) { @@ -3983,11 +3932,11 @@ fil_ibd_create( page = static_cast<byte*>(ut_align(buf2, UNIV_PAGE_SIZE)); memset(page, '\0', UNIV_PAGE_SIZE); -#ifndef UNIV_HOTBACKUP + /* Add the UNIV_PAGE_SIZE to the table flags and write them to the tablespace header. */ flags = fsp_flags_set_page_size(flags, univ_page_size); -#endif /* !UNIV_HOTBACKUP */ + fsp_header_init_fields(page, space_id, flags); mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space_id); @@ -4052,9 +4001,6 @@ fil_ibd_create( return(DB_ERROR); } - /* MEB creates isl files during copy-back, hence they - should not be created during apply log operation. */ -#ifndef UNIV_HOTBACKUP if (has_data_dir || has_shared_space) { /* Make the ISL file if the IBD file is not in the default location. */ @@ -4066,7 +4012,6 @@ fil_ibd_create( return(err); } } -#endif /* !UNIV_HOTBACKUP */ /* Create crypt data if the tablespace is either encrypted or user has requested it to remain unencrypted. */ @@ -4101,7 +4046,6 @@ fil_ibd_create( } #endif /* MYSQL_ENCRYPTION */ -#ifndef UNIV_HOTBACKUP if (!is_temp) { mtr_t mtr; const fil_node_t* file = UT_LIST_GET_FIRST(space->chain); @@ -4113,7 +4057,7 @@ fil_ibd_create( fil_name_write(space, 0, file, &mtr); mtr_commit(&mtr); } -#endif /* !UNIV_HOTBACKUP */ + err = DB_SUCCESS; /* Error code is set. Cleanup the various variables used. @@ -4132,7 +4076,6 @@ error_exit_1: return(err); } -#ifndef UNIV_HOTBACKUP /** Try to open a single-table tablespace and optionally check that the space id in it is correct. If this does not succeed, print an error message to the .err log. This function is used to open a tablespace when we start @@ -4529,32 +4472,6 @@ skip_validate: return(err); } -#endif /* !UNIV_HOTBACKUP */ - -#ifdef UNIV_HOTBACKUP -/*******************************************************************//** -Allocates a file name for an old version of a single-table tablespace. -The string must be freed by caller with ut_free()! -@return own: file name */ -static -char* -fil_make_ibbackup_old_name( -/*=======================*/ - const char* name) /*!< in: original file name */ -{ - static const char suffix[] = "_ibbackup_old_vers_"; - char* path; - ulint len = strlen(name); - - path = static_cast<char*>(ut_malloc_nokey(len + 15 + sizeof(suffix))); - - memcpy(path, name, len); - memcpy(path + len, suffix, sizeof(suffix) - 1); - ut_sprintf_timestamp_without_extra_chars( - path + len + sizeof(suffix) - 1); - return(path); -} -#endif /* UNIV_HOTBACKUP */ /** Looks for a pre-existing fil_space_t with the given tablespace ID and, if found, returns the name and filepath in newly allocated buffers @@ -4640,7 +4557,7 @@ fil_path_to_space_name( } /** Discover the correct IBD file to open given a remote or missing -filepath from the REDO log. MEB and administrators can move a crashed +filepath from the REDO log. Administrators can move a crashed database to another location on the same machine and try to recover it. Remote IBD files might be moved as well to the new location. The problem with this is that the REDO log contains the old location @@ -4652,6 +4569,7 @@ both locations, we can chose on based on these priorities; @param[in] space_id tablespace ID @param[in] df Datafile object with path from redo @return true if a valid datafile was found, false if not */ +static bool fil_ibd_discover( ulint space_id, @@ -4813,11 +4731,7 @@ fil_ibd_load( fil_node_t* node = UT_LIST_GET_FIRST(space->chain); if (0 != strcmp(innobase_basename(filename), innobase_basename(node->name))) { -#ifdef UNIV_HOTBACKUP - ib::trace() -#else ib::info() -#endif /* UNIV_HOTBACKUP */ << "Ignoring data file '" << filename << "' with space ID " << space->id << ". Another data file called " << node->name @@ -4853,11 +4767,7 @@ fil_ibd_load( os_offset_t minimum_size; case DB_SUCCESS: if (file.space_id() != space_id) { -#ifdef UNIV_HOTBACKUP - ib::trace() -#else /* !UNIV_HOTBACKUP */ ib::info() -#endif /* UNIV_HOTBACKUP */ << "Ignoring data file '" << file.filepath() << "' with space ID " << file.space_id() @@ -4881,17 +4791,10 @@ fil_ibd_load( " single-table tablespace file '" << file.filepath() << "'"; } else if (size < minimum_size) { -#ifndef UNIV_HOTBACKUP ib::error() << "The size of tablespace file '" << file.filepath() << "' is only " << size << ", should be at least " << minimum_size << "!"; -#else - /* In MEB, we work around this error. */ - file.set_space_id(ULINT_UNDEFINED); - file.set_flags(0); - break; -#endif /* !UNIV_HOTBACKUP */ } else { /* Everything is fine so far. */ break; @@ -4900,12 +4803,6 @@ fil_ibd_load( /* Fall through to error handling */ case DB_TABLESPACE_EXISTS: -#ifdef UNIV_HOTBACKUP - if (file.flags() == ~(ulint)0) { - return FIL_LOAD_OK; - } -#endif /* UNIV_HOTBACKUP */ - return(FIL_LOAD_INVALID); default: @@ -4914,64 +4811,6 @@ fil_ibd_load( ut_ad(space == NULL); -#ifdef UNIV_HOTBACKUP - if (file.space_id() == ULINT_UNDEFINED || file.space_id() == 0) { - char* new_path; - - ib::info() << "Renaming tablespace file '" << file.filepath() - << "' with space ID " << file.space_id() << " to " - << file.name() << "_ibbackup_old_vers_<timestamp>" - " because its size " << size() << " is too small" - " (< 4 pages 16 kB each), or the space id in the" - " file header is not sensible. This can happen in" - " an mysqlbackup run, and is not dangerous."; - file.close(); - - new_path = fil_make_ibbackup_old_name(file.filepath()); - - bool success = os_file_rename( - innodb_data_file_key, file.filepath(), new_path); - - ut_a(success); - - ut_free(new_path); - - return(FIL_LOAD_ID_CHANGED); - } - - /* A backup may contain the same space several times, if the space got - renamed at a sensitive time. Since it is enough to have one version of - the space, we rename the file if a space with the same space id - already exists in the tablespace memory cache. We rather rename the - file than delete it, because if there is a bug, we do not want to - destroy valuable data. */ - - mutex_enter(&fil_system->mutex); - space = fil_space_get_by_id(space_id); - mutex_exit(&fil_system->mutex); - - if (space != NULL) { - ib::info() << "Renaming data file '" << file.filepath() - << "' with space ID " << space_id << " to " - << file.name() - << "_ibbackup_old_vers_<timestamp> because space " - << space->name << " with the same id was scanned" - " earlier. This can happen if you have renamed tables" - " during an mysqlbackup run."; - file.close(); - - char* new_path = fil_make_ibbackup_old_name(file.filepath()); - - bool success = os_file_rename( - innodb_data_file_key, file.filepath(), new_path); - - ut_a(success); - - ut_free(new_path); - return(FIL_LOAD_OK); - } -#endif /* UNIV_HOTBACKUP */ - bool is_temp = FSP_FLAGS_GET_TEMPORARY(file.flags()); space = fil_space_create( file.name(), space_id, file.flags(), @@ -5066,7 +4905,6 @@ fil_report_missing_tablespace( " exists in the InnoDB internal data dictionary."; } -#ifndef UNIV_HOTBACKUP /** Returns true if a matching tablespace exists in the InnoDB tablespace memory cache. Note that if we have not done a crash recovery at the database startup, there may be many tablespaces which are not yet in the memory cache. @@ -5243,7 +5081,7 @@ error_exit: return(false); } -#endif /* !UNIV_HOTBACKUP */ + /** Return the space ID based on the tablespace name. The tablespace must be found in the tablespace memory cache. This call is made from external to this module, so the mutex is not owned. @@ -5555,8 +5393,6 @@ fil_io( #endif ut_ad(fil_validate_skip()); -#ifndef UNIV_HOTBACKUP - /* ibuf bitmap pages must be read in the sync AIO mode: */ ut_ad(recv_no_ibuf_operations || req_type.is_write() @@ -5587,12 +5423,7 @@ fil_io( } else { mode = OS_AIO_NORMAL; } -#else /* !UNIV_HOTBACKUP */ - ut_a(sync); - ulint mode = OS_AIO_SYNC; -#endif /* !UNIV_HOTBACKUP */ -#ifndef UNIV_HOTBACKUP if (req_type.is_read()) { srv_stats.data_read.add(len); @@ -5604,7 +5435,6 @@ fil_io( srv_stats.data_written.add(len); } -#endif /* !UNIV_HOTBACKUP */ /* Reserve the fil_system mutex and make sure that we can open at least one file while holding it, if the file is not already open */ @@ -5807,33 +5637,14 @@ fil_io( req_type.block_size(node->block_size); - dberr_t err; - -#ifdef UNIV_HOTBACKUP - /* In mysqlbackup do normal i/o, not aio */ - if (req_type.is_read()) { - - err = os_file_read(req_type, node->handle, buf, offset, len); - - } else { - - ut_ad(!srv_read_only_mode - || fsp_is_system_temporary(page_id.space())); - - err = os_file_write( - req_type, node->name, node->handle, buf, offset, len); - } -#else /* UNIV_HOTBACKUP */ /* Queue the aio request */ - err = os_aio( + dberr_t err = os_aio( req_type, mode, name, node->handle, buf, offset, len, - fsp_is_system_temporary(page_id.space()) - ? false : srv_read_only_mode, + space->purpose != FIL_TYPE_TEMPORARY + && srv_read_only_mode, node, message, write_size); -#endif /* UNIV_HOTBACKUP */ - if (err == DB_IO_NO_PUNCH_HOLE) { err = DB_SUCCESS; @@ -5869,7 +5680,6 @@ fil_io( return(err); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Waits for an aio operation to complete. This function is used to write the handler for completed requests. The aio array of pending requests is divided @@ -5932,7 +5742,6 @@ fil_aio_wait( ut_ad(0); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Flushes to disk possible writes cached by the OS. If the space does not exist @@ -6135,7 +5944,6 @@ fil_page_set_type( mach_write_to_2(page + FIL_PAGE_TYPE, type); } -#ifndef UNIV_HOTBACKUP /** Reset the page type. Data files created before MySQL 5.1 may contain garbage in FIL_PAGE_TYPE. In MySQL 3.23.53, only undo log pages and index pages were tagged. @@ -6156,7 +5964,6 @@ fil_page_reset_type( << fil_page_get_type(page) << " to " << type << "."; mlog_write_ulint(page + FIL_PAGE_TYPE, type, MLOG_2BYTES, mtr); } -#endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Closes the tablespace memory cache. */ @@ -6182,7 +5989,6 @@ fil_close(void) } } -#ifndef UNIV_HOTBACKUP /********************************************************************//** Initializes a buffer control block when the buf_pool is created. */ static @@ -6721,7 +6527,6 @@ fil_tablespace_iterate( return(err); } -#endif /* !UNIV_HOTBACKUP */ /** Set the tablespace table size. @param[in] page a page belonging to the tablespace */ @@ -6800,7 +6605,6 @@ fil_get_space_names( return(err); } -#ifndef UNIV_HOTBACKUP /** Generate redo log for swapping two .ibd files @param[in] old_table old table @param[in] new_table new table @@ -6899,7 +6703,7 @@ fil_mtr_rename_log( return(DB_SUCCESS); } -#endif /* !UNIV_HOTBACKUP */ + #ifdef UNIV_DEBUG /** Check that a tablespace is valid for mtr_commit(). @param[in] space persistent tablespace that has been changed */ @@ -6987,7 +6791,7 @@ fil_names_dirty_and_write( bogus_name, mtr); }); } -#ifndef UNIV_HOTBACKUP + /** On a log checkpoint, reset fil_names_dirty_and_write() flags and write out MLOG_FILE_NAME and MLOG_CHECKPOINT if needed. @param[in] lsn checkpoint LSN @@ -7159,7 +6963,6 @@ truncate_t::truncate( return(err); } -#endif /* !UNIV_HOTBACKUP */ /** Note that the file system where the file resides doesn't support PUNCH HOLE. diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 4479c06f1b2..98d732a9f9d 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -48,14 +48,9 @@ Updated 14/02/2015 #include "trx0sys.h" #include "row0mysql.h" #include "ha_prototypes.h" // IB_LOG_ -#ifndef UNIV_HOTBACKUP -# include "buf0lru.h" -# include "ibuf0ibuf.h" -# include "sync0sync.h" -#else /* !UNIV_HOTBACKUP */ -# include "srv0srv.h" -static ulint srv_data_read, srv_data_written; -#endif /* !UNIV_HOTBACKUP */ +#include "buf0lru.h" +#include "ibuf0ibuf.h" +#include "sync0sync.h" #include "zlib.h" #ifdef __linux__ #include <linux/fs.h> diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 4a7df5b33d3..0e1d2f3233b 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -33,9 +33,6 @@ Created 2013-7-26 by Kevin Lewis #include "srv0start.h" #include "ut0new.h" #include "fil0crypt.h" -#ifdef UNIV_HOTBACKUP -#include "my_sys.h" -#endif /* UNIV_HOTBACKUP */ /** Initialize the name, size and order of this datafile @param[in] name tablespace name, will be copied @@ -459,39 +456,6 @@ Datafile::validate_for_recovery() switch (err) { case DB_SUCCESS: case DB_TABLESPACE_EXISTS: -#ifdef UNIV_HOTBACKUP - err = restore_from_doublewrite(0); - if (err != DB_SUCCESS) { - return(err); - } - /* Free the previously read first page and then re-validate. */ - free_first_page(); - err = validate_first_page(0, false); - if (err == DB_SUCCESS) { - std::string filepath = fil_space_get_first_path( - m_space_id); - if (is_intermediate_file(filepath.c_str())) { - /* Existing intermediate file with same space - id is obsolete.*/ - if (fil_space_free(m_space_id, FALSE)) { - err = DB_SUCCESS; - } - } else { - filepath.assign(m_filepath); - if (is_intermediate_file(filepath.c_str())) { - /* New intermediate file with same space id - shall be ignored.*/ - err = DB_TABLESPACE_EXISTS; - /* Set all bits of 'flags' as a special - indicator for "ignore tablespace". Hopefully - InnoDB will never use all bits or at least all - bits set will not be a meaningful setting - otherwise.*/ - m_flags = ~0; - } - } - } -#endif /* UNIV_HOTBACKUP */ break; default: diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 2ccad2801d1..fe272accd5a 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -31,9 +31,6 @@ Created 11/29/1995 Heikki Tuuri #include "fsp0fsp.ic" #endif -#ifdef UNIV_HOTBACKUP -# include "fut0lst.h" -#else /* UNIV_HOTBACKUP */ #include "buf0buf.h" #include "fil0fil.h" #include "fil0crypt.h" @@ -215,7 +212,6 @@ fsp_flags_to_dict_tf( return(flags); } -#endif /* !UNIV_HOTBACKUP */ /** Validate the tablespace flags. These flags are stored in the tablespace header at offset FSP_SPACE_FLAGS. @@ -361,9 +357,7 @@ fsp_is_file_per_table( && !fsp_is_shared_tablespace(fsp_flags)); } -#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG - /** Skip some of the sanity checks that are time consuming even in debug mode and can affect frequent verification runs that are done to ensure stability of the product. @@ -375,7 +369,6 @@ fsp_skip_sanity_check( return(srv_skip_temp_table_checks_debug && fsp_is_system_temporary(space_id)); } - #endif /* UNIV_DEBUG */ /**********************************************************************//** @@ -741,7 +734,6 @@ xdes_get_offset( + ((page_offset(descr) - XDES_ARR_OFFSET) / XDES_SIZE) * FSP_EXTENT_SIZE); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Inits a file page whose prior contents should be ignored. */ @@ -771,8 +763,7 @@ fsp_init_file_page_low( } } -#ifndef UNIV_HOTBACKUP -# ifdef UNIV_DEBUG +#ifdef UNIV_DEBUG /** Assert that the mini-transaction is compatible with updating an allocation bitmap page. @param[in] id tablespace identifier @@ -790,7 +781,6 @@ fsp_space_modify_check( when there is a higher-level redo log record written. */ break; case MTR_LOG_NO_REDO: -#ifdef UNIV_DEBUG { const fil_type_t type = fil_space_get_type(id); ut_a(srv_is_tablespace_truncated(id) @@ -800,7 +790,6 @@ fsp_space_modify_check( || type == FIL_TYPE_IMPORT || fil_space_is_redo_skipped(id)); } -#endif /* UNIV_DEBUG */ return; case MTR_LOG_ALL: /* We may only write redo log for a persistent tablespace. */ @@ -811,7 +800,7 @@ fsp_space_modify_check( ut_ad(0); } -# endif /* UNIV_DEBUG */ +#endif /* UNIV_DEBUG */ /** Initialize a file page. @param[in,out] block file page @@ -828,7 +817,6 @@ fsp_init_file_page( mlog_write_initial_log_record(buf_block_get_frame(block), MLOG_INIT_FILE_PAGE2, mtr); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of a file page init. @@ -889,8 +877,6 @@ fsp_header_init_fields( flags); } -#ifndef UNIV_HOTBACKUP - #if 0 /* MySQL 5.7 Encryption */ /** Fill the encryption info. @param[in] space tablespace @@ -1165,7 +1151,6 @@ fsp_header_init( return(true); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Reads the space id from the first page of a tablespace. @@ -1362,7 +1347,6 @@ fsp_header_get_encryption_key( } #endif /* ! */ -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Increases the space size field of a space. */ void @@ -4273,7 +4257,6 @@ fseg_print( fseg_print_low(inode, mtr); } #endif /* UNIV_BTR_PRINT */ -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /** Print the file segment header to the given output stream. diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc index d50e35d0cbf..45942f58dd3 100644 --- a/storage/innobase/fsp/fsp0space.cc +++ b/storage/innobase/fsp/fsp0space.cc @@ -27,14 +27,10 @@ Created 2012-11-16 by Sunny Bains as srv/srv0space.cc #include "fsp0space.h" #include "fsp0sysspace.h" -#ifndef UNIV_HOTBACKUP #include "fsp0fsp.h" #include "os0file.h" -#endif /* !UNIV_HOTBACKUP */ - #include "my_sys.h" - /** Check if two tablespaces have common data file names. @param other_space Tablespace to check against this. @return true if they have the same data filenames and paths */ @@ -180,7 +176,6 @@ Tablespace::find(const char* filename) return(false); } - /** Delete all the data files. */ void Tablespace::delete_files() diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index ac34be6f6a8..fa6a46890db 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -29,7 +29,6 @@ Refactored 2013-7-26 by Kevin Lewis #include "fsp0sysspace.h" #include "srv0start.h" #include "trx0sys.h" -#ifndef UNIV_HOTBACKUP #include "dict0load.h" #include "mem0mem.h" #include "os0file.h" @@ -40,9 +39,6 @@ Refactored 2013-7-26 by Kevin Lewis If server passes the option for create/open DB to SE, we should remove such direct reference to server header and global variable */ #include "mysqld.h" -#else -my_bool opt_initialize = 0; -#endif /* !UNIV_HOTBACKUP */ /** The control info of the system tablespace. */ SysTablespace srv_sys_space; @@ -538,7 +534,6 @@ SysTablespace::open_file( return(err); } -#ifndef UNIV_HOTBACKUP /** Check the tablespace header for this tablespace. @param[out] flushed_lsn the value of FIL_PAGE_FILE_FLUSH_LSN @return DB_SUCCESS or error code */ @@ -613,7 +608,7 @@ SysTablespace::read_lsn_and_check_flags(lsn_t* flushed_lsn) return(DB_SUCCESS); } -#endif /* !UNIV_HOTBACKUP */ + /** Check if a file can be opened in the correct mode. @param[in] file data file object @param[out] reason exact reason if file_status check failed. @@ -760,7 +755,7 @@ SysTablespace::file_found( /* Need to create the system tablespace for new raw device. */ return(file.m_type == SRV_NEW_RAW); } -#ifndef UNIV_HOTBACKUP + /** Check the data file specification. @param[out] create_new_db true if a new database is to be created @param[in] min_expected_size Minimum expected tablespace size in bytes @@ -989,7 +984,7 @@ SysTablespace::open_or_create( return(err); } -#endif /* UNIV_HOTBACKUP */ + /** Normalize the file size, convert from megabytes to number of pages. */ void SysTablespace::normalize() diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc index 9f8a3492db9..559ac2a6aa5 100644 --- a/storage/innobase/gis/gis0rtree.cc +++ b/storage/innobase/gis/gis0rtree.cc @@ -28,8 +28,6 @@ Created 2013/03/27 Allen Lai and Jimmy Yang #include "page0cur.h" #include "page0zip.h" #include "gis0rtree.h" - -#ifndef UNIV_HOTBACKUP #include "btr0cur.h" #include "btr0sea.h" #include "btr0pcur.h" @@ -40,8 +38,6 @@ Created 2013/03/27 Allen Lai and Jimmy Yang #include "srv0mon.h" #include "gis0geo.h" -#endif /* UNIV_HOTBACKUP */ - /*************************************************************//** Initial split nodes info for R-tree split. @return initialized split nodes array */ diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc index 39ad4fe7d7d..99543ef8c9c 100644 --- a/storage/innobase/gis/gis0sea.cc +++ b/storage/innobase/gis/gis0sea.cc @@ -28,8 +28,6 @@ Created 2014/01/16 Jimmy Yang #include "page0cur.h" #include "page0zip.h" #include "gis0rtree.h" - -#ifndef UNIV_HOTBACKUP #include "btr0cur.h" #include "btr0sea.h" #include "btr0pcur.h" @@ -40,8 +38,6 @@ Created 2014/01/16 Jimmy Yang #include "srv0mon.h" #include "gis0geo.h" -#endif /* UNIV_HOTBACKUP */ - /*************************************************************//** Pop out used parent path entry, until we find the parent with matching page number */ @@ -1550,7 +1546,6 @@ rtr_copy_buf( (another) thread while it was copied. */ memcpy(&matches->block.page, &block->page, sizeof(buf_page_t)); matches->block.frame = block->frame; -#ifndef UNIV_HOTBACKUP matches->block.unzip_LRU = block->unzip_LRU; ut_d(matches->block.in_unzip_LRU_list = block->in_unzip_LRU_list); @@ -1572,7 +1567,6 @@ rtr_copy_buf( ut_d(matches->block.debug_latch = block->debug_latch); -#endif /* !UNIV_HOTBACKUP */ } /****************************************************************//** diff --git a/storage/innobase/ha/ha0ha.cc b/storage/innobase/ha/ha0ha.cc index f57a6d383d9..cf92f22ac15 100644 --- a/storage/innobase/ha/ha0ha.cc +++ b/storage/innobase/ha/ha0ha.cc @@ -28,11 +28,10 @@ Created 8/22/1994 Heikki Tuuri #include "ha0ha.ic" #endif -#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG # include "buf0buf.h" #endif /* UNIV_DEBUG */ -# include "btr0sea.h" +#include "btr0sea.h" #include "page0page.h" /*************************************************************//** @@ -537,4 +536,3 @@ builds, see http://bugs.mysql.com/36941 */ (ulong) n_bufs); } } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/ha/hash0hash.cc b/storage/innobase/ha/hash0hash.cc index 234fd7ac032..7c5798ae254 100644 --- a/storage/innobase/ha/hash0hash.cc +++ b/storage/innobase/ha/hash0hash.cc @@ -32,8 +32,6 @@ Created 5/20/1997 Heikki Tuuri #include "mem0mem.h" #include "sync0sync.h" -#ifndef UNIV_HOTBACKUP - /************************************************************//** Reserves the mutex for a fold value in a hash table. */ void @@ -249,8 +247,6 @@ hash_unlock_x_all_but( } } -#endif /* !UNIV_HOTBACKUP */ - /*************************************************************//** Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n. @@ -277,14 +273,12 @@ hash_create( table->type = HASH_TABLE_SYNC_NONE; table->array = array; table->n_cells = prime; -#ifndef UNIV_HOTBACKUP -# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG +#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG table->adaptive = FALSE; -# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ +#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ table->n_sync_obj = 0; table->sync_obj.mutexes = NULL; table->heaps = NULL; -#endif /* !UNIV_HOTBACKUP */ table->heap = NULL; ut_d(table->magic_n = HASH_TABLE_MAGIC_N); @@ -307,7 +301,6 @@ hash_table_free( ut_free(table); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Creates a sync object array to protect a hash table. ::sync_obj can be mutexes or rw_locks depening on the type of @@ -362,4 +355,3 @@ hash_create_sync_obj( table->n_sync_obj = n_sync_obj; } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 6940bbee5c2..612a2f9a690 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -46,8 +46,6 @@ my_bool srv_ibuf_disable_background_merge; #include "ibuf0ibuf.ic" #endif -#ifndef UNIV_HOTBACKUP - #include "buf0buf.h" #include "buf0rea.h" #include "fsp0fsp.h" @@ -595,7 +593,6 @@ ibuf_max_size_update( } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Initializes an ibuf bitmap page. */ void @@ -618,10 +615,7 @@ ibuf_bitmap_page_init( memset(page + IBUF_BITMAP, 0, byte_offset); /* The remaining area (up to the page trailer) is uninitialized. */ - -#ifndef UNIV_HOTBACKUP mlog_write_initial_log_record(page, MLOG_IBUF_BITMAP_INIT, mtr); -#endif /* !UNIV_HOTBACKUP */ } /*********************************************************************//** @@ -644,7 +638,7 @@ ibuf_parse_bitmap_init( return(ptr); } -#ifndef UNIV_HOTBACKUP + # ifdef UNIV_DEBUG /** Gets the desired bits for a given page from a bitmap page. @param[in] page bitmap page @@ -2754,8 +2748,6 @@ ibuf_merge_in_background( } #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ - - while (sum_pages < n_pages) { ulint n_bytes; @@ -5132,5 +5124,3 @@ ibuf_set_bitmap_for_bulk_load( mtr_commit(&mtr); } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 9843eaf3cfe..419c5db657d 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -37,7 +37,6 @@ Created 6/2/1994 Heikki Tuuri #include "btr0types.h" #include "gis0type.h" -#ifndef UNIV_HOTBACKUP /** Maximum record size which can be stored on a page, without using the special big record storage structure */ #define BTR_PAGE_MAX_REC_SIZE (UNIV_PAGE_SIZE / 2 - 200) @@ -140,7 +139,6 @@ record is in spatial index */ ((latch_mode) & ~(BTR_LATCH_FOR_INSERT \ | BTR_LATCH_FOR_DELETE \ | BTR_MODIFY_EXTERNAL)) -#endif /* UNIV_HOTBACKUP */ /**************************************************************//** Report that an index page is corrupted. */ @@ -161,7 +159,6 @@ btr_corruption_report( ut_error; \ } -#ifndef UNIV_HOTBACKUP /**************************************************************//** Gets the root node of a tree and sx-latches it for segment access. @return root page, sx-latched */ @@ -252,7 +249,6 @@ btr_page_get( dict_index_t* index, mtr_t* mtr) MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /**************************************************************//** Gets the index id field of a page. @return index id */ @@ -262,7 +258,6 @@ btr_page_get_index_id( /*==================*/ const page_t* page) /*!< in: index page */ MY_ATTRIBUTE((warn_unused_result)); -#ifndef UNIV_HOTBACKUP /********************************************************//** Gets the node level field in an index page. @return level, leaf level == 0 */ @@ -514,9 +509,8 @@ btr_insert_on_non_leaf_level_func( const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr); /*!< in: mtr */ -# define btr_insert_on_non_leaf_level(f,i,l,t,m) \ +#define btr_insert_on_non_leaf_level(f,i,l,t,m) \ btr_insert_on_non_leaf_level_func(f,i,l,t,__FILE__,__LINE__,m) -#endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Sets a record as the predefined minimum record. */ void @@ -525,7 +519,6 @@ btr_set_min_rec_mark( rec_t* rec, /*!< in/out: record */ mtr_t* mtr) /*!< in: mtr */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP /*************************************************************//** Deletes on the upper level the node pointer to a page. */ void @@ -578,7 +571,6 @@ btr_discard_page( btr_cur_t* cursor, /*!< in: cursor on the page to discard: not on the root page */ mtr_t* mtr); /*!< in: mtr */ -#endif /* !UNIV_HOTBACKUP */ /****************************************************************//** Parses the redo log record for setting an index record as the predefined minimum record. @@ -605,7 +597,6 @@ btr_parse_page_reorganize( buf_block_t* block, /*!< in: page to be reorganized, or NULL */ mtr_t* mtr) /*!< in: mtr or NULL */ MY_ATTRIBUTE((warn_unused_result)); -#ifndef UNIV_HOTBACKUP /**************************************************************//** Gets the number of pages in a B-tree. @return number of pages, or ULINT_UNDEFINED if the index is unavailable */ @@ -806,7 +797,6 @@ btr_lift_page_up( #define BTR_N_LEAF_PAGES 1 #define BTR_TOTAL_SIZE 2 -#endif /* !UNIV_HOTBACKUP */ #ifndef UNIV_NONINL #include "btr0btr.ic" diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic index d01e19b5202..810ac8f8b67 100644 --- a/storage/innobase/include/btr0btr.ic +++ b/storage/innobase/include/btr0btr.ic @@ -25,7 +25,6 @@ Created 6/2/1994 Heikki Tuuri *******************************************************/ #include "mach0data.h" -#ifndef UNIV_HOTBACKUP #include "mtr0mtr.h" #include "mtr0log.h" #include "page0zip.h" @@ -132,8 +131,6 @@ btr_page_get( return ((page_t*)frame); } -#endif /* !UNIV_HOTBACKUP */ - /**************************************************************//** Gets the index id field of a page. @return index id */ @@ -146,7 +143,6 @@ btr_page_get_index_id( return(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID)); } -#ifndef UNIV_HOTBACKUP /********************************************************//** Gets the node level field in an index page. @return level, leaf level == 0 */ @@ -339,4 +335,3 @@ btr_leaf_page_release( mtr->memo_release(block, mode); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 579f725f6bd..a1e37ec46d0 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -60,7 +60,6 @@ struct btr_latch_leaves_t { ulint savepoints[3]; }; -#ifndef UNIV_HOTBACKUP #include "que0types.h" #include "row0types.h" #include "ha0ha.h" @@ -530,7 +529,6 @@ btr_cur_pessimistic_delete( bool rollback,/*!< in: performing rollback? */ mtr_t* mtr) /*!< in: mtr */ MY_ATTRIBUTE((nonnull)); -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of updating a record in-place. @return end of log record or NULL */ @@ -565,7 +563,6 @@ btr_cur_parse_del_mark_set_sec_rec( byte* end_ptr,/*!< in: buffer end */ page_t* page, /*!< in/out: page or NULL */ page_zip_des_t* page_zip);/*!< in/out: compressed page, or NULL */ -#ifndef UNIV_HOTBACKUP /** Estimates the number of rows in a given index range. @param[in] index index @@ -941,7 +938,6 @@ btr_rec_set_deleted_flag( page_zip_des_t* page_zip,/*!< in/out: compressed page (or NULL) */ ulint flag); /*!< in: nonzero if delete marked */ - /** If pessimistic delete fails because of lack of file space, there is still a good change of success a little later. Try this many times. */ @@ -995,7 +991,6 @@ extern ulint btr_cur_n_non_sea_old; srv_refresh_innodb_monitor_stats(). Referenced by srv_printf_innodb_monitor(). */ extern ulint btr_cur_n_sea_old; -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /* Flag to limit optimistic insert records */ diff --git a/storage/innobase/include/btr0cur.ic b/storage/innobase/include/btr0cur.ic index 45c0d59a8aa..b1e59651a1d 100644 --- a/storage/innobase/include/btr0cur.ic +++ b/storage/innobase/include/btr0cur.ic @@ -23,7 +23,6 @@ The index tree cursor Created 10/16/1994 Heikki Tuuri *******************************************************/ -#ifndef UNIV_HOTBACKUP #include "btr0btr.h" #ifdef UNIV_DEBUG @@ -231,5 +230,3 @@ btr_rec_set_deleted_flag( rec_set_deleted_flag_old(rec, flag); } } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/btr0defragment.h b/storage/innobase/include/btr0defragment.h index 6257c4bc996..21ba6d9f426 100644 --- a/storage/innobase/include/btr0defragment.h +++ b/storage/innobase/include/btr0defragment.h @@ -20,10 +20,6 @@ this program; if not, write to the Free Software Foundation, Inc., #ifndef btr0defragment_h #define btr0defragment_h -#include "univ.i" - -#ifndef UNIV_HOTBACKUP - #include "btr0pcur.h" /* Max number of pages to consider at once during defragmentation. */ @@ -98,7 +94,4 @@ DECLARE_THREAD(btr_defragment_thread)( /*==========================================*/ void* arg); /*!< in: a dummy parameter required by os_thread_create */ - - -#endif /* !UNIV_HOTBACKUP */ #endif diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 617bb2b9b5d..e1c92c130c4 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -27,6 +27,9 @@ Created 11/5/1995 Heikki Tuuri #ifndef buf0buf_h #define buf0buf_h +/** Magic value to use instead of checksums when they are disabled */ +#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL + #include "univ.i" #include "fil0fil.h" #include "mtr0types.h" @@ -35,7 +38,6 @@ Created 11/5/1995 Heikki Tuuri #include "hash0hash.h" #include "ut0byte.h" #include "page0types.h" -#ifndef UNIV_HOTBACKUP #include "ut0rbt.h" #include "os0proc.h" #include "log0log.h" @@ -99,20 +101,11 @@ extern volatile ulint buf_withdraw_clock; /*!< the clock is incremented every time a pointer to a page may become obsolete */ -#ifdef UNIV_DEBUG +# ifdef UNIV_DEBUG extern my_bool buf_disable_resize_buffer_pool_debug; /*!< if TRUE, resizing buffer pool is not allowed. */ -#endif /* UNIV_DEBUG */ -#else /* !UNIV_HOTBACKUP */ -extern buf_block_t* back_block1; /*!< first block, for --apply-log */ -extern buf_block_t* back_block2; /*!< second block, for page reorganize */ -#endif /* !UNIV_HOTBACKUP */ -#endif /* !UNIV_INNOCHECKSUM */ - -/** Magic value to use instead of checksums when they are disabled */ -#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL +# endif /* UNIV_DEBUG */ -#ifndef UNIV_INNOCHECKSUM /** @brief States of a control block @see buf_page_t @@ -341,7 +334,6 @@ operator<<( std::ostream& out, const page_id_t& page_id); -#ifndef UNIV_HOTBACKUP /********************************************************************//** Acquire mutex on all buffer pool instances */ UNIV_INLINE @@ -468,7 +460,7 @@ void buf_block_free( /*===========*/ buf_block_t* block); /*!< in, own: block to be freed */ -#endif /* !UNIV_HOTBACKUP */ + /*********************************************************************//** Copies contents of a buffer frame to a given buffer. @return buf */ @@ -478,7 +470,7 @@ buf_frame_copy( /*===========*/ byte* buf, /*!< in: buffer to copy to */ const buf_frame_t* frame); /*!< in: buffer frame */ -#ifndef UNIV_HOTBACKUP + /**************************************************************//** NOTE! The following macros should be used instead of buf_page_get_gen, to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed @@ -597,21 +589,6 @@ buf_page_create( const page_size_t& page_size, mtr_t* mtr); -#else /* !UNIV_HOTBACKUP */ - -/** Inits a page to the buffer buf_pool, for use in mysqlbackup --restore. -@param[in] page_id page id -@param[in] page_size page size -@param[in,out] block block to init */ -void -buf_page_init_for_backup_restore( - const page_id_t& page_id, - const page_size_t& page_size, - buf_block_t* block); - -#endif /* !UNIV_HOTBACKUP */ - -#ifndef UNIV_HOTBACKUP /********************************************************************//** Releases a compressed-only page acquired with buf_page_get_zip(). */ UNIV_INLINE @@ -788,17 +765,14 @@ buf_block_unfix( @param[in,out] b block to bufferfix @param[in] f file name where requested @param[in] l 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_DEBUG */ /** Increments the bufferfix count. @param[in,out] b block to bufferfix @param[in] f file name where requested @param[in] l 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_DEBUG */ -#else /* !UNIV_HOTBACKUP */ -# define buf_block_modify_clock_inc(block) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_INNOCHECKSUM */ /** Checks if a page contains only zeroes. @@ -835,7 +809,6 @@ buf_page_is_corrupted( #endif /* UNIV_INNOCHECKSUM */ ) MY_ATTRIBUTE((warn_unused_result)); #ifndef UNIV_INNOCHECKSUM -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Gets the space id, page offset, and byte offset within page of a pointer pointing to a buffer frame containing a file page. */ @@ -893,7 +866,7 @@ void buf_print(void); /*============*/ #endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ + enum buf_page_print_flags { /** Do not crash at the end of buf_page_print(). */ BUF_PAGE_PRINT_NO_CRASH = 1, @@ -920,7 +893,7 @@ buf_zip_decompress( /*===============*/ buf_block_t* block, /*!< in/out: block */ ibool check); /*!< in: TRUE=verify the page checksum */ -#ifndef UNIV_HOTBACKUP + #ifdef UNIV_DEBUG /*********************************************************************//** Returns the number of latched pages in the buffer pool. @@ -990,7 +963,6 @@ this function is called: not latched and not modified. */ void buf_pool_invalidate(void); /*=====================*/ -#endif /* !UNIV_HOTBACKUP */ /*======================================================================== --------------------------- LOWER LEVEL ROUTINES ------------------------- @@ -1063,7 +1035,7 @@ buf_page_in_file( /*=============*/ const buf_page_t* bpage) /*!< in: pointer to control block */ MY_ATTRIBUTE((warn_unused_result)); -#ifndef UNIV_HOTBACKUP + /*********************************************************************//** Determines if a block should be on unzip_LRU list. @return TRUE if block belongs to unzip_LRU */ @@ -1221,7 +1193,7 @@ buf_page_get_block( /*===============*/ buf_page_t* bpage) /*!< in: control block, or NULL */ MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ + #ifdef UNIV_DEBUG /*********************************************************************//** Gets a pointer to the memory frame of a block. @@ -1241,7 +1213,6 @@ Gets the compressed page descriptor corresponding to an uncompressed page if applicable. */ #define buf_block_get_page_zip(block) \ ((block)->page.zip.data ? &(block)->page.zip : NULL) -#ifndef UNIV_HOTBACKUP /** Get a buffer block from an adaptive hash index pointer. This function does not return if the block is not identified. @@ -1425,13 +1396,6 @@ buf_page_hash_get_low() function. #define buf_block_hash_get(b, page_id) \ buf_block_hash_get_locked(b, page_id, NULL, 0) -/*********************************************************************//** -Gets the current length of the free list of buffer blocks. -@return length of the free list */ -ulint -buf_get_free_list_len(void); -/*=======================*/ - /********************************************************************//** Determine if a block is a sentinel for a buffer pool watch. @return TRUE if a sentinel for a buffer pool watch, FALSE if not */ @@ -1531,8 +1495,6 @@ buf_flush_update_zip_checksum( ulint size, lsn_t lsn); -#endif /* !UNIV_HOTBACKUP */ - /********************************************************************//** The hook that is called just before a page is written to disk. The function encrypts the content of the page and returns a pointer @@ -1635,7 +1597,6 @@ public: /** Block state. @see buf_page_in_file */ buf_page_state state; -#ifndef UNIV_HOTBACKUP unsigned flush_type:2; /*!< if this block is currently being flushed to disk, this tells the flush_type. @@ -1646,7 +1607,6 @@ public: # error "MAX_BUFFER_POOLS > 64; redefine buf_pool_index:6" # endif /* @} */ -#endif /* !UNIV_HOTBACKUP */ page_zip_des_t zip; /*!< compressed page; zip.data (but not the data it points to) is also protected by buf_pool->mutex; @@ -1678,7 +1638,6 @@ public: buf_tmp_buffer_t* slot; /*!< Slot for temporary memory used for encryption/compression or NULL */ - #ifndef UNIV_HOTBACKUP buf_page_t* hash; /*!< node used in chaining to buf_pool->page_hash or buf_pool->zip_hash */ @@ -1792,7 +1751,6 @@ public: protected by buf_pool->zip_mutex or buf_block_t::mutex. */ # endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ }; /** The buffer control block structure */ @@ -1810,7 +1768,6 @@ struct buf_block_t{ is of size UNIV_PAGE_SIZE, and aligned to an address divisible by UNIV_PAGE_SIZE */ -#ifndef UNIV_HOTBACKUP BPageLock lock; /*!< read-write lock of the buffer frame */ UT_LIST_NODE_T(buf_block_t) unzip_LRU; @@ -1916,7 +1873,6 @@ struct buf_block_t{ and accessed; we introduce this new mutex in InnoDB-5.1 to relieve contention on the buffer pool mutex */ -#endif /* !UNIV_HOTBACKUP */ }; /** Check if a buf_block_t object is in a valid state @@ -1927,7 +1883,6 @@ struct buf_block_t{ && (buf_block_get_state(block) <= BUF_BLOCK_REMOVE_HASH)) -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Compute the hash fold value for blocks in buf_pool->zip_hash. */ /* @{ */ @@ -2462,7 +2417,6 @@ Use these instead of accessing buf_pool->mutex directly. */ /** Release the buffer pool mutex. */ # define buf_pool_mutex_exit(b) mutex_exit(&b->mutex) #endif -#endif /* !UNIV_HOTBACKUP */ /* @} */ /********************************************************************** diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 9ff2a1bfab5..f2b1b151598 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -32,7 +32,6 @@ Created 11/5/1995 Heikki Tuuri *******************************************************/ #include "mtr0mtr.h" -#ifndef UNIV_HOTBACKUP #include "buf0flu.h" #include "buf0lru.h" #include "buf0rea.h" @@ -208,7 +207,6 @@ buf_page_peek_if_too_old( return(!buf_page_peek_if_young(bpage)); } } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets the state of a block. @@ -385,7 +383,6 @@ buf_page_in_file( return(FALSE); } -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Determines if a block should be on unzip_LRU list. @return TRUE if block belongs to unzip_LRU */ @@ -717,7 +714,6 @@ buf_page_get_block( return(NULL); } -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /*********************************************************************//** @@ -744,9 +740,7 @@ buf_block_get_frame( ut_error; break; case BUF_BLOCK_FILE_PAGE: -# ifndef UNIV_HOTBACKUP ut_a(block->page.buf_fix_count > 0); -# endif /* !UNIV_HOTBACKUP */ /* fall through */ case BUF_BLOCK_READY_FOR_USE: case BUF_BLOCK_MEMORY: @@ -796,7 +790,6 @@ buf_ptr_get_fsp_addr( addr->boffset = ut_align_offset(ptr, UNIV_PAGE_SIZE); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Gets the hash value of the page the pointer is pointing to. This can be used in searches in the lock hash table. @@ -866,7 +859,6 @@ buf_block_free( buf_pool_mutex_exit(buf_pool); } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Copies contents of a buffer frame to a given buffer. @@ -885,7 +877,6 @@ buf_frame_copy( return(buf); } -#ifndef UNIV_HOTBACKUP /********************************************************************//** Gets the youngest modification log sequence number for a frame. Returns zero if not file page or no modification occurred yet. @@ -1460,5 +1451,3 @@ buf_pool_size_align( return (ulint)((size / m + 1) * m); } } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/buf0dblwr.h b/storage/innobase/include/buf0dblwr.h index eb13c3b35e5..fdb9ab15a24 100644 --- a/storage/innobase/include/buf0dblwr.h +++ b/storage/innobase/include/buf0dblwr.h @@ -32,8 +32,6 @@ Created 2011/12/19 Inaam Rana #include "buf0types.h" #include "log0recv.h" -#ifndef UNIV_HOTBACKUP - /** Doublewrite system */ extern buf_dblwr_t* buf_dblwr; /** Set to TRUE when the doublewrite buffer is being created */ @@ -156,7 +154,4 @@ struct buf_dblwr_t{ cached to write_buf */ }; - -#endif /* UNIV_HOTBACKUP */ - #endif diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h index 40083798d48..273f9666419 100644 --- a/storage/innobase/include/buf0flu.h +++ b/storage/innobase/include/buf0flu.h @@ -30,7 +30,6 @@ Created 11/5/1995 Heikki Tuuri #include "univ.i" #include "ut0byte.h" #include "log0log.h" -#ifndef UNIV_HOTBACKUP #include "buf0types.h" /** Flag indicating if the page_cleaner is in active state. */ @@ -77,7 +76,6 @@ void buf_flush_write_complete( /*=====================*/ buf_page_t* bpage); /*!< in: pointer to the block in question */ -#endif /* !UNIV_HOTBACKUP */ /** Initialize a page for writing to the tablespace. @param[in] block buffer block; NULL if bypassing the buffer pool @param[in,out] page page frame @@ -92,7 +90,6 @@ buf_flush_init_for_writing( lsn_t newest_lsn, bool skip_checksum); -#ifndef UNIV_HOTBACKUP # if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG /********************************************************************//** Writes a flushable page asynchronously from the buffer pool to a file. @@ -128,7 +125,6 @@ buf_flush_do_batch( lsn_t lsn_limit, flush_counters_t* n); - /** This utility flushes dirty blocks from the end of the flush list of all buffer pool instances. NOTE: The calling thread is not allowed to own any latches on pages! @@ -438,8 +434,6 @@ private: bool m_interrupted; }; -#endif /* !UNIV_HOTBACKUP */ - /******************************************************************//** Start a buffer flush batch for LRU or flush list */ ibool diff --git a/storage/innobase/include/buf0flu.ic b/storage/innobase/include/buf0flu.ic index ecb98e32619..5a682ed121a 100644 --- a/storage/innobase/include/buf0flu.ic +++ b/storage/innobase/include/buf0flu.ic @@ -23,7 +23,6 @@ The database buffer pool flush algorithm Created 11/5/1995 Heikki Tuuri *******************************************************/ -#ifndef UNIV_HOTBACKUP #include "buf0buf.h" #include "mtr0mtr.h" #include "srv0srv.h" @@ -148,4 +147,3 @@ buf_flush_recv_note_modification( buf_page_mutex_exit(block); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h index 0cbd77878ec..2ad1211a548 100644 --- a/storage/innobase/include/buf0lru.h +++ b/storage/innobase/include/buf0lru.h @@ -27,7 +27,6 @@ Created 11/5/1995 Heikki Tuuri #define buf0lru_h #include "univ.i" -#ifndef UNIV_HOTBACKUP #include "ut0byte.h" #include "buf0types.h" @@ -292,6 +291,4 @@ Increments the page_zip_decompress() counter in buf_LRU_stat_cur. */ #include "buf0lru.ic" #endif -#endif /* !UNIV_HOTBACKUP */ - #endif diff --git a/storage/innobase/include/data0data.h b/storage/innobase/include/data0data.h index 5537d70548a..8385fe3d0d3 100644 --- a/storage/innobase/include/data0data.h +++ b/storage/innobase/include/data0data.h @@ -196,7 +196,7 @@ dfield_dup( dfield_t* field, /*!< in/out: data field */ mem_heap_t* heap) /*!< in: memory heap where allocated */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP + /*********************************************************************//** Tests if two data fields are equal. If len==0, tests the data length and content for equality. @@ -222,7 +222,6 @@ dfield_data_is_binary_equal( ulint len, /*!< in: data length or UNIV_SQL_NULL */ const byte* data) /*!< in: data */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets number of fields in a data tuple. @return number of fields */ @@ -338,7 +337,6 @@ dtuple_create( ulint n_fields)/*!< in: number of fields */ MY_ATTRIBUTE((nonnull, malloc)); - /** Initialize the virtual field data in a dtuple_t @param[in,out] vrow dtuple contains the virtual fields */ UNIV_INLINE @@ -631,7 +629,6 @@ struct dtuple_t { #endif /* UNIV_DEBUG */ }; - /** A slot for a field in a big rec vector */ struct big_rec_field_t { diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic index dc51735d340..71698cc12b3 100644 --- a/storage/innobase/include/data0data.ic +++ b/storage/innobase/include/data0data.ic @@ -285,7 +285,6 @@ dfield_dup( } } -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Tests if two data fields are equal. If len==0, tests the data length and content for equality. @@ -330,7 +329,6 @@ dfield_data_is_binary_equal( && (len == UNIV_SQL_NULL || !memcmp(dfield_get_data(field), data, len))); } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets info bits in a data tuple. diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 27310963ec5..d38aa7c1533 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -260,7 +260,6 @@ the underling datatype of GEOMETRY(not DATA_POINT) data. */ /* Mask to get the Charset Collation number (0x7fff) */ #define CHAR_COLL_MASK MAX_CHAR_COLL_NUM -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Gets the MySQL type code from a dtype. @return MySQL type code; this is NOT an InnoDB type code! */ @@ -286,7 +285,6 @@ dtype_get_at_most_n_mbchars( ulint data_len, /*!< in: length of str (in bytes) */ const char* str); /*!< in: the string whose prefix length is being determined */ -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Checks if a data main type is a string type. Also a BLOB is considered a string type. @@ -350,7 +348,7 @@ ulint dtype_get_prtype( /*=============*/ const dtype_t* type); /*!< in: data type */ -#ifndef UNIV_HOTBACKUP + /*********************************************************************//** Compute the mbminlen and mbmaxlen members of a data type structure. */ UNIV_INLINE @@ -391,7 +389,6 @@ ibool dtype_is_utf8( /*==========*/ ulint prtype);/*!< in: precise data type */ -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets the type length. @return fixed length of the type, in bytes, or 0 if variable-length */ @@ -400,7 +397,7 @@ ulint dtype_get_len( /*==========*/ const dtype_t* type); /*!< in: data type */ -#ifndef UNIV_HOTBACKUP + /*********************************************************************//** Gets the minimum length of a character, in bytes. @return minimum length of a char, in bytes, or 0 if this is not a @@ -432,7 +429,6 @@ dtype_set_mbminmaxlen( ulint mbmaxlen); /*!< in: maximum length of a char, in bytes, or 0 if this is not a character type */ -#endif /* !UNIV_HOTBACKUP */ /***********************************************************************//** Returns the size of a fixed size data type, 0 if not a fixed size type. @return fixed size, or 0 */ @@ -446,7 +442,7 @@ dtype_get_fixed_size_low( ulint mbminmaxlen, /*!< in: minimum and maximum length of a multibyte character, in bytes */ ulint comp); /*!< in: nonzero=ROW_FORMAT=COMPACT */ -#ifndef UNIV_HOTBACKUP + /***********************************************************************//** Returns the minimum size of a data type. @return minimum size */ @@ -469,7 +465,6 @@ dtype_get_max_size_low( /*===================*/ ulint mtype, /*!< in: main type */ ulint len); /*!< in: length */ -#endif /* !UNIV_HOTBACKUP */ /***********************************************************************//** Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a type. For fixed length types it is the fixed length of the type, otherwise 0. @@ -480,7 +475,7 @@ dtype_get_sql_null_size( /*====================*/ const dtype_t* type, /*!< in: type */ ulint comp); /*!< in: nonzero=ROW_FORMAT=COMPACT */ -#ifndef UNIV_HOTBACKUP + /**********************************************************************//** Reads to a type the stored information which determines its alphabetical ordering and the storage size of an SQL NULL value. */ @@ -528,8 +523,6 @@ dtype_sql_name( char* name, /*!< out: SQL name */ unsigned name_sz);/*!< in: size of the name buffer */ -#endif /* !UNIV_HOTBACKUP */ - /*********************************************************************//** Validates a data type structure. @return TRUE if ok */ @@ -572,13 +565,11 @@ struct dtype_t{ string data (in addition to the string, MySQL uses 1 or 2 bytes to store the string length) */ -#ifndef UNIV_HOTBACKUP unsigned mbminmaxlen:5; /*!< minimum and maximum length of a character, in bytes; DATA_MBMINMAXLEN(mbminlen,mbmaxlen); mbminlen=DATA_MBMINLEN(mbminmaxlen); mbmaxlen=DATA_MBMINLEN(mbminmaxlen) */ -#endif /* !UNIV_HOTBACKUP */ }; #ifndef UNIV_NONINL diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index 57770ec0e17..869d0ba8ed6 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -24,8 +24,7 @@ Created 1/16/1996 Heikki Tuuri *******************************************************/ #include "mach0data.h" -#ifndef UNIV_HOTBACKUP -# include "ha_prototypes.h" +#include "ha_prototypes.h" /*********************************************************************//** Gets the MySQL charset-collation code for MySQL string types. @@ -137,9 +136,6 @@ dtype_set_mblen( ut_ad(dtype_validate(type)); } -#else /* !UNIV_HOTBACKUP */ -# define dtype_set_mblen(type) (void) 0 -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Sets a data type structure. */ @@ -218,7 +214,6 @@ dtype_get_len( return(type->len); } -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Gets the minimum length of a character, in bytes. @return minimum length of a char, in bytes, or 0 if this is not a @@ -471,8 +466,6 @@ dtype_sql_name( return(name); } -#endif /* !UNIV_HOTBACKUP */ - /***********************************************************************//** Returns the size of a fixed size data type, 0 if not a fixed size type. @return fixed size, or 0 */ @@ -513,7 +506,6 @@ dtype_get_fixed_size_low( case DATA_POINT: return(len); case DATA_MYSQL: -#ifndef UNIV_HOTBACKUP if (prtype & DATA_BINARY_TYPE) { return(len); } else if (!comp) { @@ -534,9 +526,6 @@ dtype_get_fixed_size_low( return(len); } } -#else /* !UNIV_HOTBACKUP */ - return(len); -#endif /* !UNIV_HOTBACKUP */ /* fall through for variable-length charsets */ case DATA_VARCHAR: case DATA_BINARY: @@ -553,7 +542,6 @@ dtype_get_fixed_size_low( return(0); } -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Returns the minimum size of a data type. @return minimum size */ @@ -659,7 +647,6 @@ dtype_get_max_size_low( return(ULINT_MAX); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************************//** Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a type. @@ -672,11 +659,6 @@ dtype_get_sql_null_size( const dtype_t* type, /*!< in: type */ ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */ { -#ifndef UNIV_HOTBACKUP return(dtype_get_fixed_size_low(type->mtype, type->prtype, type->len, type->mbminmaxlen, comp)); -#else /* !UNIV_HOTBACKUP */ - return(dtype_get_fixed_size_low(type->mtype, type->prtype, type->len, - 0, 0)); -#endif /* !UNIV_HOTBACKUP */ } diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index d42a5f6ee4b..be6f6b1d9a5 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -51,8 +51,7 @@ Created 1/8/1996 Heikki Tuuri extern bool innodb_table_stats_not_found; extern bool innodb_index_stats_not_found; -#ifndef UNIV_HOTBACKUP -# include "sync0rw.h" +#include "sync0rw.h" /********************************************************************//** Get the database name length in a table name. @return database name length */ @@ -228,7 +227,6 @@ dict_max_v_field_len_store_undo( dict_table_t* table, ulint col_no); -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /*********************************************************************//** Assert that a column and a data type match. @@ -241,7 +239,7 @@ dict_col_type_assert_equal( const dtype_t* type) /*!< in: data type */ MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif /* UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP + /***********************************************************************//** Returns the minimum size of the column. @return minimum size */ @@ -380,7 +378,6 @@ dict_table_autoinc_unlock( /*======================*/ dict_table_t* table) /*!< in/out: table */ MY_ATTRIBUTE((nonnull)); -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Adds system columns to a table object. */ void @@ -389,7 +386,7 @@ dict_table_add_system_columns( dict_table_t* table, /*!< in/out: table */ mem_heap_t* heap) /*!< in: temporary heap */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP + /** Mark if table has big rows. @param[in,out] table table handler */ void @@ -731,7 +728,6 @@ dict_table_get_next_index( # define dict_table_get_last_index(table) UT_LIST_GET_LAST((table)->indexes) # define dict_table_get_next_index(index) UT_LIST_GET_NEXT(indexes, index) #endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ /* Skip corrupted index */ #define dict_table_skip_corrupt_index(index) \ @@ -894,7 +890,6 @@ dict_table_n_rows_dec( dict_table_t* table) /*!< in/out: table */ MY_ATTRIBUTE((nonnull)); - /** Get nth virtual column @param[in] table target table @param[in] col_nr column number in MySQL Table definition @@ -953,7 +948,7 @@ dict_table_get_sys_col_no( const dict_table_t* table, /*!< in: table */ ulint sys) /*!< in: DATA_ROW_ID, ... */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#ifndef UNIV_HOTBACKUP + /********************************************************************//** Returns the minimum data size of an index record. @return minimum data size in bytes */ @@ -963,7 +958,6 @@ dict_index_get_min_size( /*====================*/ const dict_index_t* index) /*!< in: index */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Check whether the table uses the compact page format. @return TRUE if table uses the compact page format */ @@ -1076,7 +1070,6 @@ dict_table_page_size( const dict_table_t* table) MY_ATTRIBUTE((warn_unused_result)); -#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 @@ -1206,7 +1199,6 @@ dict_index_add_to_cache_w_vcol( ulint page_no, ibool strict) MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Gets the number of fields in the internal representation of an index, including fields added by the dictionary system. @@ -1397,7 +1389,7 @@ dict_index_add_col( dict_col_t* col, /*!< in: column */ ulint prefix_len) /*!< in: column prefix length */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP + /*******************************************************************//** Copies types of fields contained in index to tuple. */ void @@ -1408,7 +1400,6 @@ dict_index_copy_types( ulint n_fields) /*!< in: number of field types to copy */ MY_ATTRIBUTE((nonnull)); -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets the field column. @return field->col, pointer to the table column */ @@ -1418,7 +1409,7 @@ dict_field_get_col( /*===============*/ const dict_field_t* field) /*!< in: index field */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#ifndef UNIV_HOTBACKUP + /**********************************************************************//** Returns an index object if it is found in the dictionary cache. Assumes that dict_sys->mutex is already being held. @@ -1789,7 +1780,6 @@ struct dict_sys_t{ table_non_LRU; /*!< List of tables that can't be evicted from the cache */ }; -#endif /* !UNIV_HOTBACKUP */ /** dummy index for ROW_FORMAT=REDUNDANT supremum and infimum records */ extern dict_index_t* dict_ind_redundant; @@ -1881,7 +1871,7 @@ Closes the data dictionary module. */ void dict_close(void); /*============*/ -#ifndef UNIV_HOTBACKUP + /**********************************************************************//** Check whether the table is corrupted. @return nonzero for corrupted table, zero for valid tables */ @@ -1902,7 +1892,6 @@ dict_index_is_corrupted( const dict_index_t* index) /*!< in: index */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Flags an index and table corrupted both in the data dictionary cache and in the system table SYS_INDEXES. */ @@ -2014,7 +2003,6 @@ dict_disable_redo_if_temporary( const dict_table_t* table, /*!< in: table to check */ mtr_t* mtr); /*!< out: mini-transaction */ -#ifndef UNIV_HOTBACKUP /*********************************************************************//** This function should be called whenever a page is successfully compressed. Updates the compression padding information. */ @@ -2115,9 +2103,6 @@ bool dict_table_have_virtual_index( dict_table_t* table); -#endif /* !UNIV_HOTBACKUP */ - - #ifndef UNIV_NONINL #include "dict0dict.ic" #endif diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 9bf6b8df4bc..b99cb421ab2 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -25,7 +25,6 @@ Created 1/8/1996 Heikki Tuuri ***********************************************************************/ #include "data0type.h" -#ifndef UNIV_HOTBACKUP #include "dict0load.h" #include "rem0types.h" #include "fsp0fsp.h" @@ -101,8 +100,6 @@ dict_col_is_virtual( return(col->prtype & DATA_VIRTUAL); } -#endif /* !UNIV_HOTBACKUP */ - #ifdef UNIV_DEBUG /*********************************************************************//** Assert that a column and a data type match. @@ -120,15 +117,12 @@ dict_col_type_assert_equal( ut_ad(col->mtype == type->mtype); ut_ad(col->prtype == type->prtype); //ut_ad(col->len == type->len); -# ifndef UNIV_HOTBACKUP ut_ad(col->mbminmaxlen == type->mbminmaxlen); -# endif /* !UNIV_HOTBACKUP */ return(TRUE); } #endif /* UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Returns the minimum size of the column. @return minimum size */ @@ -152,7 +146,6 @@ dict_col_get_max_size( { return(dtype_get_max_size_low(col->mtype, col->len)); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************************//** Returns the size of a fixed size column, 0 if not a fixed size column. @return fixed size, or 0 */ @@ -245,7 +238,6 @@ dict_col_get_index_pos( return(ULINT_UNDEFINED); } -#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG /********************************************************************//** Gets the first index on the table (the clustered index). @@ -293,7 +285,6 @@ dict_table_get_next_index( return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index)); } #endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Check whether the index is the clustered index. @@ -1191,7 +1182,6 @@ dict_table_page_size( return(dict_tf_get_page_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 @@ -1234,7 +1224,6 @@ 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, @@ -1440,7 +1429,6 @@ dict_index_get_nth_col_pos( prefix_col_pos)); } -#ifndef UNIV_HOTBACKUP /********************************************************************//** Returns the minimum data size of an index record. @return minimum data size in bytes */ @@ -1974,4 +1962,3 @@ dict_table_have_virtual_index( return(false); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 74bb00b730b..538306f7af8 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -35,11 +35,9 @@ Created 1/8/1996 Heikki Tuuri #include "row0types.h" #include "rem0types.h" #include "btr0types.h" -#ifndef UNIV_HOTBACKUP -# include "lock0types.h" -# include "que0types.h" -# include "sync0rw.h" -#endif /* !UNIV_HOTBACKUP */ +#include "lock0types.h" +#include "que0types.h" +#include "sync0rw.h" #include "ut0mem.h" #include "ut0rnd.h" #include "ut0byte.h" @@ -50,7 +48,6 @@ Created 1/8/1996 Heikki Tuuri #include "gis0type.h" #include "os0once.h" #include "ut0new.h" - #include "fil0fil.h" #include <my_crypt.h> #include "fil0crypt.h" @@ -869,7 +866,6 @@ struct dict_index_t{ id_name_t name; /*!< index name */ const char* table_name;/*!< table name */ dict_table_t* table; /*!< back pointer to table */ -#ifndef UNIV_HOTBACKUP unsigned space:32; /*!< space where the index tree is placed */ unsigned page:32;/*!< index tree root page number */ @@ -878,7 +874,6 @@ struct dict_index_t{ data size drops below this limit in percent, merging it to a neighbor is tried */ # define DICT_INDEX_MERGE_THRESHOLD_DEFAULT 50 -#endif /* !UNIV_HOTBACKUP */ unsigned type:DICT_IT_BITS; /*!< index type (DICT_CLUSTERED, DICT_UNIQUE, DICT_IBUF, DICT_CORRUPT) */ @@ -940,7 +935,6 @@ struct dict_index_t{ bool has_new_v_col; /*!< whether it has a newly added virtual column in ALTER */ -#ifndef UNIV_HOTBACKUP UT_LIST_NODE_T(dict_index_t) indexes;/*!< list of indexes of the table */ btr_search_t* search_info; @@ -1028,7 +1022,6 @@ struct dict_index_t{ ut_ad(committed || !(type & DICT_CLUSTERED)); uncommitted = !committed; } -#endif /* !UNIV_HOTBACKUP */ }; /** The status of online index creation */ @@ -1514,7 +1507,6 @@ struct dict_table_t { /*!< !DICT_FRM_CONSISTENT==0 if data dictionary information and MySQL FRM information mismatch. */ -#ifndef UNIV_HOTBACKUP /** Hash chain node. */ hash_node_t name_hash; @@ -1775,8 +1767,6 @@ public: /** Timestamp of the last modification of this table. */ time_t update_time; -#endif /* !UNIV_HOTBACKUP */ - bool is_encrypted; #ifdef UNIV_DEBUG diff --git a/storage/innobase/include/dict0mem.ic b/storage/innobase/include/dict0mem.ic index a50fb615a09..933f233aae6 100644 --- a/storage/innobase/include/dict0mem.ic +++ b/storage/innobase/include/dict0mem.ic @@ -60,11 +60,9 @@ dict_mem_fill_index_struct( /* Assign a ulint to a 4-bit-mapped field. Only the low-order 4 bits are assigned. */ index->type = type; -#ifndef UNIV_HOTBACKUP index->space = (unsigned int) space; index->page = FIL_NULL; index->merge_threshold = DICT_INDEX_MERGE_THRESHOLD_DEFAULT; -#endif /* !UNIV_HOTBACKUP */ index->table_name = table_name; index->n_fields = (unsigned int) n_fields; /* The '1 +' above prevents allocation diff --git a/storage/innobase/include/dict0priv.ic b/storage/innobase/include/dict0priv.ic index fd10c566be6..fb7af2772fc 100644 --- a/storage/innobase/include/dict0priv.ic +++ b/storage/innobase/include/dict0priv.ic @@ -26,7 +26,6 @@ Created Wed 13 Oct 2010 16:10:14 EST Sunny Bains #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 @@ -125,4 +124,3 @@ dict_table_check_if_in_cache_low( !strcmp(table->name.m_name, table_name)); DBUG_RETURN(table); } -#endif /*! UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 918a849be3d..1e07c4f8fb5 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -33,64 +33,11 @@ Created 10/25/1995 Heikki Tuuri #include "log0recv.h" #include "dict0types.h" #include "page0size.h" -#ifndef UNIV_HOTBACKUP #include "ibuf0types.h" -#else -#include "log0log.h" -#include "os0file.h" -#include "m_string.h" -#endif /* !UNIV_HOTBACKUP */ #include <list> #include <vector> -#ifdef UNIV_HOTBACKUP -#include <cstring> -/** determine if file is intermediate / temporary.These files are created during -reorganize partition, rename tables, add / drop columns etc. -@param[in] filepath asbosolute / relative or simply file name -@retvalue true if it is intermediate file -@retvalue false if it is normal file */ -inline -bool -is_intermediate_file(const std::string& filepath) -{ - std::string file_name = filepath; - - // extract file name from relative or absolute file name - std::size_t pos = file_name.rfind(OS_PATH_SEPARATOR); - if (pos != std::string::npos) - file_name = file_name.substr(++pos); - - transform(file_name.begin(), file_name.end(), - file_name.begin(), ::tolower); - - if (file_name[0] != '#') { - pos = file_name.rfind("#tmp#.ibd"); - if (pos != std::string::npos) - return true; - else - return false; /* normal file name */ - } - - std::vector<std::string> file_name_patterns = {"#sql-", "#sql2-", - "#tmp#", "#ren#"}; - - /* search for the unsupported patterns */ - for (auto itr = file_name_patterns.begin(); - itr != file_name_patterns.end(); - itr++) { - - if (0 == std::strncmp(file_name.c_str(), - itr->c_str(), itr->length())){ - return true; - } - } - - return false; -} -#endif /* UNIV_HOTBACKUP */ - extern const char general_space_name[]; // Forward declaration @@ -205,10 +152,8 @@ struct fil_space_t { Protected by fil_system->mutex. */ hash_node_t hash; /*!< hash chain node */ hash_node_t name_hash;/*!< hash chain the name_hash table */ -#ifndef UNIV_HOTBACKUP rw_lock_t latch; /*!< latch protecting the file space storage allocation */ -#endif /* !UNIV_HOTBACKUP */ UT_LIST_NODE_T(fil_space_t) unflushed_spaces; /*!< list of spaces with at least one unflushed file we have written to */ @@ -619,9 +564,7 @@ fil_space_get( data space) is stored here; below we talk about tablespaces, but also the ib_logfiles form a 'space' and it is handled here */ struct fil_system_t { -#ifndef UNIV_HOTBACKUP ib_mutex_t mutex; /*!< The mutex protecting the cache */ -#endif /* !UNIV_HOTBACKUP */ hash_table_t* spaces; /*!< The hash table of spaces in the system; they are hashed on the space id */ @@ -683,7 +626,6 @@ extern fil_system_t* fil_system; #include "fil0crypt.h" -#ifndef UNIV_HOTBACKUP /** Returns the latch of a file space. @param[in] id space id @param[out] flags tablespace flags @@ -710,15 +652,14 @@ void fil_space_set_imported( ulint id); -# ifdef UNIV_DEBUG +#ifdef UNIV_DEBUG /** Determine if a tablespace is temporary. @param[in] id tablespace identifier @return whether it is a temporary tablespace */ bool fsp_is_temporary(ulint id) MY_ATTRIBUTE((warn_unused_result, pure)); -# endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG */ /** Append a file to the chain of files of a space. @param[in] name file name of a file that is not open @@ -884,7 +825,6 @@ void fil_set_max_space_id_if_bigger( /*===========================*/ ulint max_id);/*!< in: maximum known id */ -#ifndef UNIV_HOTBACKUP /** Write the flushed LSN to the page header of the first page in the system tablespace. @@ -976,8 +916,6 @@ private: fil_space_t* m_space; }; -#endif /* !UNIV_HOTBACKUP */ - /********************************************************//** Creates the database directory for a table if it does not exist yet. */ void @@ -1077,7 +1015,7 @@ fil_close_tablespace( /*=================*/ trx_t* trx, /*!< in/out: Transaction covering the close */ ulint id); /*!< in: space id */ -#ifndef UNIV_HOTBACKUP + /*******************************************************************//** Discards a single-table tablespace. The tablespace must be cached in the memory cache. Discarding is like deleting a tablespace, but @@ -1097,7 +1035,6 @@ fil_discard_tablespace( /*===================*/ ulint id) /*!< in: space id */ MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /** Test if a tablespace file can be renamed to a new filepath by checking if that the old filepath exists and the new filepath does not exist. @@ -1243,7 +1180,6 @@ fil_file_readdir_next_file( os_file_dir_t dir, /*!< in: directory stream */ os_file_stat_t* info); /*!< in/out: buffer where the info is returned */ -#ifndef UNIV_HOTBACKUP /*******************************************************************//** Returns true if a matching tablespace exists in the InnoDB tablespace memory cache. Note that if we have not done a crash recovery at the database startup, @@ -1265,7 +1201,7 @@ fil_space_for_table_exists_in_mem( mem_heap_t* heap, /*!< in: heap memory */ table_id_t table_id, /*!< in: table id */ dict_table_t* table); /*!< in: table or NULL */ -#endif /* !UNIV_HOTBACKUP */ + /** Try to extend a tablespace if it is smaller than the specified size. @param[in,out] space tablespace @param[in] size desired size in pages diff --git a/storage/innobase/include/fut0lst.h b/storage/innobase/include/fut0lst.h index 9c980d1358d..e29973c1696 100644 --- a/storage/innobase/include/fut0lst.h +++ b/storage/innobase/include/fut0lst.h @@ -48,7 +48,7 @@ typedef byte flst_node_t; /* The physical size of a list node in bytes */ #define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE) -#if !defined UNIV_HOTBACKUP && !defined UNIV_INNOCHECKSUM +#ifndef UNIV_INNOCHECKSUM /********************************************************************//** Initializes a list base node. */ UNIV_INLINE @@ -204,6 +204,6 @@ flst_print( #include "fut0lst.ic" #endif -#endif /* !UNIV_HOTBACKUP && !UNIV_INNOCHECKSUM*/ +#endif /* !UNIV_INNOCHECKSUM */ #endif diff --git a/storage/innobase/include/ha0ha.h b/storage/innobase/include/ha0ha.h index 15a99ddf683..6857670a01b 100644 --- a/storage/innobase/include/ha0ha.h +++ b/storage/innobase/include/ha0ha.h @@ -174,7 +174,7 @@ ha_search_and_delete_if_found( hash_table_t* table, /*!< in: hash table */ ulint fold, /*!< in: folded value of the searched data */ const rec_t* data); /*!< in: pointer to the data */ -#ifndef UNIV_HOTBACKUP + /*****************************************************************//** Removes from the chain determined by fold all nodes whose data pointer points to the page given. */ @@ -202,7 +202,6 @@ ha_print_info( /*==========*/ FILE* file, /*!< in: file where to print */ hash_table_t* table); /*!< in: hash table */ -#endif /* !UNIV_HOTBACKUP */ /** The hash table external chain node */ struct ha_node_t { diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 116ca781726..c10644be832 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -31,7 +31,7 @@ simple headers. #include "univ.i" -#if !defined UNIV_HOTBACKUP && !defined UNIV_INNOCHECKSUM +#ifndef UNIV_INNOCHECKSUM /* Forward declarations */ class THD; @@ -668,5 +668,5 @@ innobase_destroy_background_thd(MYSQL_THD); void innobase_reset_background_thd(MYSQL_THD); -#endif /* !UNIV_HOTBACKUP && !UNIV_INNOCHECKSUM */ +#endif /* !UNIV_INNOCHECKSUM */ #endif /* HA_INNODB_PROTOTYPES_H */ diff --git a/storage/innobase/include/hash0hash.h b/storage/innobase/include/hash0hash.h index a7bcee1185b..2922d424d37 100644 --- a/storage/innobase/include/hash0hash.h +++ b/storage/innobase/include/hash0hash.h @@ -28,9 +28,7 @@ Created 5/20/1997 Heikki Tuuri #include "univ.i" #include "mem0mem.h" -#ifndef UNIV_HOTBACKUP -# include "sync0rw.h" -#endif /* !UNIV_HOTBACKUP */ +#include "sync0rw.h" struct hash_table_t; struct hash_cell_t; @@ -60,7 +58,7 @@ hash_table_t* hash_create( /*========*/ ulint n); /*!< in: number of array cells */ -#ifndef UNIV_HOTBACKUP + /*************************************************************//** Creates a sync object array array to protect a hash table. ::sync_obj can be mutexes or rw_locks depening on the type of @@ -74,7 +72,6 @@ hash_create_sync_obj( latch_id_t id, /*!< in: mutex/rw_lock ID */ ulint n_sync_obj);/*!< in: number of sync objects, must be a power of 2 */ -#endif /* !UNIV_HOTBACKUP */ /*************************************************************//** Frees a hash table. */ @@ -91,15 +88,11 @@ hash_calc_hash( /*===========*/ ulint fold, /*!< in: folded value */ hash_table_t* table); /*!< in: hash table */ -#ifndef UNIV_HOTBACKUP /********************************************************************//** Assert that the mutex for the table is held */ -# define HASH_ASSERT_OWN(TABLE, FOLD) \ +#define HASH_ASSERT_OWN(TABLE, FOLD) \ ut_ad((TABLE)->type != HASH_TABLE_SYNC_MUTEX \ || (mutex_own(hash_get_mutex((TABLE), FOLD)))); -#else /* !UNIV_HOTBACKUP */ -# define HASH_ASSERT_OWN(TABLE, FOLD) -#endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** Inserts a struct to a hash table. */ @@ -337,7 +330,6 @@ do {\ mem_heap_free_top(hash_get_heap(TABLE, fold111), sizeof(TYPE));\ } while (0) -#ifndef UNIV_HOTBACKUP /****************************************************************//** Move all hash table entries from OLD_TABLE to NEW_TABLE. */ @@ -537,22 +529,6 @@ hash_unlock_x_all_but( hash_table_t* table, /*!< in: hash table */ rw_lock_t* keep_lock); /*!< in: lock to keep */ -#else /* !UNIV_HOTBACKUP */ -# define hash_get_heap(table, fold) ((table)->heap) -# define hash_mutex_enter(table, fold) ((void) 0) -# define hash_mutex_exit(table, fold) ((void) 0) -# define hash_mutex_enter_all(table) ((void) 0) -# define hash_mutex_exit_all(table) ((void) 0) -# define hash_mutex_exit_all_but(t, m) ((void) 0) -# define hash_lock_s(t, f) ((void) 0) -# define hash_lock_x(t, f) ((void) 0) -# define hash_unlock_s(t, f) ((void) 0) -# define hash_unlock_x(t, f) ((void) 0) -# define hash_lock_x_all(t) ((void) 0) -# define hash_unlock_x_all(t) ((void) 0) -# define hash_unlock_x_all_but(t, l) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ - struct hash_cell_t{ void* node; /*!< hash chain node, NULL if none */ }; @@ -561,15 +537,13 @@ struct hash_cell_t{ struct hash_table_t { enum hash_table_sync_t type; /*<! type of hash_table. */ #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG -# ifndef UNIV_HOTBACKUP ibool adaptive;/* TRUE if this is the hash table of the adaptive hash index */ -# endif /* !UNIV_HOTBACKUP */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ ulint n_cells;/* number of cells in the hash table */ hash_cell_t* array; /*!< pointer to cell array */ -#ifndef UNIV_HOTBACKUP + ulint n_sync_obj;/* if sync_objs != NULL, then the number of either the number of mutexes or the number of @@ -589,7 +563,6 @@ struct hash_table_t { can be allocated from these memory heaps; there are then n_mutexes many of these heaps */ -#endif /* !UNIV_HOTBACKUP */ mem_heap_t* heap; #ifdef UNIV_DEBUG ulint magic_n; diff --git a/storage/innobase/include/hash0hash.ic b/storage/innobase/include/hash0hash.ic index b99ac1eb501..8a2e4949694 100644 --- a/storage/innobase/include/hash0hash.ic +++ b/storage/innobase/include/hash0hash.ic @@ -85,7 +85,6 @@ hash_calc_hash( return(ut_hash_ulint(fold, table->n_cells)); } -#ifndef UNIV_HOTBACKUP /************************************************************//** Gets the sync object index for a fold value in a hash table. @return index */ @@ -276,4 +275,3 @@ hash_lock_x_confirm( return(hash_lock); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h index f3fd5e9a364..e646f678964 100644 --- a/storage/innobase/include/ibuf0ibuf.h +++ b/storage/innobase/include/ibuf0ibuf.h @@ -32,9 +32,7 @@ Created 7/19/1997 Heikki Tuuri #include "mtr0mtr.h" #include "dict0mem.h" #include "fsp0fsp.h" - -#ifndef UNIV_HOTBACKUP -# include "ibuf0types.h" +#include "ibuf0types.h" /** Default value for maximum on-disk size of change buffer in terms of percentage of the buffer pool. */ @@ -377,7 +375,6 @@ ibuf_merge_space( /*=============*/ ulint space); /*!< in: space id */ -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Parses a redo log record of an ibuf bitmap page init. @return end of log record or NULL */ @@ -388,9 +385,8 @@ ibuf_parse_bitmap_init( byte* end_ptr,/*!< in: buffer end */ buf_block_t* block, /*!< in: block or NULL */ mtr_t* mtr); /*!< in: mtr or NULL */ -#ifndef UNIV_HOTBACKUP -#ifdef UNIV_IBUF_COUNT_DEBUG +#ifdef UNIV_IBUF_COUNT_DEBUG /** Gets the ibuf count for a given page. @param[in] page_id page id @return number of entries in the insert buffer currently buffered for @@ -398,7 +394,6 @@ this page */ ulint ibuf_count_get( const page_id_t& page_id); - #endif /******************************************************************//** Looks if the insert buffer is empty. @@ -447,8 +442,6 @@ ibuf_set_bitmap_for_bulk_load( #define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO #define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO -#endif /* !UNIV_HOTBACKUP */ - /* The ibuf header page currently contains only the file segment header for the file segment from which the pages for the ibuf tree are allocated */ #define IBUF_HEADER PAGE_DATA diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index de39592ae6b..09070c14059 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -26,7 +26,6 @@ Created 7/19/1997 Heikki Tuuri #include "page0page.h" #include "page0zip.h" #include "fsp0types.h" -#ifndef UNIV_HOTBACKUP #include "buf0lru.h" /** An index page must contain at least UNIV_PAGE_SIZE / @@ -340,4 +339,3 @@ ibuf_update_free_bits_if_full( ibuf_set_free_bits(block, after, before); } } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index caa067cd4ba..68dc8faf519 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -35,9 +35,7 @@ Created 12/9/1995 Heikki Tuuri #include "univ.i" #include "dyn0buf.h" -#ifndef UNIV_HOTBACKUP #include "sync0rw.h" -#endif /* !UNIV_HOTBACKUP */ #include "log0crypt.h" #include "log0types.h" @@ -72,7 +70,6 @@ log_calc_where_lsn_is( files */ int64_t log_file_size); /*!< in: log file size (including the header) */ -#ifndef UNIV_HOTBACKUP /** Append a string to the log. @param[in] str string @param[in] len string length @@ -268,19 +265,6 @@ log_write_checkpoint_info( mtr_buf_t* log_append_on_checkpoint( mtr_buf_t* buf); -#else /* !UNIV_HOTBACKUP */ -/******************************************************//** -Writes info to a buffer of a log group when log files are created in -backup restoration. */ -void -log_reset_first_header_and_checkpoint( -/*==================================*/ - byte* hdr_buf,/*!< in: buffer which will be written to the - start of the first log file */ - ib_uint64_t start); /*!< in: lsn of the start of the first log file; - we pretend that there is a checkpoint at - start + LOG_BLOCK_HDR_SIZE */ -#endif /* !UNIV_HOTBACKUP */ /** Checks that there is enough free space in the log to start a new query step. Flushes the log buffer or makes a new checkpoint if necessary. NOTE: this @@ -288,7 +272,7 @@ function may only be called if the calling thread owns no synchronization objects! */ void log_check_margins(void); -#ifndef UNIV_HOTBACKUP + /******************************************************//** Reads a specified log segment to a buffer. */ void @@ -316,7 +300,6 @@ lsn_t log_group_get_capacity( /*===================*/ const log_group_t* group); /*!< in: log group */ -#endif /* !UNIV_HOTBACKUP */ /************************************************************//** Gets a log block flush bit. @return TRUE if this block was the first to be written in a log flush */ @@ -422,17 +405,6 @@ log_block_init( /*===========*/ byte* log_block, /*!< in: pointer to the log buffer */ lsn_t lsn); /*!< in: lsn within the log block */ -#ifdef UNIV_HOTBACKUP -/************************************************************//** -Initializes a log block in the log buffer in the old, < 3.23.52 format, where -there was no checksum yet. */ -UNIV_INLINE -void -log_block_init_in_old_format( -/*=========================*/ - byte* log_block, /*!< in: pointer to the log buffer */ - lsn_t lsn); /*!< in: lsn within the log block */ -#endif /* UNIV_HOTBACKUP */ /************************************************************//** Converts a lsn to a log block number. @return log block number, it is > 0 and <= 1G */ @@ -648,7 +620,7 @@ struct log_t{ lsn_t lsn; /*!< log sequence number */ ulint buf_free; /*!< first free offset within the log buffer in use */ -#ifndef UNIV_HOTBACKUP + char pad2[CACHE_LINE_SIZE];/*!< Padding */ LogSysMutex mutex; /*!< mutex protecting the log */ char pad3[CACHE_LINE_SIZE]; /*!< Padding */ @@ -663,7 +635,6 @@ struct log_t{ 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, which should be of double of buf_size */ byte* buf; /*!< log buffer currently in use; @@ -692,7 +663,6 @@ struct log_t{ UT_LIST_BASE_NODE_T(log_group_t) log_groups; /*!< log groups */ -#ifndef UNIV_HOTBACKUP /** The fields involved in the log buffer flush @{ */ ulint buf_next_to_write;/*!< first offset in the log buffer @@ -776,7 +746,6 @@ struct log_t{ checkpoint write is running; a thread should wait for this without owning the log mutex */ -#endif /* !UNIV_HOTBACKUP */ byte* checkpoint_buf_ptr;/* unaligned checkpoint header */ byte* checkpoint_buf; /*!< checkpoint header is read to this buffer */ diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.ic index a53f8770cea..82a94265776 100644 --- a/storage/innobase/include/log0log.ic +++ b/storage/innobase/include/log0log.ic @@ -297,32 +297,6 @@ log_block_init( log_block_set_first_rec_group(log_block, 0); } -#ifdef UNIV_HOTBACKUP -/************************************************************//** -Initializes a log block in the log buffer in the old format, where there -was no checksum yet. */ -UNIV_INLINE -void -log_block_init_in_old_format( -/*=========================*/ - byte* log_block, /*!< in: pointer to the log buffer */ - lsn_t lsn) /*!< in: lsn within the log block */ -{ - ulint no; - - ut_ad(log_mutex_own()); - - no = log_block_convert_lsn_to_no(lsn); - - log_block_set_hdr_no(log_block, no); - mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE - - LOG_BLOCK_CHECKSUM, no); - log_block_set_data_len(log_block, LOG_BLOCK_HDR_SIZE); - log_block_set_first_rec_group(log_block, 0); -} -#endif /* UNIV_HOTBACKUP */ - -#ifndef UNIV_HOTBACKUP /** Append a string to the log. @param[in] str string @param[in] len string length @@ -529,4 +503,3 @@ log_free_check(void) log_check_margins(); } } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index bd7118654f3..a9d98b08d85 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -37,83 +37,16 @@ Created 9/20/1997 Heikki Tuuri #include <list> #include <vector> -#ifdef UNIV_HOTBACKUP -extern bool recv_replay_file_ops; +/** @return whether recovery is currently running. */ +#define recv_recovery_is_on() recv_recovery_on -/*******************************************************************//** -Reads the checkpoint info needed in hot backup. -@return TRUE if success */ -ibool -recv_read_checkpoint_info_for_backup( -/*=================================*/ - const byte* hdr, /*!< in: buffer containing the log group - header */ - lsn_t* lsn, /*!< out: checkpoint lsn */ - lsn_t* offset, /*!< out: checkpoint offset in the log group */ - lsn_t* cp_no, /*!< out: checkpoint number */ - lsn_t* first_header_lsn) - /*!< out: lsn of of the start of the - first log file */ - MY_ATTRIBUTE((nonnull)); -/*******************************************************************//** -Scans the log segment and n_bytes_scanned is set to the length of valid -log scanned. */ -void -recv_scan_log_seg_for_backup( -/*=========================*/ - byte* buf, /*!< in: buffer containing log data */ - ulint buf_len, /*!< in: data length in that buffer */ - lsn_t* scanned_lsn, /*!< in/out: lsn of buffer start, - we return scanned lsn */ - ulint* scanned_checkpoint_no, - /*!< in/out: 4 lowest bytes of the - highest scanned checkpoint number so - far */ - ulint* n_bytes_scanned);/*!< out: how much we were able to - scan, smaller than buf_len if log - data ended here */ -#endif /* UNIV_HOTBACKUP */ -/*******************************************************************//** -Returns TRUE if recovery is currently running. -@return recv_recovery_on */ -UNIV_INLINE -bool -recv_recovery_is_on(void); -/*=====================*/ -/************************************************************************//** -Applies the hashed log records to the page, if the page lsn is less than the -lsn of a log record. This can be called when a buffer page has just been -read in, or also for a page already in the buffer pool. */ +/** Apply the hashed log records to the page, if the page lsn is less than the +lsn of a log record. +@param just_read_in whether the page recently arrived to the I/O handler +@param block the page in the buffer pool */ void -recv_recover_page_func( -/*===================*/ -#ifndef UNIV_HOTBACKUP - ibool just_read_in, - /*!< in: TRUE if the i/o handler calls - this for a freshly read page */ -#endif /* !UNIV_HOTBACKUP */ - buf_block_t* block); /*!< in/out: buffer block */ -#ifndef UNIV_HOTBACKUP -/** Wrapper for recv_recover_page_func(). -Applies the hashed log records to the page, if the page lsn is less than the -lsn of a log record. This can be called when a buffer page has just been -read in, or also for a page already in the buffer pool. -@param jri in: TRUE if just read in (the i/o handler calls this for -a freshly read page) -@param block in/out: the buffer block -*/ -# define recv_recover_page(jri, block) recv_recover_page_func(jri, block) -#else /* !UNIV_HOTBACKUP */ -/** Wrapper for recv_recover_page_func(). -Applies the hashed log records to the page, if the page lsn is less than the -lsn of a log record. This can be called when a buffer page has just been -read in, or also for a page already in the buffer pool. -@param jri in: TRUE if just read in (the i/o handler calls this for -a freshly read page) -@param block in/out: the buffer block -*/ -# define recv_recover_page(jri, block) recv_recover_page_func(block) -#endif /* !UNIV_HOTBACKUP */ +recv_recover_page(bool just_read_in, buf_block_t* block); + /** Start recovering from a redo log checkpoint. @see recv_recovery_from_checkpoint_finish @param[in] flush_lsn FIL_PAGE_FILE_FLUSH_LSN @@ -140,18 +73,6 @@ recv_reset_logs( OS_FILE_LOG_BLOCK_SIZE, after which we add LOG_BLOCK_HDR_SIZE */ -#ifdef UNIV_HOTBACKUP -/******************************************************//** -Creates new log files after a backup has been restored. */ -void -recv_reset_log_files_for_backup( -/*============================*/ - const char* log_dir, /*!< in: log file directory path */ - ulint n_log_files, /*!< in: number of log files */ - lsn_t log_file_size, /*!< in: log file size */ - lsn_t lsn); /*!< in: new start lsn, must be - divisible by OS_FILE_LOG_BLOCK_SIZE */ -#endif /* UNIV_HOTBACKUP */ /********************************************************//** Creates the recovery system. */ void @@ -173,7 +94,6 @@ void recv_sys_init( /*==========*/ ulint available_memory); /*!< in: available memory in bytes */ -#ifndef UNIV_HOTBACKUP /********************************************************//** Frees the recovery system. */ void @@ -184,7 +104,6 @@ Reset the state of the recovery system variables. */ void recv_sys_var_init(void); /*===================*/ -#endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** Empties the hash table of stored log records, applying them to appropriate pages. */ @@ -200,14 +119,6 @@ recv_apply_hashed_log_recs( can be generated during the application */ __attribute__((warn_unused_result)); -#ifdef UNIV_HOTBACKUP -/*******************************************************************//** -Applies log records in the hash table to a backup. */ -void -recv_apply_log_recs_for_backup(void); -/*================================*/ -#endif /* UNIV_HOTBACKUP */ - /** Block of log record data */ struct recv_data_t{ recv_data_t* next; /*!< pointer to the next block or NULL */ @@ -291,7 +202,6 @@ typedef std::vector<recv_encryption_t, ut_allocator<recv_encryption_t> > /** Recovery system data structure */ struct recv_sys_t{ -#ifndef UNIV_HOTBACKUP ib_mutex_t mutex; /*!< mutex protecting the fields apply_log_recs, n_addrs, and the state field in each recv_addr struct */ @@ -305,7 +215,6 @@ struct recv_sys_t{ buf_flush_t flush_type;/*!< type of the flush request. BUF_FLUSH_LRU: flush end of LRU, keeping free blocks. BUF_FLUSH_LIST: flush all of blocks. */ -#endif /* !UNIV_HOTBACKUP */ ibool apply_log_recs; /*!< this is TRUE when log rec application to pages is allowed; this flag tells the @@ -391,15 +300,9 @@ extern bool recv_no_log_write; number (FIL_PAGE_LSN) is in the future. Initially FALSE, and set by recv_recovery_from_checkpoint_start(). */ extern bool recv_lsn_checks_on; -#ifdef UNIV_HOTBACKUP -/** TRUE when the redo log is being backed up */ -extern bool recv_is_making_a_backup; -#endif /* UNIV_HOTBACKUP */ -#ifndef UNIV_HOTBACKUP /** Flag indicating if recv_writer thread is active. */ extern volatile bool recv_writer_thread_active; -#endif /* !UNIV_HOTBACKUP */ /** Size of the parsing buffer; it must accommodate RECV_SCAN_SIZE many times! */ @@ -424,8 +327,4 @@ log_block_checksum_is_ok( const byte* block, /*!< in: pointer to a log block */ bool print_err); /*!< in print error ? */ -#ifndef UNIV_NONINL -#include "log0recv.ic" -#endif - #endif diff --git a/storage/innobase/include/log0recv.ic b/storage/innobase/include/log0recv.ic deleted file mode 100644 index d197e5e3337..00000000000 --- a/storage/innobase/include/log0recv.ic +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA - -*****************************************************************************/ - -/**************************************************//** -@file include/log0recv.ic -Recovery - -Created 9/20/1997 Heikki Tuuri -*******************************************************/ - -#include "univ.i" - -/*******************************************************************//** -Returns TRUE if recovery is currently running. -@return recv_recovery_on */ -UNIV_INLINE -bool -recv_recovery_is_on() -/*=================*/ -{ - return(recv_recovery_on); -} - diff --git a/storage/innobase/include/mach0data.h b/storage/innobase/include/mach0data.h index 4d32e2e7170..de05de55d77 100644 --- a/storage/innobase/include/mach0data.h +++ b/storage/innobase/include/mach0data.h @@ -271,7 +271,7 @@ ib_uint64_t mach_u64_parse_compressed( const byte** ptr, const byte* end_ptr); -#ifndef UNIV_HOTBACKUP + /*********************************************************//** Reads a double. It is stored in a little-endian format. @return double read */ @@ -388,7 +388,6 @@ mach_read_ulint( mlog_id_t type) MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_INNOCHECKSUM */ #ifndef UNIV_NONINL diff --git a/storage/innobase/include/mach0data.ic b/storage/innobase/include/mach0data.ic index 20018844e4b..31520c47825 100644 --- a/storage/innobase/include/mach0data.ic +++ b/storage/innobase/include/mach0data.ic @@ -609,7 +609,7 @@ mach_u64_parse_compressed( return(val); } -#ifndef UNIV_HOTBACKUP + /*********************************************************//** Reads a double. It is stored in a little-endian format. @return double read */ @@ -947,5 +947,4 @@ mach_read_ulint( return(0); } -#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index f8fdb53e132..991d1179098 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -390,7 +390,7 @@ struct mem_block_info_t { user data in the block */ ulint start; /*!< the value of the struct field 'free' at the creation of the block */ -#ifndef UNIV_HOTBACKUP + void* free_block; /* if the MEM_HEAP_BTR_SEARCH bit is set in type, and this is the heap root, this can contain an @@ -401,7 +401,6 @@ struct mem_block_info_t { /* if this block has been allocated from the buffer pool, this contains the buf_block_t handle; otherwise, this is NULL */ -#endif /* !UNIV_HOTBACKUP */ }; #define MEM_BLOCK_MAGIC_N 764741555 diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index 3b4109ee52d..82c90584e6f 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -61,14 +61,12 @@ mem_heap_block_free( mem_heap_t* heap, /*!< in: heap */ mem_block_t* block); /*!< in: block to free */ -#ifndef UNIV_HOTBACKUP /******************************************************************//** Frees the free_block field from a memory heap. */ void mem_heap_free_block_free( /*=====================*/ mem_heap_t* heap); /*!< in: heap */ -#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** Adds a new block to a memory heap. @@ -302,11 +300,10 @@ mem_heap_empty( mem_heap_t* heap) { mem_heap_free_heap_top(heap, (byte*) heap + mem_block_get_start(heap)); -#ifndef UNIV_HOTBACKUP + if (heap->free_block) { mem_heap_free_block_free(heap); } -#endif /* !UNIV_HOTBACKUP */ } /** Returns a pointer to the topmost element in a memory heap. @@ -524,11 +521,9 @@ mem_heap_free( block = UT_LIST_GET_LAST(heap->base); -#ifndef UNIV_HOTBACKUP if (heap->free_block) { mem_heap_free_block_free(heap); } -#endif /* !UNIV_HOTBACKUP */ while (block != NULL) { /* Store the contents of info before freeing current block @@ -556,11 +551,9 @@ mem_heap_get_size( size = heap->total_size; -#ifndef UNIV_HOTBACKUP if (heap->free_block) { size += UNIV_PAGE_SIZE; } -#endif /* !UNIV_HOTBACKUP */ return(size); } diff --git a/storage/innobase/include/mtr0log.h b/storage/innobase/include/mtr0log.h index 3819d3f694a..b5c94ff7d46 100644 --- a/storage/innobase/include/mtr0log.h +++ b/storage/innobase/include/mtr0log.h @@ -33,7 +33,6 @@ Created 12/7/1995 Heikki Tuuri // Forward declaration struct dict_index_t; -#ifndef UNIV_HOTBACKUP /********************************************************//** Writes 1, 2 or 4 bytes to a file page. Writes the corresponding log record to the mini-transaction log if mtr is not NULL. */ @@ -178,10 +177,6 @@ mlog_write_initial_log_record_fast( byte* log_ptr,/*!< in: pointer to mtr log which has been opened */ mtr_t* mtr); /*!< in: mtr */ -#else /* !UNIV_HOTBACKUP */ -# define mlog_write_initial_log_record(ptr,type,mtr) ((void) 0) -# define mlog_write_initial_log_record_fast(ptr,type,log_ptr,mtr) ((byte*) 0) -#endif /* !UNIV_HOTBACKUP */ /********************************************************//** Parses an initial log record written by mlog_write_initial_log_record. @return parsed record end, NULL if not a complete record */ @@ -216,7 +211,6 @@ mlog_parse_string( byte* page, /*!< in: page where to apply the log record, or NULL */ void* page_zip);/*!< in/out: compressed page, or NULL */ -#ifndef UNIV_HOTBACKUP /********************************************************//** Opens a buffer for mlog, writes the initial log record and, if needed, the field lengths of an index. Reserves space @@ -233,7 +227,6 @@ mlog_open_and_write_index( ulint size); /*!< in: requested buffer size in bytes (if 0, calls mlog_close() and returns NULL) */ -#endif /* !UNIV_HOTBACKUP */ /********************************************************//** Parses a log record written by mlog_open_and_write_index. @@ -246,11 +239,9 @@ mlog_parse_index( ibool comp, /*!< in: TRUE=compact record format */ dict_index_t** index); /*!< out, own: dummy index */ -#ifndef UNIV_HOTBACKUP /** Insert, update, and maybe other functions may use this value to define an extra mlog buffer size for variable size data */ #define MLOG_BUF_MARGIN 256 -#endif /* !UNIV_HOTBACKUP */ #ifndef UNIV_NONINL #include "mtr0log.ic" diff --git a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic index 4015fe36d19..701f1482e64 100644 --- a/storage/innobase/include/mtr0log.ic +++ b/storage/innobase/include/mtr0log.ic @@ -65,7 +65,6 @@ mlog_close( mtr->get_log()->close(ptr); } -#ifndef UNIV_HOTBACKUP /********************************************************//** Catenates 1 - 4 bytes to the mtr log. The value is not compressed. */ UNIV_INLINE @@ -247,4 +246,3 @@ mlog_write_initial_log_record_fast( return(mlog_write_initial_log_record_low(type, space, offset, log_ptr, mtr)); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 5e36cfc2ac0..f65d5f8dc1b 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -918,7 +918,6 @@ struct os_file_stat_t { if type == OS_FILE_TYPE_FILE */ }; -#ifndef UNIV_HOTBACKUP /** Create a temporary file. This function is like tmpfile(3), but the temporary file is created in the given parameter path. If the path is null then it will create the file in the mysql server configuration @@ -928,7 +927,6 @@ parameter (--tmpdir). FILE* os_file_create_tmpfile( const char* path); -#endif /* !UNIV_HOTBACKUP */ /** The os_file_opendir() function opens a directory stream corresponding to the directory named by the dirname argument. The directory stream is positioned @@ -1569,14 +1567,6 @@ to original un-instrumented file I/O APIs */ #endif /* UNIV_PFS_IO */ -#ifdef UNIV_HOTBACKUP -/** Closes a file handle. -@param[in] file handle to a file -@return true if success */ -bool -os_file_close_no_error_handling(os_file_t file); -#endif /* UNIV_HOTBACKUP */ - /** Gets a file size. @param[in] file handle to a file @return file size if OK, else set m_total_size to ~0 and m_alloc_size @@ -1914,7 +1904,6 @@ os_file_get_status( bool check_rw_perm, bool read_only); -#if !defined(UNIV_HOTBACKUP) /** Creates a temporary file in the location specified by the parameter path. If the path is NULL then it will be created on --tmpdir location. This function is defined in ha_innodb.cc. @@ -1923,8 +1912,6 @@ This function is defined in ha_innodb.cc. int innobase_mysql_tmpfile( const char* path); -#endif /* !UNIV_HOTBACKUP */ - /** If it is a compressed page return the compressed page data + footer size @param[in] buf Buffer to check, must include header + 10 bytes diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index 94b5896d3ad..2bb922cc829 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -135,7 +135,7 @@ void page_cur_move_to_prev( /*==================*/ page_cur_t* cur); /*!< in/out: cursor; not before first */ -#ifndef UNIV_HOTBACKUP + /***********************************************************//** Inserts a record next to page cursor. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at @@ -163,7 +163,6 @@ page_cur_tuple_insert( /*!< in: if true, then use record cache to hold the tuple converted record. */ MY_ATTRIBUTE((nonnull(1,2,3,4,5), warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Inserts a record next to page cursor. Returns pointer to inserted record if succeed, i.e., enough space available, NULL otherwise. The cursor stays at @@ -248,7 +247,7 @@ page_cur_delete_rec( const ulint* offsets,/*!< in: rec_get_offsets( cursor->rec, index) */ mtr_t* mtr); /*!< in: mini-transaction handle */ -#ifndef UNIV_HOTBACKUP + /** Search the right position for a page cursor. @param[in] block buffer block @param[in] index index tree @@ -331,7 +330,6 @@ page_cur_open_on_rnd_user_rec( /*==========================*/ buf_block_t* block, /*!< in: page */ page_cur_t* cursor);/*!< out: page cursor */ -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a log record of a record insert on a page. @return end of log record or NULL */ diff --git a/storage/innobase/include/page0cur.ic b/storage/innobase/include/page0cur.ic index bfd9da47803..5eb1bc0cbc5 100644 --- a/storage/innobase/include/page0cur.ic +++ b/storage/innobase/include/page0cur.ic @@ -197,7 +197,6 @@ page_cur_move_to_prev( cur->rec = page_rec_get_prev(cur->rec); } -#ifndef UNIV_HOTBACKUP /** Search the right position for a page cursor. @param[in] block buffer block @param[in] index index tree @@ -294,7 +293,6 @@ page_cur_tuple_insert( ut_ad(!rec || !cmp_dtuple_rec(tuple, rec, *offsets)); return(rec); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Inserts a record next to page cursor. Returns pointer to inserted record if diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index b64602fe077..e61e7d2ae16 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -309,7 +309,7 @@ page_header_set_ptr( uncompressed part will be updated, or NULL */ ulint field, /*!< in/out: PAGE_FREE, ... */ const byte* ptr); /*!< in: pointer or NULL*/ -#ifndef UNIV_HOTBACKUP + /*************************************************************//** Resets the last insert info field in the page header. Writes to mlog about this operation. */ @@ -321,7 +321,6 @@ page_header_reset_last_insert( page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed part will be updated, or NULL */ mtr_t* mtr); /*!< in: mtr */ -#endif /* !UNIV_HOTBACKUP */ /************************************************************//** Gets the offset of the first record on the page. @return offset of the first record in record list, relative from page */ @@ -362,7 +361,7 @@ page_rec_get_nth( page_t* page, /*< in: page */ ulint nth) /*!< in: nth record */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#ifndef UNIV_HOTBACKUP + /************************************************************//** Returns the middle record of the records on the page. If there is an even number of records in the list, returns the first record of the @@ -374,7 +373,6 @@ page_get_middle_rec( /*================*/ page_t* page) /*!< in: page */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /*************************************************************//** Gets the page number. @return page number */ @@ -756,7 +754,7 @@ rec_t* page_rec_find_owner_rec( /*====================*/ rec_t* rec); /*!< in: the physical record */ -#ifndef UNIV_HOTBACKUP + /***********************************************************************//** Write a 32-bit field in a data dictionary record. */ UNIV_INLINE @@ -768,7 +766,6 @@ page_rec_write_field( ulint val, /*!< in: value to write */ mtr_t* mtr) /*!< in/out: mini-transaction */ MY_ATTRIBUTE((nonnull)); -#endif /* !UNIV_HOTBACKUP */ /************************************************************//** Returns the maximum combined size of records which can be inserted on top of record heap. @@ -1069,7 +1066,7 @@ page_parse_create( buf_block_t* block, ulint comp, bool is_rtree); -#ifndef UNIV_HOTBACKUP + /************************************************************//** Prints record contents including the data relevant only in the index page context. */ @@ -1115,7 +1112,6 @@ page_print( ulint rn); /*!< in: print rn first and last records in directory */ # endif /* UNIV_BTR_PRINT */ -#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** The following is used to validate a record on a page. This function differs from rec_validate as it can also check the n_owned field and diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index a3bbc09e60f..97f9d5a578f 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -32,9 +32,7 @@ Created 2/2/1994 Heikki Tuuri #ifdef UNIV_DEBUG # include "log0recv.h" #endif /* !UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP -# include "rem0cmp.h" -#endif /* !UNIV_HOTBACKUP */ +#include "rem0cmp.h" #include "mtr0log.h" #include "page0zip.h" @@ -148,20 +146,17 @@ page_set_ssn_id( mtr_t* mtr) /*!< in/out: mini-transaction */ { page_t* page = buf_block_get_frame(block); -#ifndef UNIV_HOTBACKUP + ut_ad(!mtr || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_SX_FIX) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); -#endif /* !UNIV_HOTBACKUP */ if (page_zip) { mach_write_to_8(page + FIL_RTREE_SPLIT_SEQ_NUM, ssn_id); page_zip_write_header(page_zip, page + FIL_RTREE_SPLIT_SEQ_NUM, 8, mtr); -#ifndef UNIV_HOTBACKUP } else if (mtr) { mlog_write_ull(page + FIL_RTREE_SPLIT_SEQ_NUM, ssn_id, mtr); -#endif /* !UNIV_HOTBACKUP */ } else { mach_write_to_8(page + FIL_RTREE_SPLIT_SEQ_NUM, ssn_id); } @@ -264,7 +259,6 @@ page_header_set_ptr( page_header_set_field(page, page_zip, field, offs); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Resets the last insert info field in the page header. Writes to mlog about this operation. */ @@ -290,7 +284,6 @@ page_header_reset_last_insert( MLOG_2BYTES, mtr); } } -#endif /* !UNIV_HOTBACKUP */ /************************************************************//** Determine whether the page is in new-style compact format. @@ -618,7 +611,6 @@ page_rec_get_nth( return((rec_t*) page_rec_get_nth_const(page, nth)); } -#ifndef UNIV_HOTBACKUP /************************************************************//** Returns the middle record of the records on the page. If there is an even number of records in the list, returns the first record of the @@ -634,7 +626,6 @@ page_get_middle_rec( return(page_rec_get_nth(page, middle)); } -#endif /* !UNIV_HOTBACKUP */ /*************************************************************//** Gets the page number. @@ -1141,7 +1132,6 @@ page_get_free_space_of_empty( - 2 * PAGE_DIR_SLOT_SIZE)); } -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Write a 32-bit field in a data dictionary record. */ UNIV_INLINE @@ -1162,7 +1152,6 @@ page_rec_write_field( mlog_write_ulint(data, val, MLOG_4BYTES, mtr); } -#endif /* !UNIV_HOTBACKUP */ /************************************************************//** Each user record on a page, and also the deleted user records in the heap diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 7b5df3d306b..4a32595af66 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -97,7 +97,6 @@ page_zip_set_size( page_zip_des_t* page_zip, /*!< in/out: compressed page */ ulint size); /*!< in: size in bytes */ -#ifndef UNIV_HOTBACKUP /** Determine if a record is so big that it needs to be stored externally. @param[in] rec_size length of the record in bytes @param[in] comp nonzero=compact format @@ -132,7 +131,6 @@ bool page_zip_is_too_big( const dict_index_t* index, const dtuple_t* entry); -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Initialize a compressed page descriptor. */ @@ -459,7 +457,7 @@ page_zip_reorganize( dict_index_t* index, /*!< in: index of the B-tree node */ mtr_t* mtr) /*!< in: mini-transaction */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP + /**********************************************************************//** Copy the records of a page byte for byte. Do not copy the page header or trailer, except those B-tree header fields that are directly @@ -476,7 +474,6 @@ page_zip_copy_recs( const page_t* src, /*!< in: page */ dict_index_t* index, /*!< in: index of the B-tree */ mtr_t* mtr); /*!< in: mini-transaction */ -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Parses a log record of compressing an index page. diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic index 9963fe01c82..9cc54dc42fa 100644 --- a/storage/innobase/include/page0zip.ic +++ b/storage/innobase/include/page0zip.ic @@ -148,7 +148,6 @@ page_zip_set_size( ut_ad(page_zip_get_size(page_zip) == size); } -#ifndef UNIV_HOTBACKUP /** Determine if a record is so big that it needs to be stored externally. @param[in] rec_size length of the record in bytes @param[in] comp nonzero=compact format @@ -188,7 +187,6 @@ page_zip_rec_needs_ext( return(rec_size >= page_get_free_space_of_empty(comp) / 2); } -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /**********************************************************************//** @@ -364,9 +362,7 @@ page_zip_write_header( /* ut_ad(page_zip_validate(page_zip, str - pos)); */ if (mtr) { -#ifndef UNIV_HOTBACKUP page_zip_write_header_log(str, length, mtr); -#endif /* !UNIV_HOTBACKUP */ } } diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 8490e7c9c88..ed700139b53 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -773,7 +773,6 @@ rec_copy( const rec_t* rec, const ulint* offsets); -#ifndef UNIV_HOTBACKUP /**********************************************************//** Determines the size of a data tuple prefix in a temporary file. @return total size */ @@ -846,7 +845,6 @@ rec_fold( ulint n_bytes, index_id_t tree_id) MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /*********************************************************//** Builds a physical record out of a data tuple and stores it into the given buffer. @@ -911,7 +909,6 @@ rec_get_converted_size( const dtuple_t* dtuple, /*!< in: data tuple */ ulint n_ext) /*!< in: number of externally stored columns */ MY_ATTRIBUTE((warn_unused_result, nonnull)); -#ifndef UNIV_HOTBACKUP /**************************************************************//** Copies the first n fields of a physical record to a data tuple. The fields are copied to the memory heap. */ @@ -925,7 +922,6 @@ rec_copy_prefix_to_dtuple( to copy */ mem_heap_t* heap) /*!< in: memory heap */ MY_ATTRIBUTE((nonnull)); -#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** Validates the consistency of a physical record. @return TRUE if ok */ @@ -943,7 +939,6 @@ rec_print_old( FILE* file, /*!< in: file where to print */ const rec_t* rec) /*!< in: physical record */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP /***************************************************************//** Prints a physical record in ROW_FORMAT=COMPACT. Ignores the record header. */ @@ -1104,7 +1099,6 @@ rec_get_trx_id( const dict_index_t* index) /*!< in: clustered index */ MY_ATTRIBUTE((nonnull, warn_unused_result)); # endif /* UNIV_DEBUG */ -#endif /* UNIV_HOTBACKUP */ /* Maximum lengths for the data in a physical record if the offsets are given in one byte (resp. two byte) format. */ diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index b855a39da9e..e16eab62181 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -1696,7 +1696,6 @@ rec_get_converted_size( return(data_size + extra_size); } -#ifndef UNIV_HOTBACKUP /** Fold a prefix of a physical record. @param[in] rec index record @param[in] offsets return value of rec_get_offsets() @@ -1761,4 +1760,3 @@ rec_fold( return(fold); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h index 3c1033fe419..86b282553d8 100644 --- a/storage/innobase/include/row0upd.h +++ b/storage/innobase/include/row0upd.h @@ -33,12 +33,9 @@ Created 12/27/1996 Heikki Tuuri #include "dict0types.h" #include "trx0types.h" #include <stack> - -#ifndef UNIV_HOTBACKUP -# include "btr0pcur.h" -# include "que0types.h" -# include "pars0types.h" -#endif /* !UNIV_HOTBACKUP */ +#include "btr0pcur.h" +#include "que0types.h" +#include "pars0types.h" /** The std::deque to store cascade update nodes, that uses mem_heap_t as allocator. */ @@ -80,7 +77,7 @@ upd_get_nth_field( #else # define upd_get_nth_field(update, n) ((update)->fields + (n)) #endif -#ifndef UNIV_HOTBACKUP + /*********************************************************************//** Sets an index field number to be updated by an update vector field. */ UNIV_INLINE @@ -191,7 +188,6 @@ row_upd_changes_disowned_external( /*==============================*/ const upd_t* update) /*!< in: update vector */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Replaces the new column values stored in the update vector to the record given. No field size changes are allowed. This function is @@ -207,7 +203,7 @@ row_upd_rec_in_place( const upd_t* update, /*!< in: update vector */ page_zip_des_t* page_zip);/*!< in: compressed page with enough space available, or NULL */ -#ifndef UNIV_HOTBACKUP + /***************************************************************//** Builds an update vector from those fields which in a secondary index entry differ from a record that has the equal ordering fields. NOTE: we compare @@ -403,7 +399,6 @@ que_thr_t* row_upd_step( /*=========*/ que_thr_t* thr); /*!< in: query thread */ -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Parses the log data of system field values. @return log data end or NULL */ @@ -449,7 +444,6 @@ struct upd_field_t{ index. If this field is a virtual column, then field_no represents the nth virtual column in the table */ -#ifndef UNIV_HOTBACKUP unsigned orig_len:16; /*!< original length of the locally stored part of an externally stored column, or 0 */ @@ -457,7 +451,6 @@ struct upd_field_t{ value: it refers to column values and constants in the symbol table of the query graph */ -#endif /* !UNIV_HOTBACKUP */ dfield_t new_val; /*!< new value for the column */ dfield_t* old_v_val; /*!< old value for the virtual column */ }; @@ -516,7 +509,6 @@ struct upd_t{ }; -#ifndef UNIV_HOTBACKUP /* Update node structure which also implements the delete operation of a row */ @@ -659,7 +651,6 @@ struct upd_node_t{ #define UPD_NODE_NO_SIZE_CHANGE 2 /* no record field size will be changed in the update */ -#endif /* !UNIV_HOTBACKUP */ #ifndef UNIV_NONINL #include "row0upd.ic" diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic index ab1dc5c7076..8b794e47a07 100644 --- a/storage/innobase/include/row0upd.ic +++ b/storage/innobase/include/row0upd.ic @@ -24,12 +24,10 @@ Created 12/27/1996 Heikki Tuuri *******************************************************/ #include "mtr0log.h" -#ifndef UNIV_HOTBACKUP -# include "trx0trx.h" -# include "trx0undo.h" -# include "row0row.h" -# include "lock0lock.h" -#endif /* !UNIV_HOTBACKUP */ +#include "trx0trx.h" +#include "trx0undo.h" +#include "row0row.h" +#include "lock0lock.h" #include "page0zip.h" /*********************************************************************//** @@ -87,7 +85,6 @@ upd_get_nth_field( } #endif /* UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Sets an index field number to be updated by an update vector field. */ UNIV_INLINE @@ -220,4 +217,3 @@ row_upd_rec_sys_fields( trx_write_roll_ptr(rec + offset + DATA_TRX_ID_LEN, roll_ptr); } } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index d5a305bdf68..e4e1394c2d3 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -38,9 +38,6 @@ Created 12/15/2009 Jimmy Yang #include <stdint.h> -#ifndef UNIV_HOTBACKUP - - /** Possible status values for "mon_status" in "struct monitor_value" */ enum monitor_running_status { MONITOR_STARTED = 1, /*!< Monitor has been turned on */ @@ -899,9 +896,5 @@ srv_mon_default_on(void); #ifndef UNIV_NONINL #include "srv0mon.ic" #endif -#else /* !UNIV_HOTBACKUP */ -# define MONITOR_INC(x) ((void) 0) -# define MONITOR_DEC(x) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ #endif diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 748a21fdcd2..92572a0f8b3 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -48,7 +48,6 @@ Created 10/10/1995 Heikki Tuuri #include "mysql/psi/psi.h" #include "univ.i" -#ifndef UNIV_HOTBACKUP #include "log0log.h" #include "os0event.h" #include "que0types.h" @@ -309,8 +308,6 @@ extern long srv_mtflush_threads; /* If this flag is TRUE, then we will use multi threaded flush. */ extern my_bool srv_use_mtflush; -#endif /* !UNIV_HOTBACKUP */ - /** Server undo tablespaces directory, can be absolute path. */ extern char* srv_undo_dir; @@ -349,7 +346,6 @@ extern const ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES; extern char* srv_log_group_home_dir; -#ifndef UNIV_HOTBACKUP /** Maximum number of srv_n_log_files, or innodb_log_files_in_group */ #define SRV_N_LOG_FILES_MAX 100 extern ulong srv_n_log_files; @@ -660,8 +656,6 @@ extern PSI_stage_info srv_stage_alter_table_read_pk_internal_sort; extern PSI_stage_info srv_stage_buffer_pool_load; #endif /* HAVE_PSI_STAGE_INTERFACE */ -#endif /* !UNIV_HOTBACKUP */ - #ifndef _WIN32 /** Alternatives for the file flush option in Unix; see the InnoDB manual about what these mean */ @@ -738,7 +732,6 @@ typedef enum srv_stats_method_name_enum srv_stats_method_name_t; extern ulong srv_debug_compress; #endif /* UNIV_DEBUG */ -#ifndef UNIV_HOTBACKUP /** Types of threads existing in the system. */ enum srv_thread_type { SRV_NONE, /*!< None */ @@ -1152,20 +1145,6 @@ struct srv_slot_t{ (only used for user threads) */ }; -#else /* !UNIV_HOTBACKUP */ -# define srv_use_adaptive_hash_indexes FALSE -# define srv_use_native_aio FALSE -# define srv_numa_interleave FALSE -# define srv_force_recovery 0UL -# define srv_set_io_thread_op_info(t,info) ((void) 0) -# define srv_reset_io_thread_op_info() ((void) 0) -# define srv_is_being_started 0 -# define srv_win_file_flush_method SRV_WIN_IO_UNBUFFERED -# define srv_unix_file_flush_method SRV_UNIX_O_DSYNC -# define srv_start_raw_disk_in_use 0 -# define srv_file_per_table 1 -#endif /* !UNIV_HOTBACKUP */ - #ifdef WITH_WSREP UNIV_INTERN void diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h index 3b7b2375788..fb41ae50d2a 100644 --- a/storage/innobase/include/srv0start.h +++ b/storage/innobase/include/srv0start.h @@ -71,7 +71,7 @@ char* srv_add_path_separator_if_needed( /*=============================*/ char* str); /*!< in: null-terminated character string */ -#ifndef UNIV_HOTBACKUP + /****************************************************************//** Starts Innobase and creates a new database if database files are not found and the user wants. @@ -156,7 +156,6 @@ extern bool srv_startup_is_before_trx_rollback_phase; /** TRUE if a raw partition is in use */ extern ibool srv_start_raw_disk_in_use; - /** Shutdown state */ enum srv_shutdown_t { SRV_SHUTDOWN_NONE = 0, /*!< Database running normally */ @@ -176,6 +175,4 @@ enum srv_shutdown_t { /** At a shutdown this value climbs from SRV_SHUTDOWN_NONE to SRV_SHUTDOWN_CLEANUP and then to SRV_SHUTDOWN_LAST_PHASE, and so on */ extern enum srv_shutdown_t srv_shutdown_state; -#endif /* !UNIV_HOTBACKUP */ - #endif diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h index 396156e9518..9a9da2d145a 100644 --- a/storage/innobase/include/sync0rw.h +++ b/storage/innobase/include/sync0rw.h @@ -34,7 +34,6 @@ Created 9/11/1995 Heikki Tuuri #define sync0rw_h #include "univ.i" -#ifndef UNIV_HOTBACKUP #include "ut0counter.h" #include "os0event.h" #include "ut0mutex.h" @@ -42,8 +41,6 @@ Created 9/11/1995 Heikki Tuuri /** Enable semaphore request instrumentation */ extern my_bool srv_instrument_semaphores; -#endif /* !UNIV_HOTBACKUP */ - /** Counters for RW locks. */ struct rw_lock_stats_t { typedef ib_counter_t<int64_t, IB_N_SLOTS> int64_counter_t; @@ -96,7 +93,6 @@ enum rw_lock_type_t { RW_NO_LATCH = 8 }; -#ifndef UNIV_HOTBACKUP /* We decrement lock_word by X_LOCK_DECR for each x_lock. It is also the start value for the lock_word, meaning that it limits the maximum number of concurrent read locks before the rw_lock breaks. */ @@ -897,11 +893,8 @@ pfs_rw_lock_free_func( rw_lock_t* lock); /*!< in: rw-lock */ #endif /* UNIV_PFS_RWLOCK */ - #ifndef UNIV_NONINL #include "sync0rw.ic" #endif /* !UNIV_NONINL */ -#endif /* !UNIV_HOTBACKUP */ - #endif /* sync0rw.h */ diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h index b7a2deac63e..90f4604043b 100644 --- a/storage/innobase/include/trx0rec.h +++ b/storage/innobase/include/trx0rec.h @@ -35,9 +35,7 @@ Created 3/26/1996 Heikki Tuuri #include "rem0types.h" #include "page0types.h" #include "row0log.h" - -#ifndef UNIV_HOTBACKUP -# include "que0types.h" +#include "que0types.h" /***********************************************************************//** Copies the undo record to the heap. @@ -276,7 +274,6 @@ trx_undo_prev_version_build( into this function by purge thread or not. And if we read "after image" of undo log */ -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of adding an undo log record. @return end of log record or NULL */ @@ -344,8 +341,6 @@ trx_undo_read_v_idx( bool* is_undo_log, ulint* field_no); -#ifndef UNIV_HOTBACKUP - /* Types of an undo log record: these have to be smaller than 16, as the compilation info multiplied by 16 is ORed to this value in an undo log record */ @@ -373,6 +368,4 @@ record */ #include "trx0rec.ic" #endif -#endif /* !UNIV_HOTBACKUP */ - #endif /* trx0rec_h */ diff --git a/storage/innobase/include/trx0rec.ic b/storage/innobase/include/trx0rec.ic index 111c05c60aa..c2c756484b2 100644 --- a/storage/innobase/include/trx0rec.ic +++ b/storage/innobase/include/trx0rec.ic @@ -23,7 +23,6 @@ Transaction undo log record Created 3/26/1996 Heikki Tuuri *******************************************************/ -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Reads from an undo log record the record type. @return record type */ @@ -98,4 +97,3 @@ trx_undo_rec_copy( ut_ad(len < UNIV_PAGE_SIZE); return((trx_undo_rec_t*) mem_heap_dup(heap, undo_rec, len)); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index ddf535158b6..ae46d2abae9 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -31,7 +31,6 @@ Created 3/26/1996 Heikki Tuuri #include "buf0buf.h" #include "fil0fil.h" #include "trx0types.h" -#ifndef UNIV_HOTBACKUP #include "mem0mem.h" #include "mtr0mtr.h" #include "ut0byte.h" @@ -367,40 +366,6 @@ Check if there are any active (non-prepared) transactions. ulint trx_sys_any_active_transactions(void); /*=================================*/ -#else /* !UNIV_HOTBACKUP */ -/*****************************************************************//** -Prints to stderr the MySQL binlog info in the system header if the -magic number shows it valid. */ -void -trx_sys_print_mysql_binlog_offset_from_page( -/*========================================*/ - const byte* page); /*!< in: buffer containing the trx - system header page, i.e., page number - TRX_SYS_PAGE_NO in the tablespace */ -/*****************************************************************//** -Reads the file format id from the first system table space file. -Even if the call succeeds and returns TRUE, the returned format id -may be ULINT_UNDEFINED signalling that the format id was not present -in the data file. -@return TRUE if call succeeds */ -ibool -trx_sys_read_file_format_id( -/*========================*/ - const char *pathname, /*!< in: pathname of the first system - table space file */ - ulint *format_id); /*!< out: file format of the system table - space */ -/*****************************************************************//** -Reads the file format id from the given per-table data file. -@return TRUE if call succeeds */ -ibool -trx_sys_read_pertable_file_format_id( -/*=================================*/ - const char *pathname, /*!< in: pathname of a per-table - datafile */ - ulint *format_id); /*!< out: file format of the per-table - data file */ -#endif /* !UNIV_HOTBACKUP */ /*****************************************************************//** Get the name representation of the file format from its id. @return pointer to the max format name */ @@ -590,7 +555,6 @@ identifier is added to this 64-bit constant. */ | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW) /* @} */ -#ifndef UNIV_HOTBACKUP /** The transaction system central memory data structure. */ struct trx_sys_t { @@ -683,7 +647,6 @@ struct trx_sys_t { two) is assigned, the field TRX_SYS_TRX_ID_STORE on the transaction system page is updated */ #define TRX_SYS_TRX_ID_WRITE_MARGIN ((trx_id_t) 256) -#endif /* !UNIV_HOTBACKUP */ /** Test if trx_sys->mutex is owned. */ #define trx_sys_mutex_own() (trx_sys->mutex.is_owned()) diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic index 6158aea0c48..b07f487984c 100644 --- a/storage/innobase/include/trx0sys.ic +++ b/storage/innobase/include/trx0sys.ic @@ -25,9 +25,8 @@ Created 3/26/1996 Heikki Tuuri #include "trx0trx.h" #include "data0type.h" -#ifndef UNIV_HOTBACKUP -# include "srv0srv.h" -# include "mtr0log.h" +#include "srv0srv.h" +#include "mtr0log.h" /* The typedef for rseg slot in the file copy */ typedef byte trx_sysf_rseg_t; @@ -198,7 +197,6 @@ trx_sysf_rseg_set_page_no( page_no, MLOG_4BYTES, mtr); } -#endif /* !UNIV_HOTBACKUP */ /*****************************************************************//** Writes a trx id to an index page. In case that the id size changes in @@ -230,7 +228,6 @@ trx_sys_is_noredo_rseg_slot( return(slot_id > 0 && slot_id < (srv_tmp_undo_logs + 1)); } -#ifndef UNIV_HOTBACKUP /*****************************************************************//** 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 @@ -503,5 +500,3 @@ trx_sys_rw_trx_add(trx_t* trx) trx_sys->rw_trx_set.insert(TrxTrack(trx->id, trx)); ut_d(trx->in_rw_trx_list = true); } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 19b0747c6a3..2159fc76548 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -36,7 +36,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0types.h" #include "ut0new.h" -#ifndef UNIV_HOTBACKUP #include "lock0types.h" #include "log0log.h" #include "usr0types.h" @@ -421,7 +420,6 @@ trx_set_dict_operation( enum trx_dict_op_t op); /*!< in: operation, not TRX_DICT_OP_NONE */ -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Determines if a transaction is in the given state. The caller must hold trx_sys->mutex, or it must be the thread @@ -468,9 +466,6 @@ ibool trx_is_strict( /*==========*/ trx_t* trx); /*!< in: transaction */ -#else /* !UNIV_HOTBACKUP */ -#define trx_is_interrupted(trx) FALSE -#endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** Calculates the "weight" of a transaction. The weight of one transaction @@ -1613,6 +1608,5 @@ private: #ifndef UNIV_NONINL #include "trx0trx.ic" #endif -#endif /* !UNIV_HOTBACKUP */ #endif diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 60fbb9d2304..1acb5b7c1ad 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -34,7 +34,6 @@ Created 3/26/1996 Heikki Tuuri #include "page0types.h" #include "trx0xa.h" -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Builds a roll pointer. @return roll pointer */ @@ -75,7 +74,6 @@ trx_undo_trx_id_is_insert( /*======================*/ const byte* trx_id) /*!< in: DB_TRX_ID, followed by DB_ROLL_PTR */ MY_ATTRIBUTE((warn_unused_result)); -#endif /* !UNIV_HOTBACKUP */ /*****************************************************************//** Writes a roll ptr to an index page. In case that the size changes in some future version, this function should be used instead of @@ -97,7 +95,6 @@ roll_ptr_t trx_read_roll_ptr( /*==============*/ const byte* ptr); /*!< in: pointer to memory from where to read */ -#ifndef UNIV_HOTBACKUP /** Gets an undo log page and x-latches it. @param[in] page_id page id @@ -366,7 +363,6 @@ bool trx_undo_truncate_tablespace( undo::Truncate* undo_trunc); -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses the redo log entry of an undo log page initialization. @return end of log record or NULL */ @@ -427,7 +423,7 @@ trx_undo_mem_free( #define TRX_UNDO_PREPARED 5 /* contains an undo log of an prepared transaction */ -#if !defined UNIV_HOTBACKUP && !defined UNIV_INNOCHECKSUM +#ifndef UNIV_INNOCHECKSUM /** Transaction undo log memory object; this is protected by the undo_mutex in the corresponding transaction object */ @@ -488,7 +484,7 @@ struct trx_undo_t { /*!< undo log objects in the rollback segment are chained into lists */ }; -#endif /* !UNIV_HOTBACKUP && !UNIV_INNOCHECKSUM */ +#endif /* !UNIV_INNOCHECKSUM */ /** The offset of the undo log page header on pages of the undo log */ #define TRX_UNDO_PAGE_HDR FSEG_PAGE_DATA @@ -553,7 +549,6 @@ log segment */ #define TRX_UNDO_SEG_HDR_SIZE (4 + FSEG_HEADER_SIZE + FLST_BASE_NODE_SIZE) /* @} */ - /** The undo log header. There can be several undo log headers on the first page of an update undo log segment. */ /* @{ */ diff --git a/storage/innobase/include/trx0undo.ic b/storage/innobase/include/trx0undo.ic index f8e74d0fb03..62d9e64b13f 100644 --- a/storage/innobase/include/trx0undo.ic +++ b/storage/innobase/include/trx0undo.ic @@ -26,7 +26,6 @@ Created 3/26/1996 Heikki Tuuri #include "data0type.h" #include "page0page.h" -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Builds a roll pointer. @return roll pointer */ @@ -116,7 +115,6 @@ trx_undo_trx_id_is_insert( #endif return(static_cast<bool>(trx_id[DATA_TRX_ID_LEN] >> 7)); } -#endif /* !UNIV_HOTBACKUP */ /*****************************************************************//** Writes a roll ptr to an index page. In case that the size changes in @@ -153,8 +151,6 @@ trx_read_roll_ptr( return(mach_read_from_7(ptr)); } -#ifndef UNIV_HOTBACKUP - /** Gets an undo log page and x-latches it. @param[in] page_id page id @param[in] page_size page size @@ -361,4 +357,3 @@ trx_undo_page_get_first_rec( return(undo_page + start); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index f885bd2191f..f877eedf551 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -34,10 +34,6 @@ Created 1/20/1994 Heikki Tuuri #ifndef univ_i #define univ_i -#ifdef UNIV_HOTBACKUP -#include "hb_univ.i" -#endif /* UNIV_HOTBACKUP */ - /* aux macros to convert M into "123" (string) if M is defined like #define M 123 */ #define _IB_TO_STR(s) #s @@ -79,27 +75,22 @@ the virtual method table (vtable) in GCC 3. */ # include <windows.h> #endif /* _WIN32 */ -/* The defines used with MySQL */ - -#ifndef UNIV_HOTBACKUP - /* Include a minimum number of SQL header files so that few changes made in SQL code cause a complete InnoDB rebuild. These headers are used throughout InnoDB but do not include too much themselves. They support cross-platform development and expose comonly used SQL names. */ -# include <my_global.h> +#include <my_global.h> /* JAN: TODO: missing 5.7 header */ #ifdef HAVE_MY_THREAD_H //# include <my_thread.h> #endif -# ifndef UNIV_INNOCHECKSUM -# include <m_string.h> -# include <mysqld_error.h> -# endif /* !UNIV_INNOCHECKSUM */ -#endif /* !UNIV_HOTBACKUP */ +#ifndef UNIV_INNOCHECKSUM +# include <m_string.h> +# include <mysqld_error.h> +#endif /* !UNIV_INNOCHECKSUM */ /* Include <sys/stat.h> to get S_I... macros defined for os0file.cc */ #include <sys/stat.h> @@ -107,13 +98,7 @@ support cross-platform development and expose comonly used SQL names. */ #ifndef _WIN32 # include <sys/mman.h> /* mmap() for os0proc.cc */ # include <sched.h> -#endif /* !_WIN32 */ - -/* Include the header file generated by CMake */ -#ifndef _WIN32 -# ifndef UNIV_HOTBACKUP -# include "my_config.h" -# endif /* UNIV_HOTBACKUP */ +# include "my_config.h" #endif #include <stdint.h> @@ -126,7 +111,7 @@ support cross-platform development and expose comonly used SQL names. */ /* Following defines are to enable performance schema instrumentation in each of five InnoDB modules if HAVE_PSI_INTERFACE is defined. */ -#if defined(HAVE_PSI_INTERFACE) && !defined(UNIV_HOTBACKUP) +#ifdef HAVE_PSI_INTERFACE # define UNIV_PFS_MUTEX # define UNIV_PFS_RWLOCK /* For I/O instrumentation, performance schema rely diff --git a/storage/innobase/include/ut0counter.h b/storage/innobase/include/ut0counter.h index 175427df333..70381f26a84 100644 --- a/storage/innobase/include/ut0counter.h +++ b/storage/innobase/include/ut0counter.h @@ -32,19 +32,11 @@ Created 2012/04/12 by Sunny Bains #include "os0thread.h" /** CPU cache line size */ -#ifndef UNIV_HOTBACKUP -# ifdef CPU_LEVEL1_DCACHE_LINESIZE -# define CACHE_LINE_SIZE CPU_LEVEL1_DCACHE_LINESIZE -# else -# error CPU_LEVEL1_DCACHE_LINESIZE is undefined -# endif /* CPU_LEVEL1_DCACHE_LINESIZE */ +#ifdef CPU_LEVEL1_DCACHE_LINESIZE +# define CACHE_LINE_SIZE CPU_LEVEL1_DCACHE_LINESIZE #else -#ifdef powerpc -#define CACHE_LINE_SIZE 128 -#else -# define CACHE_LINE_SIZE 64 -#endif /* __powerpc__ */ -#endif /* UNIV_HOTBACKUP */ +# error CPU_LEVEL1_DCACHE_LINESIZE is undefined +#endif /* CPU_LEVEL1_DCACHE_LINESIZE */ /** Default number of slots to use in ib_counter_t */ #define IB_N_SLOTS 64 diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h index 6d56be4d820..f20273daca6 100644 --- a/storage/innobase/include/ut0mem.h +++ b/storage/innobase/include/ut0mem.h @@ -27,10 +27,8 @@ Created 5/30/1994 Heikki Tuuri #define ut0mem_h #include "univ.i" -#ifndef UNIV_HOTBACKUP -# include "os0event.h" -# include "ut0mutex.h" -#endif /* !UNIV_HOTBACKUP */ +#include "os0event.h" +#include "ut0mutex.h" /** Wrapper for memcpy(3). Copy memory area when the source and target are not overlapping. diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 087f175db50..fb8b66ddd39 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -52,61 +52,60 @@ Created 1/20/1994 Heikki Tuuri /** Time stamp */ typedef time_t ib_time_t; -#ifndef UNIV_HOTBACKUP -# if defined(HAVE_PAUSE_INSTRUCTION) +#ifdef HAVE_PAUSE_INSTRUCTION /* According to the gcc info page, asm volatile means that the instruction has important side-effects and must not be removed. Also asm volatile may trigger a memory barrier (spilling all registers to memory). */ -# ifdef __SUNPRO_CC -# define UT_RELAX_CPU() asm ("pause" ) -# else -# define UT_RELAX_CPU() __asm__ __volatile__ ("pause") -# endif /* __SUNPRO_CC */ - -# elif defined(HAVE_FAKE_PAUSE_INSTRUCTION) -# define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop") -# elif defined _WIN32 +# ifdef __SUNPRO_CC +# define UT_RELAX_CPU() asm ("pause" ) +# else +# define UT_RELAX_CPU() __asm__ __volatile__ ("pause") +# endif /* __SUNPRO_CC */ + +#elif defined(HAVE_FAKE_PAUSE_INSTRUCTION) +# define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop") +#elif defined _WIN32 /* In the Win32 API, the x86 PAUSE instruction is executed by calling the YieldProcessor macro defined in WinNT.h. It is a CPU architecture- independent way by using YieldProcessor. */ -# define UT_RELAX_CPU() YieldProcessor() -# elif defined(__powerpc__) && defined __GLIBC__ -#include <sys/platform/ppc.h> -# define UT_RELAX_CPU() do { \ +# define UT_RELAX_CPU() YieldProcessor() +#elif defined(__powerpc__) && defined __GLIBC__ +# include <sys/platform/ppc.h> +# define UT_RELAX_CPU() do { \ volatile lint volatile_var = __ppc_get_timebase(); \ } while (0) -# else -# define UT_RELAX_CPU() do { \ +#else +# define UT_RELAX_CPU() do { \ volatile int32 volatile_var; \ int32 oldval= 0; \ my_atomic_cas32(&volatile_var, &oldval, 1); \ } while (0) -# endif +#endif #if defined (__GNUC__) -# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory") +# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory") #elif defined (_MSC_VER) -# define UT_COMPILER_BARRIER() _ReadWriteBarrier() +# define UT_COMPILER_BARRIER() _ReadWriteBarrier() #else -# define UT_COMPILER_BARRIER() +# define UT_COMPILER_BARRIER() #endif -# if defined(HAVE_HMT_PRIORITY_INSTRUCTION) -#include <sys/platform/ppc.h> -# define UT_LOW_PRIORITY_CPU() __ppc_set_ppr_low() -# define UT_RESUME_PRIORITY_CPU() __ppc_set_ppr_med() -# else -# define UT_LOW_PRIORITY_CPU() ((void)0) -# define UT_RESUME_PRIORITY_CPU() ((void)0) -# endif +#if defined(HAVE_HMT_PRIORITY_INSTRUCTION) +# include <sys/platform/ppc.h> +# define UT_LOW_PRIORITY_CPU() __ppc_set_ppr_low() +# define UT_RESUME_PRIORITY_CPU() __ppc_set_ppr_med() +#else +# define UT_LOW_PRIORITY_CPU() ((void)0) +# define UT_RESUME_PRIORITY_CPU() ((void)0) +#endif /*********************************************************************//** Delays execution for at most max_wait_us microseconds or returns earlier if cond becomes true. @param cond in: condition to wait for; evaluated every 2 ms @param max_wait_us in: maximum delay to wait, in microseconds */ -#define UT_WAIT_FOR(cond, max_wait_us) \ +# define UT_WAIT_FOR(cond, max_wait_us) \ do { \ uintmax_t start_us; \ start_us = ut_time_us(NULL); \ @@ -116,7 +115,6 @@ do { \ os_thread_sleep(2000 /* 2 ms */); \ } \ } while (0) -#endif /* !UNIV_HOTBACKUP */ #define ut_max std::max #define ut_min std::min @@ -229,7 +227,7 @@ the only way to manipulate it is to use the function ut_difftime. ib_time_t ut_time(void); /*=========*/ -#ifndef UNIV_HOTBACKUP + /**********************************************************//** Returns system time. Upon successful completion, the value 0 is returned; otherwise the @@ -259,7 +257,6 @@ purposes. ulint ut_time_ms(void); /*============*/ -#endif /* !UNIV_HOTBACKUP */ /**********************************************************//** Returns the number of milliseconds since some epoch. The @@ -314,23 +311,6 @@ void ut_sprintf_timestamp( /*=================*/ char* buf); /*!< in: buffer where to sprintf */ -#ifdef UNIV_HOTBACKUP -/**********************************************************//** -Sprintfs a timestamp to a buffer with no spaces and with ':' characters -replaced by '_'. */ -void -ut_sprintf_timestamp_without_extra_chars( -/*=====================================*/ - char* buf); /*!< in: buffer where to sprintf */ -/**********************************************************//** -Returns current year, month, day. */ -void -ut_get_year_month_day( -/*==================*/ - ulint* year, /*!< out: current year */ - ulint* month, /*!< out: month */ - ulint* day); /*!< out: day */ -#else /* UNIV_HOTBACKUP */ /*************************************************************//** Runs an idle loop on CPU. The argument gives the desired delay in microseconds on 100 MHz Pentium + Visual C++. @@ -339,7 +319,6 @@ ulint ut_delay( /*=====*/ ulint delay); /*!< in: delay in microseconds on 100 MHz Pentium */ -#endif /* UNIV_HOTBACKUP */ /*************************************************************//** Prints the contents of a memory buffer in hex and ascii. */ void @@ -368,7 +347,6 @@ ut_print_buf( ulint len) /*!< in: length of the buffer */ MY_ATTRIBUTE((nonnull)); -#ifndef UNIV_HOTBACKUP /* Forward declaration of transaction handle */ struct trx_t; @@ -418,7 +396,6 @@ ut_copy_file( /*=========*/ FILE* dest, /*!< in: output file */ FILE* src); /*!< in: input file to be appended to output */ -#endif /* !UNIV_HOTBACKUP */ #ifdef _WIN32 /**********************************************************************//** diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 0a5e3b27bc0..979a40e22fe 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -42,7 +42,6 @@ Created 12/9/1995 Heikki Tuuri #include "mem0mem.h" #include "buf0buf.h" -#ifndef UNIV_HOTBACKUP #include "buf0flu.h" #include "srv0srv.h" #include "log0recv.h" @@ -56,7 +55,6 @@ Created 12/9/1995 Heikki Tuuri #include "trx0roll.h" #include "srv0mon.h" #include "sync0sync.h" -#endif /* !UNIV_HOTBACKUP */ /* Used for debugging */ // #define DEBUG_CRYPT 1 @@ -144,7 +142,6 @@ void log_io_complete_checkpoint(void); /*============================*/ -#ifndef UNIV_HOTBACKUP /****************************************************************//** Returns the oldest modified block lsn in the pool, or log_sys->lsn if none exists. @@ -167,7 +164,6 @@ log_buf_pool_get_oldest_modification(void) return(lsn); } -#endif /* !UNIV_HOTBACKUP */ /** Extends the log buffer. @param[in] len requested minimum size in bytes */ @@ -261,7 +257,6 @@ log_buffer_extend( << LOG_BUFFER_SIZE << "."; } -#ifndef UNIV_HOTBACKUP /** Calculate actual length in redo buffer and file including block header and trailer. @param[in] len length to write @@ -352,7 +347,7 @@ log_margin_checkpoint_age( return; } -#endif /* !UNIV_HOTBACKUP */ + /** Open the log for log_write_low. The log must be closed with log_close. @param[in] len length of the data to be written @return start lsn of the log record */ @@ -712,7 +707,7 @@ log_group_set_fields( group->lsn_offset = log_group_calc_lsn_offset(lsn, group); group->lsn = lsn; } -#ifndef UNIV_HOTBACKUP + /*****************************************************************//** Calculates the recommended highest values for lsn - last_checkpoint_lsn and lsn - buf_get_oldest_modification(). @@ -920,7 +915,7 @@ log_group_init( UT_LIST_ADD_LAST(log_sys->log_groups, group); return(log_calc_max_ages()); } -#endif /* !UNIV_HOTBACKUP */ + /******************************************************//** Completes an i/o to a log file. */ void @@ -1265,7 +1260,6 @@ loop: } #ifdef _WIN32 -# ifndef UNIV_HOTBACKUP /* write requests during fil_flush() might not be good for Windows */ if (log_sys->n_pending_flushes > 0 || !os_event_is_set(log_sys->flush_event)) { @@ -1273,11 +1267,6 @@ loop: os_event_wait(log_sys->flush_event); goto loop; } -# else - if (log_sys->n_pending_flushes > 0) { - goto loop; - } -# endif /* !UNIV_HOTBACKUP */ #endif /* _WIN32 */ /* If it is a write call we should just go ahead and do it @@ -1481,7 +1470,7 @@ log_flush_margin(void) log_write_up_to(lsn, false); } } -#ifndef UNIV_HOTBACKUP + /** Advances the smallest lsn for which there are unflushed dirty blocks in the buffer pool. NOTE: this function may only be called if the calling thread owns no @@ -1550,7 +1539,7 @@ log_preflush_pool_modified_pages( return(success); } -#endif /* !UNIV_HOTBACKUP */ + /******************************************************//** Completes a checkpoint. */ static @@ -1665,50 +1654,6 @@ log_group_checkpoint( ut_ad(((ulint) group & 0x1UL) == 0); } -#ifdef UNIV_HOTBACKUP -/******************************************************//** -Writes info to a buffer of a log group when log files are created in -backup restoration. */ -void -log_reset_first_header_and_checkpoint( -/*==================================*/ - byte* hdr_buf,/*!< in: buffer which will be written to the - start of the first log file */ - ib_uint64_t start) /*!< in: lsn of the start of the first log file; - we pretend that there is a checkpoint at - start + LOG_BLOCK_HDR_SIZE */ -{ - byte* buf; - ib_uint64_t lsn; - - mach_write_to_4(hdr_buf + LOG_HEADER_FORMAT, - LOG_HEADER_FORMAT_CURRENT); - mach_write_to_8(hdr_buf + LOG_HEADER_START_LSN, start); - - lsn = start + LOG_BLOCK_HDR_SIZE; - - /* Write the label of mysqlbackup --restore */ - strcpy((char*)hdr_buf + LOG_HEADER_CREATOR, LOG_HEADER_CREATOR_CURRENT); - ut_sprintf_timestamp((char*) hdr_buf - + (LOG_HEADER_CREATOR - + (sizeof LOG_HEADER_CREATOR_CURRENT) - 1)); - buf = hdr_buf + LOG_CHECKPOINT_1; - memset(buf, 0, OS_FILE_LOG_BLOCK_SIZE); - - /*mach_write_to_8(buf + LOG_CHECKPOINT_NO, 0);*/ - mach_write_to_8(buf + LOG_CHECKPOINT_LSN, lsn); - - log_crypt_write_checkpoint_buf(buf); - - mach_write_to_8(buf + LOG_CHECKPOINT_OFFSET, - LOG_FILE_HDR_SIZE + LOG_BLOCK_HDR_SIZE); - mach_write_to_8(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, 2 * 1024 * 1024); - - log_block_set_checksum(buf, log_block_calc_checksum_crc32(buf)); -} -#endif /* UNIV_HOTBACKUP */ - -#ifndef UNIV_HOTBACKUP /** Read a log group header page to log_sys->checkpoint_buf. @param[in] group log group @param[in] header 0 or LOG_CHEKCPOINT_1 or LOG_CHECKPOINT2 */ @@ -2675,4 +2620,3 @@ DECLARE_THREAD(log_scrub_thread)( OS_THREAD_DUMMY_RETURN; } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 6901ba070af..1ecebe098bd 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -34,16 +34,11 @@ Created 9/20/1997 Heikki Tuuri #include "log0recv.h" -#ifdef UNIV_NONINL -#include "log0recv.ic" -#endif - #ifdef HAVE_MY_AES_H #include <my_aes.h> #endif #include "log0crypt.h" - #include "mem0mem.h" #include "buf0buf.h" #include "buf0flu.h" @@ -60,19 +55,11 @@ Created 9/20/1997 Heikki Tuuri #include "fsp0sysspace.h" #include "ut0new.h" #include "row0trunc.h" -#ifndef UNIV_HOTBACKUP -# include "buf0rea.h" -# include "srv0srv.h" -# include "srv0start.h" -# include "trx0roll.h" -# include "row0merge.h" -#else /* !UNIV_HOTBACKUP */ -/** This is set to false if the backup was originally taken with the -mysqlbackup --include regexp option: then we do not want to create tables in -directories which were not included */ -bool recv_replay_file_ops = true; -#include "fut0lst.h" -#endif /* !UNIV_HOTBACKUP */ +#include "buf0rea.h" +#include "srv0srv.h" +#include "srv0start.h" +#include "trx0roll.h" +#include "row0merge.h" /** Log records are stored in the hash table in chunks at most of this size; this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */ @@ -88,18 +75,13 @@ otherwise. Note that this is FALSE while a background thread is rolling back incomplete transactions. */ volatile bool recv_recovery_on; -#ifndef UNIV_HOTBACKUP /** TRUE when recv_init_crash_recovery() has been called. */ bool recv_needed_recovery; -#else -# define recv_needed_recovery false -# define buf_pool_get_curr_size() (5 * 1024 * 1024) -#endif /* !UNIV_HOTBACKUP */ -# ifdef UNIV_DEBUG +#ifdef UNIV_DEBUG /** TRUE if writing to the redo log (mtr_commit) is forbidden. Protected by log_sys->mutex. */ bool recv_no_log_write = false; -# endif /* UNIV_DEBUG */ +#endif /* UNIV_DEBUG */ /** TRUE if buf_page_is_corrupted() should check if the log sequence number (FIL_PAGE_LSN) is in the future. Initially FALSE, and set by @@ -115,24 +97,7 @@ buffer pool before the pages have been recovered to the up-to-date state. TRUE means that recovery is running and no operations on the log files are allowed yet: the variable name is misleading. */ -#ifndef UNIV_HOTBACKUP bool recv_no_ibuf_operations; -/** TRUE when the redo log is being backed up */ -# define recv_is_making_a_backup false -/** TRUE when recovering from a backed up redo log file */ -# define recv_is_from_backup false -#else /* !UNIV_HOTBACKUP */ -/** true if the backup is an offline backup */ -volatile bool is_online_redo_copy = true; -/**true if the last flushed lsn read at the start of backup */ -volatile lsn_t backup_redo_log_flushed_lsn; - -/** TRUE when the redo log is being backed up */ -bool recv_is_making_a_backup = false; -/** TRUE when recovering from a backed up redo log file */ -bool recv_is_from_backup = false; -# define buf_pool_get_curr_size() (5 * 1024 * 1024) -#endif /* !UNIV_HOTBACKUP */ /** The following counter is used to decide when to print info on log scan */ static ulint recv_scan_print_counter; @@ -159,16 +124,11 @@ lsn_t recv_max_page_lsn; #ifdef UNIV_PFS_THREAD mysql_pfs_key_t trx_rollback_clean_thread_key; -#endif /* UNIV_PFS_THREAD */ - -#ifndef UNIV_HOTBACKUP -# ifdef UNIV_PFS_THREAD mysql_pfs_key_t recv_writer_thread_key; -# endif /* UNIV_PFS_THREAD */ +#endif /* UNIV_PFS_THREAD */ /** Flag indicating if recv_writer thread is active. */ volatile bool recv_writer_thread_active = false; -#endif /* !UNIV_HOTBACKUP */ #ifndef DBUG_OFF /** Return string name of the redo log record type. @@ -180,7 +140,6 @@ get_mlog_string(mlog_id_t type); /* prototypes */ -#ifndef UNIV_HOTBACKUP /*******************************************************//** Initialize crash recovery environment. Can be called iff recv_needed_recovery == false. */ @@ -188,7 +147,6 @@ static void recv_init_crash_recovery(void); /*===========================*/ -#endif /* !UNIV_HOTBACKUP */ /** Tablespace item during recovery */ struct file_name_t { @@ -344,7 +302,6 @@ fil_name_process( case FIL_LOAD_INVALID: ut_ad(space == NULL); if (srv_force_recovery == 0) { -#ifndef UNIV_HOTBACKUP ib::warn() << "We do not continue the crash" " recovery, because the table may" " become corrupt if we cannot apply" @@ -366,13 +323,6 @@ fil_name_process( " remove the .ibd file, you can set" " --innodb_force_recovery."; recv_sys->found_corrupt_fs = true; -#else - ib::warn() << "We do not continue the apply-log" - " operation because the tablespace may" - " become corrupt if we cannot apply" - " the log records in the redo log" - " records to it."; -#endif /* !UNIV_BACKUP */ processed = false; break; } @@ -387,7 +337,6 @@ fil_name_process( return(processed); } -#ifndef UNIV_HOTBACKUP /** Parse or process a MLOG_FILE_* record. @param[in] ptr redo log record @param[in] end end of the redo log buffer @@ -514,286 +463,6 @@ fil_name_parse( return(end_ptr); } -#else /* !UNIV_HOTBACKUP */ -/** Parse a file name retrieved from a MLOG_FILE_* record, -and return the absolute file path corresponds to backup dir -as well as in the form of database/tablespace -@param[in] file_name path emitted by the redo log -@param[out] absolute_path absolute path of tablespace -corresponds to backup dir -@param[out] tablespace_name name in the form of database/table */ -static -void -make_abs_file_path( - const std::string& name, - std::string& absolute_path, - std::string& tablespace_name) -{ - std::string file_name = name; - std::string path = fil_path_to_mysql_datadir; - size_t pos = std::string::npos; - - if (is_absolute_path(file_name.c_str())) { - - pos = file_name.rfind(OS_PATH_SEPARATOR); - std::string temp_name = file_name.substr(0, pos); - pos = temp_name.rfind(OS_PATH_SEPARATOR); - ++pos; - file_name = file_name.substr(pos, file_name.length()); - path += OS_PATH_SEPARATOR + file_name; - } else { - pos = file_name.find(OS_PATH_SEPARATOR); - ++pos; - file_name = file_name.substr(pos, file_name.length()); - path += OS_PATH_SEPARATOR + file_name; - } - - absolute_path = path; - - /* remove the .ibd extension */ - pos = file_name.rfind(".ibd"); - if (pos != std::string::npos) - tablespace_name = file_name.substr(0, pos); - - /* space->name uses '/', not OS_PATH_SEPARATOR, - update the seperator */ - if (OS_PATH_SEPARATOR != '/') { - pos = tablespace_name.find(OS_PATH_SEPARATOR); - while (pos != std::string::npos) { - tablespace_name[pos] = '/'; - pos = tablespace_name.find(OS_PATH_SEPARATOR); - } - } - -} - -/** Wrapper around fil_name_process() -@param[in] name absolute path of tablespace file -@param[in] space_id the tablespace ID -@retval true if able to process file successfully. -@retval false if unable to process the file */ -bool -fil_name_process( - const char* name, - ulint space_id) -{ - size_t length = strlen(name); - ++length; - - char* file_name = static_cast<char*>(ut_malloc_nokey(length)); - strncpy(file_name, name,length); - - bool processed = fil_name_process(file_name, length, space_id, false); - - ut_free(file_name); - return(processed); -} - -/** Parse or process a MLOG_FILE_* record. -@param[in] ptr redo log record -@param[in] end end of the redo log buffer -@param[in] space_id the tablespace ID -@param[in] first_page_no first page number in the file -@param[in] type MLOG_FILE_NAME or MLOG_FILE_DELETE -or MLOG_FILE_CREATE2 or MLOG_FILE_RENAME2 -@param[in] apply whether to apply the record -@retval pointer to next redo log record -@retval NULL if this log record was truncated */ -static -byte* -fil_name_parse( - byte* ptr, - const byte* end, - ulint space_id, - ulint first_page_no, - mlog_id_t type, - bool apply) -{ - - ulint flags = mach_read_from_4(ptr); - - if (type == MLOG_FILE_CREATE2) { - if (end < ptr + 4) { - return(NULL); - } - ptr += 4; - } - - if (end < ptr + 2) { - return(NULL); - } - - ulint len = mach_read_from_2(ptr); - ptr += 2; - if (end < ptr + len) { - return(NULL); - } - - os_normalize_path(reinterpret_cast<char*>(ptr)); - - /* MLOG_FILE_* records should only be written for - user-created tablespaces. The name must be long enough - and end in .ibd. */ - bool corrupt = is_predefined_tablespace(space_id) - || first_page_no != 0 // TODO: multi-file user tablespaces - || len < sizeof "/a.ibd\0" - || memcmp(ptr + len - 5, DOT_IBD, 5) != 0 - || memchr(ptr, OS_PATH_SEPARATOR, len) == NULL; - - byte* end_ptr = ptr + len; - - if (corrupt) { - recv_sys->found_corrupt_log = true; - return(end_ptr); - } - - std::string abs_file_path, tablespace_name; - char* name = reinterpret_cast<char*>(ptr); - char* new_name = NULL; - recv_spaces_t::iterator itr; - - make_abs_file_path(name, abs_file_path, tablespace_name); - - if (!recv_is_making_a_backup) { - - name = static_cast<char*>(ut_malloc_nokey( - (abs_file_path.length() + 1))); - strcpy(name, abs_file_path.c_str()); - len = strlen(name) + 1; - } - switch (type) { - default: - ut_ad(0); // the caller checked this - case MLOG_FILE_NAME: - /* Don't validate tablespaces while copying redo logs - because backup process might keep some tablespace handles - open in server datadir. - Maintain "map of dirty tablespaces" so that assumptions - for other redo log records are not broken even for dirty - tablespaces during apply log */ - if (!recv_is_making_a_backup) { - recv_spaces.insert(std::make_pair(space_id, - file_name_t(abs_file_path, - false))); - } - break; - case MLOG_FILE_DELETE: - /* Don't validate tablespaces while copying redo logs - because backup process might keep some tablespace handles - open in server datadir. */ - if (recv_is_making_a_backup) - break; - - fil_name_process( - name, len, space_id, true); - - if (apply && recv_replay_file_ops - && fil_space_get(space_id)) { - dberr_t err = fil_delete_tablespace( - space_id, BUF_REMOVE_FLUSH_NO_WRITE); - ut_a(err == DB_SUCCESS); - } - - break; - case MLOG_FILE_CREATE2: - if (recv_is_making_a_backup - || (!recv_replay_file_ops) - || (is_intermediate_file(abs_file_path.c_str())) - || (fil_space_get(space_id)) - || (fil_space_get_id_by_name( - tablespace_name.c_str()) != ULINT_UNDEFINED)) { - /* Don't create table while :- - 1. scanning the redo logs during backup - 2. apply-log on a partial backup - 3. if it is intermediate file - 4. tablespace is already loaded in memory */ - } else { - itr = recv_spaces.find(space_id); - if (itr == recv_spaces.end() - || (itr->second.name != abs_file_path)) { - - dberr_t ret = fil_ibd_create( - space_id, tablespace_name.c_str(), - abs_file_path.c_str(), - flags, FIL_IBD_FILE_INITIAL_SIZE); - - if (ret != DB_SUCCESS) { - ib::fatal() << "Could not create the" - << " tablespace : " - << abs_file_path - << " with space Id : " - << space_id; - } - } - } - break; - case MLOG_FILE_RENAME2: - /* The new name follows the old name. */ - byte* new_table_name = end_ptr + 2; - if (end < new_table_name) { - return(NULL); - } - - ulint new_len = mach_read_from_2(end_ptr); - - if (end < end_ptr + 2 + new_len) { - return(NULL); - } - - end_ptr += 2 + new_len; - - char* new_table = reinterpret_cast<char*>(new_table_name); - os_normalize_path(new_table); - - corrupt = corrupt - || new_len < sizeof "/a.ibd\0" - || memcmp(new_table_name + new_len - 5, DOT_IBD, 5) != 0 - || !memchr(new_table_name, OS_PATH_SEPARATOR, new_len); - - if (corrupt) { - recv_sys->found_corrupt_log = true; - break; - } - - if (recv_is_making_a_backup - || (!recv_replay_file_ops) - || (is_intermediate_file(name)) - || (is_intermediate_file(new_table))) { - /* Don't rename table while :- - 1. scanning the redo logs during backup - 2. apply-log on a partial backup - 3. The new name is already used. - 4. A tablespace is not open in memory with the old name. - This will prevent unintended renames during recovery. */ - break; - } else { - make_abs_file_path(new_table, abs_file_path, - tablespace_name); - - new_name = static_cast<char*>(ut_malloc_nokey( - (abs_file_path.length() + 1))); - strcpy(new_name, abs_file_path.c_str()); - new_len = strlen(new_name) + 1; - } - - fil_name_process(name, len, space_id, false); - fil_name_process( new_name, new_len, space_id, false); - - if (!fil_op_replay_rename( - space_id, first_page_no, - name, - new_name)) { - recv_sys->found_corrupt_fs = true; - } - } - - if (!recv_is_making_a_backup) { - ut_free(name); - ut_free(new_name); - } - return(end_ptr); -} -#endif /* UNIV_HOTBACKUP */ /********************************************************//** Creates the recovery system. */ @@ -829,7 +498,7 @@ recv_sys_close(void) if (recv_sys->heap != NULL) { mem_heap_free(recv_sys->heap); } -#ifndef UNIV_HOTBACKUP + if (recv_sys->flush_start != NULL) { os_event_destroy(recv_sys->flush_start); } @@ -837,14 +506,12 @@ recv_sys_close(void) if (recv_sys->flush_end != NULL) { os_event_destroy(recv_sys->flush_end); } -#endif /* !UNIV_HOTBACKUP */ + ut_free(recv_sys->buf); ut_free(recv_sys->last_block_buf_start); -#ifndef UNIV_HOTBACKUP ut_ad(!recv_writer_thread_active); mutex_free(&recv_sys->writer_mutex); -#endif /* !UNIV_HOTBACKUP */ mutex_free(&recv_sys->mutex); @@ -869,7 +536,7 @@ recv_sys_mem_free(void) if (recv_sys->heap != NULL) { mem_heap_free(recv_sys->heap); } -#ifndef UNIV_HOTBACKUP + if (recv_sys->flush_start != NULL) { os_event_destroy(recv_sys->flush_start); } @@ -877,7 +544,7 @@ recv_sys_mem_free(void) if (recv_sys->flush_end != NULL) { os_event_destroy(recv_sys->flush_end); } -#endif /* !UNIV_HOTBACKUP */ + ut_free(recv_sys->buf); ut_free(recv_sys->last_block_buf_start); ut_free(recv_sys); @@ -885,7 +552,6 @@ recv_sys_mem_free(void) } } -#ifndef UNIV_HOTBACKUP /************************************************************ Reset the state of the recovery system variables. */ void @@ -961,7 +627,6 @@ DECLARE_THREAD(recv_writer_thread)( OS_THREAD_DUMMY_RETURN; } -#endif /* !UNIV_HOTBACKUP */ /************************************************************ Inits the recovery system for a recovery operation. */ @@ -975,7 +640,6 @@ recv_sys_init( return; } -#ifndef UNIV_HOTBACKUP mutex_enter(&(recv_sys->mutex)); recv_sys->heap = mem_heap_create_typed(256, @@ -985,10 +649,6 @@ recv_sys_init( recv_sys->flush_start = os_event_create(0); recv_sys->flush_end = os_event_create(0); } -#else /* !UNIV_HOTBACKUP */ - recv_sys->heap = mem_heap_create(256); - recv_is_from_backup = true; -#endif /* !UNIV_HOTBACKUP */ /* Set appropriate value of recv_n_pool_free_frames. */ if (buf_pool_get_curr_size() >= (10 * 1024 * 1024)) { @@ -1046,8 +706,6 @@ recv_sys_empty_hash(void) recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 512); } -#ifndef UNIV_HOTBACKUP - /********************************************************//** Frees the recovery system. */ void @@ -1145,7 +803,6 @@ recv_synchronize_groups(void) log_write_checkpoint_info(true); log_mutex_enter(); } -#endif /* !UNIV_HOTBACKUP */ /** Check the consistency of a log header block. @param[in] log header block @@ -1159,7 +816,6 @@ recv_check_log_header_checksum( == log_block_calc_checksum_crc32(buf)); } -#ifndef UNIV_HOTBACKUP /** Find the latest checkpoint in the format-0 log header. @param[out] max_group log group, or NULL @param[out] max_field LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2 @@ -1421,58 +1077,6 @@ recv_find_max_checkpoint( return(DB_SUCCESS); } -#else /* !UNIV_HOTBACKUP */ -/*******************************************************************//** -Reads the checkpoint info needed in hot backup. -@return TRUE if success */ -ibool -recv_read_checkpoint_info_for_backup( -/*=================================*/ - const byte* hdr, /*!< in: buffer containing the log group - header */ - lsn_t* lsn, /*!< out: checkpoint lsn */ - lsn_t* offset, /*!< out: checkpoint offset in the log group */ - lsn_t* cp_no, /*!< out: checkpoint number */ - lsn_t* first_header_lsn) - /*!< out: lsn of of the start of the - first log file */ -{ - ulint max_cp = 0; - ib_uint64_t max_cp_no = 0; - const byte* cp_buf; - - cp_buf = hdr + LOG_CHECKPOINT_1; - - if (recv_check_log_header_checksum(cp_buf)) { - max_cp_no = mach_read_from_8(cp_buf + LOG_CHECKPOINT_NO); - max_cp = LOG_CHECKPOINT_1; - } - - cp_buf = hdr + LOG_CHECKPOINT_2; - - if (recv_check_log_header_checksum(cp_buf)) { - if (mach_read_from_8(cp_buf + LOG_CHECKPOINT_NO) > max_cp_no) { - max_cp = LOG_CHECKPOINT_2; - } - } - - if (max_cp == 0) { - return(FALSE); - } - - cp_buf = hdr + max_cp; - - *lsn = mach_read_from_8(cp_buf + LOG_CHECKPOINT_LSN); - *offset = mach_read_from_8( - cp_buf + LOG_CHECKPOINT_OFFSET); - - *cp_no = mach_read_from_8(cp_buf + LOG_CHECKPOINT_NO); - - *first_header_lsn = mach_read_from_8(hdr + LOG_HEADER_START_LSN); - - return(TRUE); -} -#endif /* !UNIV_HOTBACKUP */ /** Check the 4-byte checksum to the trailer checksum field of a log block. @@ -1497,97 +1101,6 @@ log_block_checksum_is_ok( == log_block_calc_checksum(block)); } -#ifdef UNIV_HOTBACKUP -/*******************************************************************//** -Scans the log segment and n_bytes_scanned is set to the length of valid -log scanned. */ -void -recv_scan_log_seg_for_backup( -/*=========================*/ - byte* buf, /*!< in: buffer containing log data */ - ulint buf_len, /*!< in: data length in that buffer */ - lsn_t* scanned_lsn, /*!< in/out: lsn of buffer start, - we return scanned lsn */ - ulint* scanned_checkpoint_no, - /*!< in/out: 4 lowest bytes of the - highest scanned checkpoint number so - far */ - ulint* n_bytes_scanned)/*!< out: how much we were able to - scan, smaller than buf_len if log - data ended here */ -{ - ulint data_len; - byte* log_block; - ulint no; - - *n_bytes_scanned = 0; - - for (log_block = buf; log_block < buf + buf_len; - log_block += OS_FILE_LOG_BLOCK_SIZE) { - - no = log_block_get_hdr_no(log_block); - -#if 0 - fprintf(stderr, "Log block header no %lu\n", no); -#endif - - if (no != log_block_convert_lsn_to_no(*scanned_lsn) - || !log_block_checksum_is_ok(log_block)) { -#if 0 - fprintf(stderr, - "Log block n:o %lu, scanned lsn n:o %lu\n", - no, log_block_convert_lsn_to_no(*scanned_lsn)); -#endif - /* Garbage or an incompletely written log block */ - - log_block += OS_FILE_LOG_BLOCK_SIZE; -#if 0 - fprintf(stderr, - "Next log block n:o %lu\n", - log_block_get_hdr_no(log_block)); -#endif - break; - } - - if (*scanned_checkpoint_no > 0 - && log_block_get_checkpoint_no(log_block) - < *scanned_checkpoint_no - && *scanned_checkpoint_no - - log_block_get_checkpoint_no(log_block) - > 0x80000000UL) { - - /* Garbage from a log buffer flush which was made - before the most recent database recovery */ -#if 0 - fprintf(stderr, - "Scanned cp n:o %lu, block cp n:o %lu\n", - *scanned_checkpoint_no, - log_block_get_checkpoint_no(log_block)); -#endif - break; - } - - data_len = log_block_get_data_len(log_block); - - *scanned_checkpoint_no - = log_block_get_checkpoint_no(log_block); - *scanned_lsn += data_len; - - *n_bytes_scanned += data_len; - - if (data_len < OS_FILE_LOG_BLOCK_SIZE) { - /* Log data ends here */ - -#if 0 - fprintf(stderr, "Log block data len %lu\n", - data_len); -#endif - break; - } - } -} -#endif /* UNIV_HOTBACKUP */ - #ifdef MYSQL_ENCRYPTION /** Parse or process a write encryption info record. @@ -1725,9 +1238,7 @@ recv_parse_or_apply_log_rec_body( mtr_t* mtr) { ut_ad(!block == !mtr); -#ifndef UNIV_HOTBACKUP ut_ad(!apply || recv_sys->mlog_checkpoint_lsn != 0); -#endif /* !UNIV_HOTBACKUP */ switch (type) { case MLOG_FILE_NAME: @@ -1740,66 +1251,6 @@ recv_parse_or_apply_log_rec_body( return(fil_name_parse(ptr, end_ptr, space_id, page_no, type, apply)); case MLOG_INDEX_LOAD: -#ifdef UNIV_HOTBACKUP - /* While scaning redo logs during backup phase a - MLOG_INDEX_LOAD type redo log record indicates a DDL - (create index, alter table...)is performed with - 'algorithm=inplace'. This redo log indicates that - - 1. The DDL was started after MEB started backing up, in which - case MEB will not be able to take a consistent backup and should - fail. or - 2. There is a possibility of this record existing in the REDO - even after the completion of the index create operation. This is - because of InnoDB does not checkpointing after the flushing the - index pages. - - If MEB gets the last_redo_flush_lsn and that is less than the - lsn of the current record MEB fails the backup process. - Error out in case of online backup and emit a warning in case - of offline backup and continue. - */ - if (!recv_recovery_on) { - if (is_online_redo_copy) { - if (backup_redo_log_flushed_lsn - < recv_sys->recovered_lsn) { - ib::trace() << "Last flushed lsn: " - << backup_redo_log_flushed_lsn - << " load_index lsn " - << recv_sys->recovered_lsn; - - if (backup_redo_log_flushed_lsn == 0) - ib::error() << "MEB was not " - "able to determine the" - "InnoDB Engine Status"; - - ib::fatal() << "An optimized(without" - " redo logging) DDLoperation" - " has been performed. All" - " modified pages may not have" - " been flushed to the disk yet." - " \n MEB will not be able" - " take a consistent backup." - " Retry the backup operation"; - } - /** else the index is flushed to disk before - backup started hence no error */ - } else { - /* offline backup */ - ib::trace() << "Last flushed lsn: " - << backup_redo_log_flushed_lsn - << " load_index lsn " - << recv_sys->recovered_lsn; - - ib::warn() << "An optimized(without redo" - " logging) DDL operation has been" - " performed. All modified pages may not" - " have been flushed to the disk yet." - " \n This offline backup may not" - " be consistent"; - } - } -#endif /* UNIV_HOTBACKUP */ if (end_ptr < ptr + 8) { return(NULL); } @@ -2377,19 +1828,12 @@ recv_data_copy_to_buf( } } -/************************************************************************//** -Applies the hashed log records to the page, if the page lsn is less than the -lsn of a log record. This can be called when a buffer page has just been -read in, or also for a page already in the buffer pool. */ +/** Apply the hashed log records to the page, if the page lsn is less than the +lsn of a log record. +@param just_read_in whether the page recently arrived to the I/O handler +@param block the page in the buffer pool */ void -recv_recover_page_func( -/*===================*/ -#ifndef UNIV_HOTBACKUP - ibool just_read_in, - /*!< in: TRUE if the i/o handler calls - this for a freshly read page */ -#endif /* !UNIV_HOTBACKUP */ - buf_block_t* block) /*!< in/out: buffer block */ +recv_recover_page(bool just_read_in, buf_block_t* block) { page_t* page; page_zip_des_t* page_zip; @@ -2427,13 +1871,11 @@ recv_recover_page_func( return; } -#ifndef UNIV_HOTBACKUP ut_ad(recv_needed_recovery); DBUG_PRINT("ib_log", ("Applying log to page %u:%u", recv_addr->space, recv_addr->page_no)); -#endif /* !UNIV_HOTBACKUP */ recv_addr->state = RECV_BEING_PROCESSED; @@ -2445,7 +1887,6 @@ recv_recover_page_func( page = block->frame; page_zip = buf_block_get_page_zip(block); -#ifndef UNIV_HOTBACKUP if (just_read_in) { /* Move the ownership of the x-latch on the page to this OS thread, so that we can acquire a second @@ -2461,12 +1902,10 @@ recv_recover_page_func( ut_a(success); buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK); -#endif /* !UNIV_HOTBACKUP */ /* Read the newest modification lsn from the page */ page_lsn = mach_read_from_8(page + FIL_PAGE_LSN); -#ifndef UNIV_HOTBACKUP /* It may be that the page has been modified in the buffer pool: read the newest modification lsn there */ @@ -2476,10 +1915,6 @@ recv_recover_page_func( page_lsn = page_newest_lsn; } -#else /* !UNIV_HOTBACKUP */ - /* In recovery from a backup we do not really use the buffer pool */ - page_newest_lsn = 0; -#endif /* !UNIV_HOTBACKUP */ modification_to_page = FALSE; start_lsn = end_lsn = 0; @@ -2592,7 +2027,6 @@ recv_recover_page_func( } #endif /* UNIV_ZIP_DEBUG */ -#ifndef UNIV_HOTBACKUP if (modification_to_page) { ut_a(block); @@ -2600,9 +2034,6 @@ recv_recover_page_func( buf_flush_recv_note_modification(block, start_lsn, end_lsn); log_flush_order_mutex_exit(); } -#else /* !UNIV_HOTBACKUP */ - start_lsn = start_lsn; /* Silence compiler */ -#endif /* !UNIV_HOTBACKUP */ /* Make sure that committing mtr does not change the modification lsn values of page */ @@ -2626,7 +2057,6 @@ recv_recover_page_func( } -#ifndef UNIV_HOTBACKUP /** Reads in pages which have hashed log records, from an area around a given page number. @param[in] page_id page id @@ -2864,174 +2294,6 @@ loop: return err; } -#else /* !UNIV_HOTBACKUP */ -/*******************************************************************//** -Applies log records in the hash table to a backup. */ -void -recv_apply_log_recs_for_backup(void) -/*================================*/ -{ - recv_addr_t* recv_addr; - ulint n_hash_cells; - buf_block_t* block; - bool success; - ulint error; - ulint i; - fil_space_t* space = NULL; - page_id_t page_id; - recv_sys->apply_log_recs = TRUE; - recv_sys->apply_batch_on = TRUE; - - block = back_block1; - - ib::info() << "Starting an apply batch of log records to the" - " database...\n"; - - fputs("InnoDB: Progress in percent: ", stderr); - - n_hash_cells = hash_get_n_cells(recv_sys->addr_hash); - - for (i = 0; i < n_hash_cells; i++) { - /* The address hash table is externally chained */ - recv_addr = static_cast<recv_addr_t*>(hash_get_nth_cell( - recv_sys->addr_hash, i)->node); - - while (recv_addr != NULL) { - - ib::trace() << "recv_addr {State: " << recv_addr->state - << ", Space id: " << recv_addr->space - << "Page no: " << recv_addr->page_no - << ". index i: " << i << "\n"; - - bool found; - const page_size_t& page_size - = fil_space_get_page_size(recv_addr->space, - &found); - - if (!found) { -#if 0 - fprintf(stderr, - "InnoDB: Warning: cannot apply" - " log record to" - " tablespace %lu page %lu,\n" - "InnoDB: because tablespace with" - " that id does not exist.\n", - recv_addr->space, recv_addr->page_no); -#endif - recv_addr->state = RECV_DISCARDED; - - ut_a(recv_sys->n_addrs); - recv_sys->n_addrs--; - - goto skip_this_recv_addr; - } - - /* We simulate a page read made by the buffer pool, to - make sure the recovery apparatus works ok. We must init - the block. */ - - buf_page_init_for_backup_restore( - page_id_t(recv_addr->space, recv_addr->page_no), - page_size, block); - - /* Extend the tablespace's last file if the page_no - does not fall inside its bounds; we assume the last - file is auto-extending, and mysqlbackup copied the file - when it still was smaller */ - fil_space_t* space - = fil_space_get(recv_addr->space); - - success = fil_space_extend( - space, recv_addr->page_no + 1); - if (!success) { - ib::fatal() << "Cannot extend tablespace " - << recv_addr->space << " to hold " - << recv_addr->page_no << " pages"; - } - - /* Read the page from the tablespace file using the - fil0fil.cc routines */ - - const page_id_t page_id(recv_addr->space, - recv_addr->page_no); - - if (page_size.is_compressed()) { - - error = fil_io( - IORequestRead, true, - page_id, - page_size, 0, page_size.physical(), - block->page.zip.data, NULL); - - if (error == DB_SUCCESS - && !buf_zip_decompress(block, TRUE)) { - ut_error; - } - } else { - - error = fil_io( - IORequestRead, true, - page_id, page_size, 0, - page_size.logical(), - block->frame, NULL); - } - - if (error != DB_SUCCESS) { - ib::fatal() << "Cannot read from tablespace " - << recv_addr->space << " page number " - << recv_addr->page_no; - } - - /* Apply the log records to this page */ - recv_recover_page(FALSE, block); - - /* Write the page back to the tablespace file using the - fil0fil.cc routines */ - - buf_flush_init_for_writing( - block, block->frame, - buf_block_get_page_zip(block), - mach_read_from_8(block->frame + FIL_PAGE_LSN), - fsp_is_checksum_disabled( - block->page.id.space())); - - if (page_size.is_compressed()) { - - error = fil_io( - IORequestWrite, true, page_id, - page_size, 0, page_size.physical(), - block->page.zip.data, NULL); - } else { - error = fil_io( - IORequestWrite, true, page_id, - page_size, 0, page_size.logical(), - block->frame, NULL); - } -skip_this_recv_addr: - recv_addr = static_cast<recv_addr_t*>(HASH_GET_NEXT( - addr_hash, recv_addr)); - } - - if ((100 * i) / n_hash_cells - != (100 * (i + 1)) / n_hash_cells) { - fprintf(stderr, "%lu ", - (ulint) ((100 * i) / n_hash_cells)); - fflush(stderr); - sd_notifyf(0, "STATUS=Applying batch of log records for" - " backup InnoDB: Progress %lu", - (ulint) (100 * i) / n_hash_cells); - } - } - - sd_notify(0, "STATUS=InnoDB: Apply batch for backup completed"); - - /* write logs in next line */ - fprintf(stderr, "\n"); - recv_sys->apply_log_recs = FALSE; - recv_sys->apply_batch_on = FALSE; - recv_sys_empty_hash(); -} -#endif /* !UNIV_HOTBACKUP */ /** Tries to parse a single log record. @param[out] type log record type @@ -3197,12 +2459,10 @@ recv_report_corrupt_log( - recv_previous_parsed_rec_offset); putc('\n', stderr); -#ifndef UNIV_HOTBACKUP if (!srv_force_recovery) { ib::info() << "Set innodb_force_recovery to ignore this error."; return(false); } -#endif /* !UNIV_HOTBACKUP */ ib::warn() << "The log file may have been corrupt and it is possible" " that the log scan did not proceed far enough in recovery!" @@ -3348,9 +2608,7 @@ loop: } recv_sys->mlog_checkpoint_lsn = recv_sys->recovered_lsn; -#ifndef UNIV_HOTBACKUP return(true); -#endif /* !UNIV_HOTBACKUP */ } break; case MLOG_FILE_NAME: @@ -3631,11 +2889,9 @@ recv_sys_justify_left_parsing_buf(void) recv_sys->recovered_offset = 0; } -/*******************************************************//** -Scans log from a buffer and stores new log data to the parsing buffer. -Parses and hashes the log records if new data found. Unless -UNIV_HOTBACKUP is defined, this function will apply log records -automatically when the hash table becomes full. +/** Scan redo log from a buffer and stores new log data to the parsing buffer. +Parse and hash the log records if new data found. +Apply log records automatically when the hash table becomes full. @return true if not able to scan any more in this log group */ static bool @@ -3766,7 +3022,6 @@ recv_scan_log_recs( of startup type, we must initiate crash recovery environment before parsing these log records. */ -#ifndef UNIV_HOTBACKUP if (!recv_needed_recovery) { if (!srv_read_only_mode) { @@ -3783,7 +3038,6 @@ recv_scan_log_recs( return(true); } } -#endif /* !UNIV_HOTBACKUP */ /* We were able to find more log data: add it to the parsing buffer if parse_start_lsn is already @@ -3796,7 +3050,6 @@ recv_scan_log_recs( recv_sys->found_corrupt_log = true; -#ifndef UNIV_HOTBACKUP if (!srv_force_recovery) { ib::error() << "Set innodb_force_recovery" @@ -3804,8 +3057,6 @@ recv_scan_log_recs( *err = DB_ERROR; return(true); } -#endif /* !UNIV_HOTBACKUP */ - } else if (!recv_sys->found_corrupt_log) { more_data = recv_sys_add_to_parsing_buf( log_block, scanned_lsn); @@ -3827,8 +3078,7 @@ recv_scan_log_recs( *group_scanned_lsn = scanned_lsn; - if (recv_needed_recovery - || (recv_is_from_backup && !recv_is_making_a_backup)) { + if (recv_needed_recovery) { recv_scan_print_counter++; if (finished || (recv_scan_print_counter % 80 == 0)) { @@ -3877,7 +3127,6 @@ recv_scan_log_recs( return(finished); } -#ifndef UNIV_HOTBACKUP /** Scans log from a buffer and stores new log data to the parsing buffer. Parses and hashes the log records if new data found. @param[in,out] group log group @@ -4129,7 +3378,6 @@ recv_recovery_from_checkpoint_start( ib_uint64_t checkpoint_no; lsn_t contiguous_lsn; byte* buf; - byte log_hdr_buf[LOG_FILE_HDR_SIZE]; dberr_t err = DB_SUCCESS; /* Initialize red-black tree for fast insertions into the @@ -4166,49 +3414,6 @@ recv_recovery_from_checkpoint_start( checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN); checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO); - /* Read the first log file header to print a note if this is - a recovery from a restored InnoDB Hot Backup */ - - const page_id_t page_id(max_cp_group->space_id, 0); - - fil_io(IORequestLogRead, true, page_id, univ_page_size, 0, - LOG_FILE_HDR_SIZE, log_hdr_buf, max_cp_group, NULL); - - if (0 == ut_memcmp(log_hdr_buf + LOG_HEADER_CREATOR, - (byte*)"ibbackup", (sizeof "ibbackup") - 1)) { - - if (srv_read_only_mode) { - log_mutex_exit(); - - ib::error() << "Cannot restore from mysqlbackup," - " InnoDB running in read-only mode!"; - - return(DB_ERROR); - } - - /* This log file was created by mysqlbackup --restore: print - a note to the user about it */ - - ib::info() << "The log file was created by mysqlbackup" - " --apply-log at " - << log_hdr_buf + LOG_HEADER_CREATOR - << ". The following crash recovery is part of a" - " normal restore."; - - /* Replace the label. */ - ut_ad(LOG_HEADER_CREATOR_END - LOG_HEADER_CREATOR - >= sizeof LOG_HEADER_CREATOR_CURRENT); - memset(log_hdr_buf + LOG_HEADER_CREATOR, 0, - LOG_HEADER_CREATOR_END - LOG_HEADER_CREATOR); - strcpy(reinterpret_cast<char*>(log_hdr_buf) - + LOG_HEADER_CREATOR, LOG_HEADER_CREATOR_CURRENT); - - /* Write to the log file to wipe over the label */ - fil_io(IORequestLogWrite, true, page_id, - univ_page_size, 0, OS_FILE_LOG_BLOCK_SIZE, log_hdr_buf, - max_cp_group, NULL); - } - /* Start reading the log groups from the checkpoint lsn up. The variable contiguous_lsn contains an lsn up to which the log is known to be contiguously written to all log groups. */ @@ -4578,100 +3783,6 @@ recv_reset_logs( log_mutex_enter(); } -#endif /* !UNIV_HOTBACKUP */ - -#ifdef UNIV_HOTBACKUP -/******************************************************//** -Creates new log files after a backup has been restored. */ -void -recv_reset_log_files_for_backup( -/*============================*/ - const char* log_dir, /*!< in: log file directory path */ - ulint n_log_files, /*!< in: number of log files */ - lsn_t log_file_size, /*!< in: log file size */ - lsn_t lsn) /*!< in: new start lsn, must be - divisible by OS_FILE_LOG_BLOCK_SIZE */ -{ - os_file_t log_file; - bool success; - byte* buf; - ulint i; - ulint log_dir_len; - char name[5000]; - static const char ib_logfile_basename[] = "ib_logfile"; - - log_dir_len = strlen(log_dir); - /* full path name of ib_logfile consists of log dir path + basename - + number. This must fit in the name buffer. - */ - ut_a(log_dir_len + strlen(ib_logfile_basename) + 11 < sizeof(name)); - - buf = (byte*)ut_zalloc_nokey(LOG_FILE_HDR_SIZE + - OS_FILE_LOG_BLOCK_SIZE); - - for (i = 0; i < n_log_files; i++) { - - sprintf(name, "%s%s%lu", log_dir, - ib_logfile_basename, (ulint) i); - - log_file = os_file_create_simple(innodb_log_file_key, - name, OS_FILE_CREATE, - OS_FILE_READ_WRITE, - srv_read_only_mode, &success); - if (!success) { - ib::fatal() << "Cannot create " << name << ". Check that" - " the file does not exist yet."; - } - - ib::info() << "Setting log file size to " << log_file_size; - - success = os_file_set_size( - name, log_file, log_file_size, srv_read_only_mode); - - if (!success) { - ib::fatal() << "Cannot set " << name << " size to " - << (long long unsigned)log_file_size; - } - - os_file_flush(log_file); - os_file_close(log_file); - } - - /* We pretend there is a checkpoint at lsn + LOG_BLOCK_HDR_SIZE */ - - log_reset_first_header_and_checkpoint(buf, lsn); - - log_block_init(buf + LOG_FILE_HDR_SIZE, lsn); - log_block_set_first_rec_group(buf + LOG_FILE_HDR_SIZE, - LOG_BLOCK_HDR_SIZE); - log_block_set_checksum(buf + LOG_FILE_HDR_SIZE, - log_block_calc_checksum_crc32(buf + LOG_FILE_HDR_SIZE)); - - log_block_set_checksum(buf, log_block_calc_checksum_crc32(buf)); - sprintf(name, "%s%s%lu", log_dir, ib_logfile_basename, (ulint)0); - - log_file = os_file_create_simple(innodb_log_file_key, - name, OS_FILE_OPEN, - OS_FILE_READ_WRITE, - srv_read_only_mode, &success); - if (!success) { - ib::fatal() << "Cannot open " << name << "."; - } - - IORequest request(IORequest::WRITE); - - dberr_t err = os_file_write( - request, name, log_file, buf, 0, - LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE); - - ut_a(err == DB_SUCCESS); - - os_file_flush(log_file); - os_file_close(log_file); - - ut_free(buf); -} -#endif /* UNIV_HOTBACKUP */ /** Find a doublewrite copy of a page. @param[in] space_id tablespace identifier diff --git a/storage/innobase/mem/mem0mem.cc b/storage/innobase/mem/mem0mem.cc index 41292ccf842..ff793821895 100644 --- a/storage/innobase/mem/mem0mem.cc +++ b/storage/innobase/mem/mem0mem.cc @@ -277,9 +277,7 @@ mem_heap_create_block_func( ulint type) /*!< in: type of heap: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */ { -#ifndef UNIV_HOTBACKUP buf_block_t* buf_block = NULL; -#endif /* !UNIV_HOTBACKUP */ mem_block_t* block; ulint len; @@ -294,7 +292,6 @@ mem_heap_create_block_func( /* In dynamic allocation, calculate the size: block header + data. */ len = MEM_BLOCK_HEADER_SIZE + MEM_SPACE_NEEDED(n); -#ifndef UNIV_HOTBACKUP if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) { ut_ad(type == MEM_HEAP_DYNAMIC || n <= MEM_MAX_ALLOC_IN_BUF); @@ -329,11 +326,6 @@ mem_heap_create_block_func( block->buf_block = buf_block; block->free_block = NULL; -#else /* !UNIV_HOTBACKUP */ - len = MEM_BLOCK_HEADER_SIZE + MEM_SPACE_NEEDED(n); - block = ut_malloc_nokey(len); - ut_ad(block); -#endif /* !UNIV_HOTBACKUP */ block->magic_n = MEM_BLOCK_MAGIC_N; ut_d(ut_strlcpy_rev(block->file_name, file_name, @@ -428,11 +420,9 @@ mem_heap_block_free( { ulint type; ulint len; -#ifndef UNIV_HOTBACKUP buf_block_t* buf_block; buf_block = static_cast<buf_block_t*>(block->buf_block); -#endif /* !UNIV_HOTBACKUP */ mem_block_validate(block); @@ -447,7 +437,6 @@ mem_heap_block_free( UNIV_MEM_ASSERT_W(block, len); -#ifndef UNIV_HOTBACKUP if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) { ut_ad(!buf_block); @@ -457,12 +446,8 @@ mem_heap_block_free( buf_block_free(buf_block); } -#else /* !UNIV_HOTBACKUP */ - ut_free(block); -#endif /* !UNIV_HOTBACKUP */ } -#ifndef UNIV_HOTBACKUP /******************************************************************//** Frees the free_block field from a memory heap. */ void @@ -477,4 +462,3 @@ mem_heap_free_block_free( heap->free_block = NULL; } } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/mtr/mtr0log.cc b/storage/innobase/mtr/mtr0log.cc index d653b3851c3..a63ad40a3b0 100644 --- a/storage/innobase/mtr/mtr0log.cc +++ b/storage/innobase/mtr/mtr0log.cc @@ -34,9 +34,7 @@ Created 12/7/1995 Heikki Tuuri #include "log0recv.h" #include "page0page.h" #include "buf0dblwr.h" - -#ifndef UNIV_HOTBACKUP -# include "dict0boot.h" +#include "dict0boot.h" /********************************************************//** Catenates n bytes to the mtr log. */ @@ -85,7 +83,6 @@ mlog_write_initial_log_record( mlog_close(mtr, log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /********************************************************//** Parses an initial log record written by mlog_write_initial_log_record. @@ -307,7 +304,6 @@ mlog_write_ull( } } -#ifndef UNIV_HOTBACKUP /********************************************************//** Writes a string to a file page buffered in the buffer pool. Writes the corresponding log record to the mini-transaction log. */ @@ -362,7 +358,6 @@ mlog_log_string( mlog_catenate_string(mtr, ptr, len); } -#endif /* !UNIV_HOTBACKUP */ /********************************************************//** Parses a log record written by mlog_write_string. @@ -414,7 +409,6 @@ mlog_parse_string( return(ptr + len); } -#ifndef UNIV_HOTBACKUP /********************************************************//** Opens a buffer for mlog, writes the initial log record and, if needed, the field lengths of an index. @@ -534,7 +528,6 @@ mlog_open_and_write_index( } return(log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /********************************************************//** Parses a log record written by mlog_open_and_write_index. diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 8e9139026d0..5755707d710 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -54,17 +54,8 @@ Created 10/21/1995 Heikki Tuuri #ifdef HAVE_LINUX_UNISTD_H #include "unistd.h" #endif -#ifndef UNIV_HOTBACKUP -# include "os0event.h" -# include "os0thread.h" -#else /* !UNIV_HOTBACKUP */ -# ifdef _WIN32 -/* Add includes for the _stat() call to compile on Windows */ -# include <sys/types.h> -# include <sys/stat.h> -# include <errno.h> -# endif /* _WIN32 */ -#endif /* !UNIV_HOTBACKUP */ +#include "os0event.h" +#include "os0thread.h" #include <vector> @@ -168,8 +159,6 @@ static DWORD fls_sync_io = FLS_OUT_OF_INDEXES; #define IOCP_SHUTDOWN_KEY (ULONG_PTR)-1 #endif /* _WIN32 */ -#ifndef UNIV_HOTBACKUP - /** In simulated aio, merge at most this many consecutive i/os */ static const ulint OS_AIO_MERGE_N_CONSECUTIVE = 64; @@ -749,7 +738,6 @@ static ulint os_aio_n_segments = ULINT_UNDEFINED; /** If the following is true, read i/o handler threads try to wait until a batch of new read requests have been posted */ static bool os_aio_recommend_sleep_for_read_threads = false; -#endif /* !UNIV_HOTBACKUP */ ulint os_n_file_reads = 0; ulint os_bytes_read_since_printout = 0; @@ -1453,7 +1441,6 @@ os_file_compress_page( #endif /* MYSQL_COMPRESSION */ #ifdef UNIV_DEBUG -# ifndef UNIV_HOTBACKUP /** Validates the consistency the aio system some of the time. @return true if ok or the check was skipped */ bool @@ -1479,16 +1466,12 @@ os_aio_validate_skip() os_aio_validate_count = OS_AIO_VALIDATE_SKIP; return(os_aio_validate()); } -# endif /* !UNIV_HOTBACKUP */ #endif /* UNIV_DEBUG */ #undef USE_FILE_LOCK -#define USE_FILE_LOCK -#if defined(UNIV_HOTBACKUP) || defined(_WIN32) -/* InnoDB Hot Backup does not lock the data files. - * On Windows, mandatory locking is used. - */ -# undef USE_FILE_LOCK +#ifndef _WIN32 +/* On Windows, mandatory locking is used */ +# define USE_FILE_LOCK #endif #ifdef USE_FILE_LOCK /** Obtain an exclusive lock on a file. @@ -1528,8 +1511,6 @@ os_file_lock( } #endif /* USE_FILE_LOCK */ -#ifndef UNIV_HOTBACKUP - /** Calculates local segment number and aio array from global segment number. @param[out] array aio wait array @param[in] segment global segment number @@ -1759,8 +1740,6 @@ os_file_io_complete( return(DB_SUCCESS); } -#endif /* !UNIV_HOTBACKUP */ - /** This function returns a new path name after replacing the basename in an old path with a new basename. The old_path is a full path name including the extension. The tablename is in the normal @@ -4067,18 +4046,6 @@ os_file_set_eof( return(!ftruncate(fileno(file), ftell(file))); } -#ifdef UNIV_HOTBACKUP -/** Closes a file handle. -@param[in] file Handle to a file -@return true if success */ -bool -os_file_close_no_error_handling( - os_file_t file) -{ - return(close(file) != -1); -} -#endif /* UNIV_HOTBACKUP */ - /** This function can be called if one wants to post a batch of reads and prefers an i/o-handler thread to handle them all at once later. You must call os_aio_simulated_wake_handler_threads later to ensure the threads @@ -4875,9 +4842,6 @@ os_file_create_func( DWORD attributes = 0; -#ifdef UNIV_HOTBACKUP - attributes |= FILE_FLAG_NO_BUFFERING; -#else if (purpose == OS_FILE_AIO) { #ifdef WIN_ASYNC_IO @@ -4917,7 +4881,6 @@ os_file_create_func( } #endif /* UNIV_NON_BUFFERED_IO */ -#endif /* UNIV_HOTBACKUP */ DWORD access = GENERIC_READ; if (!read_only) { @@ -5084,8 +5047,9 @@ os_file_delete_if_exists_func( } for (;;) { - /* In Windows, deleting an .ibd file may fail if ibbackup - is copying it */ + /* In Windows, deleting an .ibd file may fail if + the file is being accessed by an external program, + such as a backup tool. */ bool ret = DeleteFile((LPCTSTR) name); @@ -5136,8 +5100,9 @@ os_file_delete_func( ulint count = 0; for (;;) { - /* In Windows, deleting an .ibd file may fail if ibbackup - is copying it */ + /* In Windows, deleting an .ibd file may fail if + the file is being accessed by an external program, + such as a backup tool. */ BOOL ret = DeleteFile((LPCTSTR) name); @@ -5160,8 +5125,8 @@ os_file_delete_func( os_file_get_last_error(true); ib::warn() - << "Cannot delete file '" << name << "'. Are " - << "you running ibbackup to back up the file?"; + << "Cannot delete file '" << name << "'. Is " + << "another program accessing it?"; } /* sleep for a second */ @@ -5470,18 +5435,6 @@ os_file_set_eof( return(SetEndOfFile(h)); } -#ifdef UNIV_HOTBACKUP -/** Closes a file handle. -@param[in] file Handle to close -@return true if success */ -bool -os_file_close_no_error_handling( - os_file_t file) -{ - return(CloseHandle(file) ? true : false); -} -#endif /* UNIV_HOTBACKUP */ - /** This function can be called if one wants to post a batch of reads and prefers an i/o-handler thread to handle them all at once later. You must call os_aio_simulated_wake_handler_threads later to ensure the threads @@ -6136,21 +6089,8 @@ os_file_set_size( dberr_t err; IORequest request(IORequest::WRITE); -#ifdef UNIV_HOTBACKUP - err = os_file_write( request, name, file, buf, current_size, n_bytes); -#else - /* Using OS_AIO_SYNC mode on POSIX systems will result in - fall back to os_file_write/read. On Windows it will use - special mechanism to wait before it returns back. */ - - err = os_aio( - request, - OS_AIO_SYNC, name, - file, buf, current_size, n_bytes, - read_only, NULL, NULL, NULL); -#endif /* UNIV_HOTBACKUP */ if (err != DB_SUCCESS) { diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc index 0ee789df7b9..fd88fafa69d 100644 --- a/storage/innobase/os/os0thread.cc +++ b/storage/innobase/os/os0thread.cc @@ -32,10 +32,8 @@ Created 9/8/1995 Heikki Tuuri #include "os0thread.ic" #endif -#ifndef UNIV_HOTBACKUP #include "srv0srv.h" #include "os0event.h" - #include <map> /** Mutex that tracks the thread count. Used by innorwlocktest.cc @@ -208,7 +206,6 @@ os_thread_yield(void) sched_yield(); #endif } -#endif /* !UNIV_HOTBACKUP */ /*****************************************************************//** The thread sleeps at least the time given in microseconds. */ diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 87c28872462..b32e8deb6e6 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -35,7 +35,6 @@ Created 10/4/1994 Heikki Tuuri #include "btr0btr.h" #include "mtr0log.h" #include "log0recv.h" -#ifndef UNIV_HOTBACKUP #include "rem0cmp.h" #include "gis0rtree.h" @@ -1027,9 +1026,6 @@ need_extra_info: mlog_catenate_string(mtr, ins_ptr, rec_size); } } -#else /* !UNIV_HOTBACKUP */ -# define page_cur_insert_rec_write_log(ins_rec,size,cur,index,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a log record of a record insert on a page. @@ -1919,7 +1915,6 @@ use_heap: return(insert_rec); } -#ifndef UNIV_HOTBACKUP /**********************************************************//** Writes a log record of copying a record list end to a new created page. @return 4-byte field where to write the log data length, or NULL if @@ -1947,7 +1942,6 @@ page_copy_rec_list_to_created_page_write_log( return(log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************//** Parses a log record of copying a record list end to a new created page. @@ -2007,7 +2001,6 @@ page_parse_copy_rec_list_to_created_page( return(rec_end); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Copies records from page to a newly created page, from a given record onward, including that record. Infimum and supremum records are not copied. @@ -2224,9 +2217,6 @@ page_cur_delete_rec_write_log( mlog_close(mtr, log_ptr + 2); } -#else /* !UNIV_HOTBACKUP */ -# define page_cur_delete_rec_write_log(rec,index,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses log record of a record delete on a page. diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index 9bcc28f5980..5f330b9e071 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -34,12 +34,10 @@ Created 2/2/1994 Heikki Tuuri #include "buf0buf.h" #include "btr0btr.h" #include "row0trunc.h" -#ifndef UNIV_HOTBACKUP -# include "srv0srv.h" -# include "lock0lock.h" -# include "fut0lst.h" -# include "btr0sea.h" -#endif /* !UNIV_HOTBACKUP */ +#include "srv0srv.h" +#include "lock0lock.h" +#include "fut0lst.h" +#include "btr0sea.h" /* THE INDEX PAGE ============== @@ -205,9 +203,7 @@ page_set_max_trx_id( mtr_t* mtr) /*!< in/out: mini-transaction, or NULL */ { page_t* page = buf_block_get_frame(block); -#ifndef UNIV_HOTBACKUP ut_ad(!mtr || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); -#endif /* !UNIV_HOTBACKUP */ /* It is not necessary to write this change to the redo log, as during a database recovery we assume that the max trx id of every @@ -218,11 +214,9 @@ page_set_max_trx_id( page_zip_write_header(page_zip, page + (PAGE_HEADER + PAGE_MAX_TRX_ID), 8, mtr); -#ifndef UNIV_HOTBACKUP } else if (mtr) { mlog_write_ull(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), trx_id, mtr); -#endif /* !UNIV_HOTBACKUP */ } else { mach_write_to_8(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), trx_id); } @@ -299,7 +293,6 @@ page_mem_alloc_heap( return(NULL); } -#ifndef UNIV_HOTBACKUP /**********************************************************//** Writes a log record of page creation. */ UNIV_INLINE @@ -323,9 +316,6 @@ page_create_write_log( mlog_write_initial_log_record(frame, type, mtr); } -#else /* !UNIV_HOTBACKUP */ -# define page_create_write_log(frame,mtr,comp,is_rtree) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /** The page infimum and supremum of an empty page in ROW_FORMAT=REDUNDANT */ static const byte infimum_supremum_redundant[] = { @@ -638,7 +628,6 @@ page_copy_rec_list_end_no_locks( } } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Copies records from page to new_page, from a given record onward, including that record. Infimum and supremum records are not copied. @@ -978,9 +967,6 @@ page_delete_rec_list_write_log( mlog_close(mtr, log_ptr + 2); } } -#else /* !UNIV_HOTBACKUP */ -# define page_delete_rec_list_write_log(rec,index,type,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /**********************************************************//** Parses a log record of a record list end or start deletion. @@ -1324,7 +1310,6 @@ page_delete_rec_list_start( mtr_set_log_mode(mtr, log_mode); } -#ifndef UNIV_HOTBACKUP /*************************************************************//** Moves record list end to another page. Moved records include split_rec. @@ -1415,7 +1400,6 @@ page_move_rec_list_start( return(TRUE); } -#endif /* !UNIV_HOTBACKUP */ /**************************************************************//** Used to delete n slots from the directory. This function updates @@ -1741,7 +1725,6 @@ page_rec_get_n_recs_before( return((ulint) n); } -#ifndef UNIV_HOTBACKUP /************************************************************//** Prints record contents including the data relevant only in the index page context. */ @@ -1767,7 +1750,7 @@ page_rec_print( rec_validate(rec, offsets); } -# ifdef UNIV_BTR_PRINT +#ifdef UNIV_BTR_PRINT /***************************************************************//** This is used to print the contents of the directory for debugging purposes. */ @@ -1924,8 +1907,7 @@ page_print( page_dir_print(page, dn); page_print_list(block, index, rn); } -# endif /* UNIV_BTR_PRINT */ -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_BTR_PRINT */ /***************************************************************//** The following is used to validate a record on a page. This function @@ -1972,7 +1954,6 @@ page_rec_validate( return(TRUE); } -#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG /***************************************************************//** Checks that the first directory slot points to the infimum record and @@ -2005,7 +1986,6 @@ page_check_dir( } } #endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** This function checks the consistency of an index page when we do not @@ -2504,7 +2484,6 @@ page_validate( goto func_exit; } -#ifndef UNIV_HOTBACKUP /* Check that the records are in the ascending order */ if (count >= PAGE_HEAP_NO_USER_LOW && !page_rec_is_supremum(rec)) { @@ -2547,7 +2526,6 @@ page_validate( goto func_exit; } } -#endif /* !UNIV_HOTBACKUP */ if (page_rec_is_user_rec(rec)) { @@ -2711,7 +2689,6 @@ func_exit2: return(ret); } -#ifndef UNIV_HOTBACKUP /***************************************************************//** Looks in the page record list for a record with the given heap number. @return record, NULL if not found */ @@ -2757,7 +2734,6 @@ page_find_rec_with_heap_no( } } } -#endif /* !UNIV_HOTBACKUP */ /*******************************************************//** Removes the record from a leaf page. This function does not log diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 798aeeed74f..c47a1905b4b 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -49,32 +49,24 @@ const byte field_ref_zero[FIELD_REF_SIZE] = { #include "log0recv.h" #include "row0trunc.h" #include "zlib.h" -#ifndef UNIV_HOTBACKUP -# include "buf0buf.h" +#include "buf0buf.h" #include "buf0types.h" #include "buf0checksum.h" -# include "btr0sea.h" -# include "dict0boot.h" -# include "lock0lock.h" -# include "srv0srv.h" -# include "buf0lru.h" -# include "srv0mon.h" -# include "ut0crc32.h" -#else /* !UNIV_HOTBACKUP */ -# include "buf0checksum.h" -# define lock_move_reorganize_page(block, temp_block) ((void) 0) -# define buf_LRU_stat_inc_unzip() ((void) 0) -#endif /* !UNIV_HOTBACKUP */ +#include "btr0sea.h" +#include "dict0boot.h" +#include "lock0lock.h" +#include "srv0srv.h" +#include "buf0lru.h" +#include "srv0mon.h" +#include "ut0crc32.h" #include <map> #include <algorithm> -#ifndef UNIV_HOTBACKUP /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */ page_zip_stat_t page_zip_stat[PAGE_ZIP_SSIZE_MAX]; /** Statistics on compression, indexed by index->id */ page_zip_stat_per_index_t page_zip_stat_per_index; -#endif /* !UNIV_HOTBACKUP */ /* Compression level to be used by zlib. Settable by user. */ uint page_zip_level = DEFAULT_COMPRESSION_LEVEL; @@ -156,7 +148,6 @@ page_zip_fail_func( # define page_zip_fail(fmt_args) /* empty */ #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Determine the guaranteed free space on an empty page. @return minimum payload size on the page */ @@ -228,7 +219,6 @@ page_zip_is_too_big( return(false); } -#endif /* !UNIV_HOTBACKUP */ /*************************************************************//** Gets the number of elements in the dense page directory, @@ -384,7 +374,6 @@ page_zip_dir_get( - PAGE_ZIP_DIR_SLOT_SIZE * (slot + 1))); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Write a log record of compressing an index page. */ static @@ -448,7 +437,6 @@ page_zip_compress_write_log( mlog_catenate_string(mtr, page_zip->data + page_zip_get_size(page_zip) - trailer_size, trailer_size); } -#endif /* !UNIV_HOTBACKUP */ /******************************************************//** Determine how many externally stored columns are contained @@ -1290,9 +1278,7 @@ page_zip_compress( byte* storage; /* storage of uncompressed columns */ index_id_t ind_id; -#ifndef UNIV_HOTBACKUP uintmax_t usec = ut_time_us(NULL); -#endif /* !UNIV_HOTBACKUP */ #ifdef PAGE_ZIP_COMPRESS_DBG FILE* logfile = NULL; #endif @@ -1375,14 +1361,12 @@ page_zip_compress( } } #endif /* PAGE_ZIP_COMPRESS_DBG */ -#ifndef UNIV_HOTBACKUP page_zip_stat[page_zip->ssize - 1].compressed++; if (cmp_per_index_enabled) { mutex_enter(&page_zip_stat_per_index_mutex); page_zip_stat_per_index[ind_id].compressed++; mutex_exit(&page_zip_stat_per_index_mutex); } -#endif /* !UNIV_HOTBACKUP */ if (UNIV_UNLIKELY(n_dense * PAGE_ZIP_DIR_SLOT_SIZE >= page_zip_get_size(page_zip))) { @@ -1578,7 +1562,6 @@ err_exit: fclose(logfile); } #endif /* PAGE_ZIP_COMPRESS_DBG */ -#ifndef UNIV_HOTBACKUP if (page_is_leaf(page) && index) { dict_index_zip_failure(index); } @@ -1592,7 +1575,6 @@ err_exit: += time_diff; mutex_exit(&page_zip_stat_per_index_mutex); } -#endif /* !UNIV_HOTBACKUP */ return(FALSE); } @@ -1633,9 +1615,7 @@ err_exit: #endif /* UNIV_ZIP_DEBUG */ if (mtr) { -#ifndef UNIV_HOTBACKUP page_zip_compress_write_log(page_zip, page, index, mtr); -#endif /* !UNIV_HOTBACKUP */ } UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); @@ -1652,7 +1632,6 @@ err_exit: fclose(logfile); } #endif /* PAGE_ZIP_COMPRESS_DBG */ -#ifndef UNIV_HOTBACKUP uintmax_t time_diff = ut_time_us(NULL) - usec; page_zip_stat[page_zip->ssize - 1].compressed_ok++; page_zip_stat[page_zip->ssize - 1].compressed_usec += time_diff; @@ -1666,7 +1645,6 @@ err_exit: if (page_is_leaf(page) && !truncate_t::s_fix_up_active) { dict_index_zip_success(index); } -#endif /* !UNIV_HOTBACKUP */ return(TRUE); } @@ -3277,15 +3255,12 @@ page_zip_decompress( page header fields that should not change after page creation */ { -#ifndef UNIV_HOTBACKUP uintmax_t usec = ut_time_us(NULL); -#endif /* !UNIV_HOTBACKUP */ if (!page_zip_decompress_low(page_zip, page, all)) { return(FALSE); } -#ifndef UNIV_HOTBACKUP uintmax_t time_diff = ut_time_us(NULL) - usec; page_zip_stat[page_zip->ssize - 1].decompressed++; page_zip_stat[page_zip->ssize - 1].decompressed_usec += time_diff; @@ -3298,7 +3273,6 @@ page_zip_decompress( page_zip_stat_per_index[index_id].decompressed_usec += time_diff; mutex_exit(&page_zip_stat_per_index_mutex); } -#endif /* !UNIV_HOTBACKUP */ /* Update the stat counter for LRU policy. */ buf_LRU_stat_inc_unzip(); @@ -4013,7 +3987,6 @@ page_zip_write_blob_ptr( #endif /* UNIV_ZIP_DEBUG */ if (mtr) { -#ifndef UNIV_HOTBACKUP byte* log_ptr = mlog_open( mtr, 11 + 2 + 2 + BTR_EXTERN_FIELD_REF_SIZE); if (UNIV_UNLIKELY(!log_ptr)) { @@ -4029,7 +4002,6 @@ page_zip_write_blob_ptr( memcpy(log_ptr, externs, BTR_EXTERN_FIELD_REF_SIZE); log_ptr += BTR_EXTERN_FIELD_REF_SIZE; mlog_close(mtr, log_ptr); -#endif /* !UNIV_HOTBACKUP */ } } @@ -4153,7 +4125,6 @@ page_zip_write_node_ptr( memcpy(storage, field, REC_NODE_PTR_SIZE); if (mtr) { -#ifndef UNIV_HOTBACKUP byte* log_ptr = mlog_open(mtr, 11 + 2 + 2 + REC_NODE_PTR_SIZE); if (UNIV_UNLIKELY(!log_ptr)) { @@ -4169,7 +4140,6 @@ page_zip_write_node_ptr( memcpy(log_ptr, field, REC_NODE_PTR_SIZE); log_ptr += REC_NODE_PTR_SIZE; mlog_close(mtr, log_ptr); -#endif /* !UNIV_HOTBACKUP */ } } @@ -4654,7 +4624,6 @@ corrupt: return(ptr + len); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Write a log record of writing to the uncompressed header portion of a page. */ void @@ -4688,7 +4657,6 @@ page_zip_write_header_log( mlog_catenate_string(mtr, data, length); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Reorganize and compress a page. This is a low-level operation for @@ -4711,9 +4679,7 @@ 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; @@ -4729,13 +4695,8 @@ page_zip_reorganize( /* Disable logging */ mtr_log_t log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE); -#ifndef UNIV_HOTBACKUP temp_block = buf_block_alloc(buf_pool); btr_search_drop_page_hash_index(block); -#else /* !UNIV_HOTBACKUP */ - ut_ad(block == back_block1); - temp_block = back_block2; -#endif /* !UNIV_HOTBACKUP */ temp_page = temp_block->frame; /* Copy the old page to temporary space */ @@ -4773,21 +4734,16 @@ page_zip_reorganize( if (!page_zip_compress(page_zip, page, index, page_zip_level, NULL, mtr)) { -#ifndef UNIV_HOTBACKUP buf_block_free(temp_block); -#endif /* !UNIV_HOTBACKUP */ return(FALSE); } lock_move_reorganize_page(block, temp_block); -#ifndef UNIV_HOTBACKUP buf_block_free(temp_block); -#endif /* !UNIV_HOTBACKUP */ return(TRUE); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Copy the records of a page byte for byte. Do not copy the page header or trailer, except those B-tree header fields that are directly @@ -4885,7 +4841,6 @@ page_zip_copy_recs( #endif /* UNIV_ZIP_DEBUG */ page_zip_compress_write_log(page_zip, page, index, mtr); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Parses a log record of compressing an index page. diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index d055aa5d84e..920fdb62079 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -1503,7 +1503,6 @@ rec_convert_dtuple_to_rec( return(rec); } -#ifndef UNIV_HOTBACKUP /**********************************************************//** Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. @return total size */ @@ -1763,7 +1762,6 @@ rec_copy_prefix_to_buf( return(*buf + (rec - (lens + 1))); } -#endif /* UNIV_HOTBACKUP */ /***************************************************************//** Validates the consistency of an old-style physical record. @@ -1930,7 +1928,6 @@ rec_print_old( rec_validate_old(rec); } -#ifndef UNIV_HOTBACKUP /***************************************************************//** Prints a physical record in ROW_FORMAT=COMPACT. Ignores the record header. */ @@ -2268,7 +2265,7 @@ operator<<(std::ostream& o, const rec_offsets_print& r) return(o); } -# ifdef UNIV_DEBUG +#ifdef UNIV_DEBUG /************************************************************//** Reads the DB_TRX_ID of a clustered index record. @return the value of DB_TRX_ID */ @@ -2308,8 +2305,7 @@ rec_get_trx_id( return(trx_read_trx_id(trx_id)); } -# endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ +#endif /* UNIV_DEBUG */ /** Mark the nth field as externally stored. @param[in] offsets array returned by rec_get_offsets() diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 2a990904242..3f7c795230a 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -36,7 +36,6 @@ Created 12/27/1996 Heikki Tuuri #include "dict0mem.h" #include "trx0undo.h" #include "rem0rec.h" -#ifndef UNIV_HOTBACKUP #include "dict0boot.h" #include "dict0crea.h" #include "mach0data.h" @@ -58,7 +57,6 @@ Created 12/27/1996 Heikki Tuuri #include "fts0fts.h" #include "fts0types.h" #include <algorithm> - #include <mysql/plugin.h> #include <mysql/service_wsrep.h> @@ -127,7 +125,6 @@ row_upd_changes_first_fields_binary( const upd_t* update, /*!< in: update vector for the row */ ulint n); /*!< in: how many first fields to check */ - /*********************************************************************//** Checks if index currently is mentioned as a referenced index in a foreign key constraint. @@ -454,7 +451,6 @@ upd_node_create( return(node); } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Updates the trx id and roll ptr field in a clustered index record in database @@ -488,7 +484,6 @@ row_upd_rec_sys_fields_in_recovery( } } -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Sets the trx id or roll ptr field of a clustered index entry. */ void @@ -633,7 +628,6 @@ row_upd_changes_disowned_external( return(false); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Replaces the new column values stored in the update vector to the @@ -689,7 +683,6 @@ row_upd_rec_in_place( } } -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Writes into the redo log the values of trx id and roll ptr and enough info to determine their positions within a clustered index record. @@ -718,7 +711,6 @@ row_upd_write_sys_vals_to_log( return(log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Parses the log data of system field values. @@ -752,7 +744,6 @@ row_upd_parse_sys_vals( return(const_cast<byte*>(ptr)); } -#ifndef UNIV_HOTBACKUP /***********************************************************//** Writes to the redo log the new values of the fields occurring in the index. */ void @@ -830,7 +821,6 @@ row_upd_index_write_log( mlog_close(mtr, log_ptr); } -#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Parses the log data written by row_upd_index_write_log. @@ -917,7 +907,6 @@ row_upd_index_parse( return(const_cast<byte*>(ptr)); } -#ifndef UNIV_HOTBACKUP /***************************************************************//** Builds an update vector from those fields which in a secondary index entry differ from a record that has the equal ordering fields. NOTE: we compare @@ -2224,7 +2213,6 @@ srv_mbr_print(const byte* data) << ", " << d << "\n"; } - /***********************************************************//** Updates a secondary index entry of a row. @return DB_SUCCESS if operation successfully completed, else error @@ -2400,7 +2388,6 @@ row_upd_sec_index_entry( case ROW_FOUND: ut_ad(err == DB_SUCCESS); - /* Delete mark the old index record; it can already be delete marked if we return after a lock wait in row_ins_sec_index_entry() below */ @@ -3511,4 +3498,3 @@ void upd_node_t::dbug_trace() DBUG_VOID_RETURN; } #endif /* !DBUG_OFF */ -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index b2d0fc852e5..00b7bd14c98 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -25,7 +25,6 @@ Database monitor counter interfaces Created 12/9/2009 Jimmy Yang *******************************************************/ -#ifndef UNIV_HOTBACKUP #include "buf0buf.h" #include "dict0mem.h" #include "ibuf0ibuf.h" @@ -54,7 +53,6 @@ Created 12/9/2009 Jimmy Yang #define MONITOR_BUF_PAGE_WRITTEN(name, description, code) \ MONITOR_BUF_PAGE(name, description, code, "written", PAGE_WRITTEN) - /** This array defines basic static information of monitor counters, including each monitor's name, module it belongs to, a short description and its property/type and corresponding monitor_id. @@ -2250,4 +2248,3 @@ srv_mon_default_on(void) } } } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 73c81227537..e6bf117c673 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -76,42 +76,39 @@ Created 2/16/1996 Heikki Tuuri #include "srv0start.h" #include "srv0srv.h" #include "btr0defragment.h" - #include "fsp0sysspace.h" #include "row0trunc.h" #include <mysql/service_wsrep.h> - -#ifndef UNIV_HOTBACKUP -# include "trx0rseg.h" -# include "os0proc.h" -# include "buf0flu.h" -# include "buf0rea.h" -# include "buf0mtflu.h" -# include "dict0boot.h" -# include "dict0load.h" -# include "dict0stats_bg.h" -# include "que0que.h" -# include "usr0sess.h" -# include "lock0lock.h" -# include "trx0roll.h" -# include "trx0purge.h" -# include "lock0lock.h" -# include "pars0pars.h" -# include "btr0sea.h" -# include "rem0cmp.h" -# include "dict0crea.h" -# include "row0ins.h" -# include "row0sel.h" -# include "row0upd.h" -# include "row0row.h" -# include "row0mysql.h" -# include "row0trunc.h" -# include "btr0pcur.h" -# include "os0event.h" -# include "zlib.h" -# include "ut0crc32.h" -# include "btr0scrub.h" -# include "ut0new.h" +#include "trx0rseg.h" +#include "os0proc.h" +#include "buf0flu.h" +#include "buf0rea.h" +#include "buf0mtflu.h" +#include "dict0boot.h" +#include "dict0load.h" +#include "dict0stats_bg.h" +#include "que0que.h" +#include "usr0sess.h" +#include "lock0lock.h" +#include "trx0roll.h" +#include "trx0purge.h" +#include "lock0lock.h" +#include "pars0pars.h" +#include "btr0sea.h" +#include "rem0cmp.h" +#include "dict0crea.h" +#include "row0ins.h" +#include "row0sel.h" +#include "row0upd.h" +#include "row0row.h" +#include "row0mysql.h" +#include "row0trunc.h" +#include "btr0pcur.h" +#include "os0event.h" +#include "zlib.h" +#include "ut0crc32.h" +#include "btr0scrub.h" +#include "ut0new.h" #ifdef HAVE_LZO1X #include <lzo/lzo1x.h> @@ -190,7 +187,6 @@ static bool dict_stats_thread_started = false; static bool buf_flush_page_cleaner_thread_started = false; /** Name of srv_monitor_file */ static char* srv_monitor_file_name; -#endif /* !UNIV_HOTBACKUP */ /** Minimum expected tablespace size. (10M) */ static const ulint MIN_EXPECTED_TABLESPACE_SIZE = 5 * 1024 * 1024; @@ -282,7 +278,6 @@ srv_file_check_mode( return(true); } -#ifndef UNIV_HOTBACKUP /********************************************************************//** I/o-handler thread function. @return OS_THREAD_DUMMY_RETURN */ @@ -341,9 +336,7 @@ DECLARE_THREAD(io_handler_thread)( OS_THREAD_DUMMY_RETURN; } -#endif /* !UNIV_HOTBACKUP */ -#ifndef UNIV_HOTBACKUP /*********************************************************************//** Creates a log file. @return DB_SUCCESS or error code */ @@ -1692,7 +1685,6 @@ innobase_start_or_create_for_mysql(void) ib::info() << ut_crc32_implementation; - if (!srv_read_only_mode) { mutex_create(LATCH_ID_SRV_MONITOR_FILE, @@ -2746,7 +2738,6 @@ srv_fts_close(void) } #endif - /****************************************************************//** Shuts down background threads that can generate undo pages. */ void @@ -2757,7 +2748,6 @@ srv_shutdown_bg_undo_sources(void) dict_stats_shutdown(); } - /****************************************************************//** Shuts down the InnoDB database. @return DB_SUCCESS or error code */ @@ -2884,8 +2874,6 @@ innobase_shutdown_for_mysql(void) return(DB_SUCCESS); } -#endif /* !UNIV_HOTBACKUP */ - /******************************************************************** Signal all per-table background threads to shutdown, and wait for them to do diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index b99ce22823b..25807e7f825 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -33,7 +33,6 @@ Created 3/26/1996 Heikki Tuuri #include "mach0data.h" #include "trx0undo.h" #include "mtr0log.h" -#ifndef UNIV_HOTBACKUP #include "dict0dict.h" #include "ut0mem.h" #include "read0read.h" @@ -87,7 +86,6 @@ trx_undof_page_add_undo_rec_log( mlog_catenate_string(mtr, undo_page + old_free + 2, len); } } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses a redo log record of adding an undo log record. @@ -135,7 +133,6 @@ trx_undo_parse_add_undo_rec( return(ptr + len); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Calculates the free space left for extending an undo log record. @return bytes left */ @@ -1245,7 +1242,6 @@ trx_undo_page_report_modify( ut_a(prefix_len < sizeof ext_buf); - spatial_status = dict_col_get_spatial_status( col); @@ -1791,7 +1787,6 @@ trx_undo_rec_get_partial_row( return(const_cast<byte*>(ptr)); } -#endif /* !UNIV_HOTBACKUP */ /***********************************************************************//** Erases the unused undo log page end. @@ -1838,7 +1833,6 @@ trx_undo_parse_erase_page_end( return(ptr); } -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Writes information to an undo log about an insert, update, or a delete marking of a clustered index record. This information is used in a rollback of the @@ -2223,8 +2217,6 @@ trx_undo_prev_version_build( /*!< in: status determine if it is going into this function by purge thread or not. And if we read "after image" of undo log */ - - { trx_undo_rec_t* undo_rec = NULL; dtuple_t* entry; @@ -2411,7 +2403,6 @@ trx_undo_prev_version_build( v_status & TRX_UNDO_PREV_IN_PURGE, NULL); } - return(true); } @@ -2495,4 +2486,3 @@ trx_undo_read_v_cols( ut_ad(ptr == end_ptr); } -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 0dd5e0a6335..724139461d3 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -32,10 +32,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0sys.ic" #endif -#ifdef UNIV_HOTBACKUP -#include "fsp0types.h" - -#else /* !UNIV_HOTBACKUP */ #include "fsp0fsp.h" #include "mtr0log.h" #include "mtr0log.h" @@ -64,7 +60,6 @@ struct file_format_t { /** The transaction system */ trx_sys_t* trx_sys = NULL; -#endif /* !UNIV_HOTBACKUP */ /** List of animal names representing file format. */ static const char* file_format_name_map[] = { @@ -134,7 +129,6 @@ ReadView::check_trx_id_sanity( } } -#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ uint trx_rseg_n_slots_debug = 0; @@ -1076,208 +1070,6 @@ trx_sys_create_rsegs( return(n_used); } -#else /* !UNIV_HOTBACKUP */ -/*****************************************************************//** -Prints to stderr the MySQL binlog info in the system header if the -magic number shows it valid. */ -void -trx_sys_print_mysql_binlog_offset_from_page( -/*========================================*/ - const byte* page) /*!< in: buffer containing the trx - system header page, i.e., page number - TRX_SYS_PAGE_NO in the tablespace */ -{ - const trx_sysf_t* sys_header; - - sys_header = page + TRX_SYS; - - if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD) - == TRX_SYS_MYSQL_LOG_MAGIC_N) { - - ib::info() << "mysqlbackup: Last MySQL binlog file position " - << mach_read_from_4( - sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_HIGH) << " " - << mach_read_from_4( - sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_LOW) - << ", file name " << sys_header - + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME; - } -} - -/*****************************************************************//** -Reads the file format id from the first system table space file. -Even if the call succeeds and returns TRUE, the returned format id -may be ULINT_UNDEFINED signalling that the format id was not present -in the data file. -@return TRUE if call succeeds */ -ibool -trx_sys_read_file_format_id( -/*========================*/ - const char *pathname, /*!< in: pathname of the first system - table space file */ - ulint *format_id) /*!< out: file format of the system table - space */ -{ - os_file_t file; - bool success; - byte buf[UNIV_PAGE_SIZE * 2]; - page_t* page = ut_align(buf, UNIV_PAGE_SIZE); - const byte* ptr; - ib_id_t file_format_id; - - *format_id = ULINT_UNDEFINED; - - file = os_file_create_simple_no_error_handling( - innodb_data_file_key, - pathname, - OS_FILE_OPEN, - OS_FILE_READ_ONLY, - srv_read_only_mode, - &success - ); - if (!success) { - /* The following call prints an error message */ - os_file_get_last_error(true); - - ib::error() << "mysqlbackup: Error: trying to read system" - " tablespace file format, but could not open the" - " tablespace file " << pathname << "!"; - return(FALSE); - } - - /* Read the page on which file format is stored */ - - IORequest read_req(IORequest::READ) - - dberr_t err = os_file_read_no_error_handling( - read_req, file, page, TRX_SYS_PAGE_NO * UNIV_PAGE_SIZE, - UNIV_PAGE_SIZE, NULL); - - if (err != DB_SUCCESS) { - /* The following call prints an error message */ - os_file_get_last_error(true); - - ib::error() << "mysqlbackup: Error: trying to read system" - " tablespace file format, but failed to read the" - " tablespace file " << pathname << "!"; - - os_file_close(file); - return(FALSE); - } - os_file_close(file); - - /* get the file format from the page */ - ptr = page + TRX_SYS_FILE_FORMAT_TAG; - file_format_id = mach_read_from_8(ptr); - file_format_id -= TRX_SYS_FILE_FORMAT_TAG_MAGIC_N; - - if (file_format_id >= FILE_FORMAT_NAME_N) { - - /* Either it has never been tagged, or garbage in it. */ - return(TRUE); - } - - *format_id = (ulint) file_format_id; - - return(TRUE); -} - -/*****************************************************************//** -Reads the file format id from the given per-table data file. -@return TRUE if call succeeds */ -ibool -trx_sys_read_pertable_file_format_id( -/*=================================*/ - const char *pathname, /*!< in: pathname of a per-table - datafile */ - ulint *format_id) /*!< out: file format of the per-table - data file */ -{ - os_file_t file; - bool success; - byte buf[UNIV_PAGE_SIZE * 2]; - page_t* page = ut_align(buf, UNIV_PAGE_SIZE); - const byte* ptr; - ib_uint32_t flags; - - *format_id = ULINT_UNDEFINED; - - file = os_file_create_simple_no_error_handling( - innodb_data_file_key, - pathname, - OS_FILE_OPEN, - OS_FILE_READ_ONLY, - srv_read_only_mode, - &success - ); - if (!success) { - /* The following call prints an error message */ - os_file_get_last_error(true); - - ib::error() << "mysqlbackup: Error: trying to read per-table" - " tablespace format, but could not open the tablespace" - " file " << pathname << "!"; - - return(FALSE); - } - - IORequest read_req(IORequest::READ); - - /* Read the first page of the per-table datafile */ - - dberr_t err = os_file_read_no_error_handling( - read_req, file, page, 0, UNIV_PAGE_SIZE, NULL); - - if (err != DB_SUCCESS) { - /* The following call prints an error message */ - os_file_get_last_error(true); - - ib::error() << "mysqlbackup: Error: trying to per-table data" - " file format, but failed to read the tablespace file " - << pathname << "!"; - - os_file_close(file); - return(FALSE); - } - os_file_close(file); - - /* get the file format from the page */ - ptr = page + 54; - flags = mach_read_from_4(ptr); - - if (!fsp_flags_is_valid(flags) { - /* bad tablespace flags */ - return(FALSE); - } - - *format_id = FSP_FLAGS_GET_POST_ANTELOPE(flags); - - return(TRUE); -} - - -/*****************************************************************//** -Get the name representation of the file format from its id. -@return pointer to the name */ -const char* -trx_sys_file_format_id_to_name( -/*===========================*/ - const ulint id) /*!< in: id of the file format */ -{ - if (!(id < FILE_FORMAT_NAME_N)) { - /* unknown id */ - return("Unknown"); - } - - return(file_format_name_map[id]); -} - -#endif /* !UNIV_HOTBACKUP */ - -#ifndef UNIV_HOTBACKUP /********************************************************************* Shutdown/Close the transaction system. */ void @@ -1480,4 +1272,3 @@ trx_sys_validate_trx_list() return(true); } #endif /* UNIV_DEBUG */ -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index 932151b948d..be60b9b4aaa 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -32,7 +32,6 @@ Created 3/26/1996 Heikki Tuuri #endif #include "fsp0fsp.h" -#ifndef UNIV_HOTBACKUP #include "mach0data.h" #include "mtr0log.h" #include "srv0mon.h" @@ -97,7 +96,6 @@ it until a truncate operation occurs, which can remove undo logs from the end of the list and release undo log segments. In stepping through the list, s-latches on the undo log pages are enough, but in a truncate, x-latches must be obtained on the rollback segment and individual pages. */ -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Initializes the fields in an undo log segment page. */ @@ -109,7 +107,6 @@ trx_undo_page_init( ulint type, /*!< in: undo log segment type */ mtr_t* mtr); /*!< in: mtr */ -#ifndef UNIV_HOTBACKUP /********************************************************************//** Creates and initializes an undo log memory object. @return own: the undo log memory object */ @@ -126,7 +123,6 @@ trx_undo_mem_create( const XID* xid, /*!< in: X/Open XA transaction identification*/ ulint page_no,/*!< in: undo log header page number */ ulint offset);/*!< in: undo log header byte offset on page */ -#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** Initializes a cached insert undo log header page for new use. NOTE that this function has its own log record type MLOG_UNDO_HDR_REUSE. You must NOT change @@ -150,7 +146,6 @@ trx_undo_discard_latest_update_undo( page_t* undo_page, /*!< in: header page of an undo log of size 1 */ mtr_t* mtr); /*!< in: mtr */ -#ifndef UNIV_HOTBACKUP /***********************************************************************//** Gets the previous record in an undo log from the previous page. @return undo log record, the page s-latched, NULL if none */ @@ -374,9 +369,6 @@ trx_undo_page_init_log( mlog_catenate_ulint_compressed(mtr, type); } -#else /* !UNIV_HOTBACKUP */ -# define trx_undo_page_init_log(undo_page,type,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses the redo log entry of an undo log page initialization. @@ -431,7 +423,6 @@ trx_undo_page_init( trx_undo_page_init_log(undo_page, type, mtr); } -#ifndef UNIV_HOTBACKUP /***************************************************************//** Creates a new undo log segment in file. @return DB_SUCCESS if page creation OK possible error codes are: @@ -543,9 +534,6 @@ trx_undo_header_create_log( mlog_catenate_ull_compressed(mtr, trx_id); } -#else /* !UNIV_HOTBACKUP */ -# define trx_undo_header_create_log(undo_page,trx_id,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** Creates a new undo log header in file. NOTE that this function has its own @@ -621,7 +609,6 @@ trx_undo_header_create( return(free); } -#ifndef UNIV_HOTBACKUP /********************************************************************//** Write X/Open XA Transaction Identification (XID) to undo log header */ static @@ -722,9 +709,6 @@ trx_undo_insert_header_reuse_log( mlog_catenate_ull_compressed(mtr, trx_id); } -#else /* !UNIV_HOTBACKUP */ -# define trx_undo_insert_header_reuse_log(undo_page,trx_id,mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /** Parse the redo log entry of an undo log page header create or reuse. @param[in] type MLOG_UNDO_HDR_CREATE or MLOG_UNDO_HDR_REUSE @@ -820,7 +804,6 @@ trx_undo_insert_header_reuse( return(free); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Writes the redo log entry of an update undo log header discard. */ UNIV_INLINE @@ -832,9 +815,6 @@ trx_undo_discard_latest_log( { mlog_write_initial_log_record(undo_page, MLOG_UNDO_HDR_DISCARD, mtr); } -#else /* !UNIV_HOTBACKUP */ -# define trx_undo_discard_latest_log(undo_page, mtr) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /***********************************************************//** Parses the redo log entry of an undo log page header discard. @@ -898,7 +878,6 @@ trx_undo_discard_latest_update_undo( trx_undo_discard_latest_log(undo_page, mtr); } -#ifndef UNIV_HOTBACKUP /********************************************************************//** Tries to add a page to the undo log segment where the undo log is placed. @return X-latched block if success, else NULL */ @@ -2176,5 +2155,3 @@ trx_undo_truncate_tablespace( return(success); } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/ut/ut0dbg.cc b/storage/innobase/ut/ut0dbg.cc index bcf9d5fd1b5..ed4a7778afa 100644 --- a/storage/innobase/ut/ut0dbg.cc +++ b/storage/innobase/ut/ut0dbg.cc @@ -37,16 +37,8 @@ ut_dbg_assertion_failed( ulint line) /*!< in: line number of the assertion */ { ut_print_timestamp(stderr); -#ifdef UNIV_HOTBACKUP fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n", file, line); -#else /* UNIV_HOTBACKUP */ - fprintf(stderr, - " InnoDB: Assertion failure in thread " ULINTPF - " in file %s line " ULINTPF "\n", - os_thread_pf(os_thread_get_curr_id()), - innobase_basename(file), line); -#endif /* UNIV_HOTBACKUP */ if (expr) { fprintf(stderr, "InnoDB: Failing assertion: %s\n", expr); diff --git a/storage/innobase/ut/ut0mem.cc b/storage/innobase/ut/ut0mem.cc index 0ad251be157..39b86568aa3 100644 --- a/storage/innobase/ut/ut0mem.cc +++ b/storage/innobase/ut/ut0mem.cc @@ -29,11 +29,9 @@ Created 5/11/1994 Heikki Tuuri #include "ut0mem.ic" #endif -#ifndef UNIV_HOTBACKUP -# include "os0thread.h" -# include "srv0srv.h" -# include <stdlib.h> -#endif /* !UNIV_HOTBACKUP */ +#include "os0thread.h" +#include "srv0srv.h" +#include <stdlib.h> /**********************************************************************//** Copies up to size - 1 characters from the NUL-terminated string src to @@ -81,7 +79,6 @@ ut_strlcpy_rev( return(src_size); } -#ifndef UNIV_HOTBACKUP /**********************************************************************//** Return the number of times s2 occurs in s1. Overlapping instances of s2 are only counted once. @@ -199,5 +196,3 @@ ut_strreplace( return(new_str); } - -#endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc index cc315148a90..8dc6fb0bbe6 100644 --- a/storage/innobase/ut/ut0ut.cc +++ b/storage/innobase/ut/ut0ut.cc @@ -30,23 +30,14 @@ Created 5/11/1994 Heikki Tuuri #endif #ifndef UNIV_INNOCHECKSUM - -#ifndef UNIV_HOTBACKUP -# include <mysql_com.h> -#endif /* !UNIV_HOTBACKUP */ - +#include <mysql_com.h> #include "os0thread.h" #include "ut0ut.h" - #ifdef UNIV_NONINL #include "ut0ut.ic" #endif - -#ifndef UNIV_HOTBACKUP -# include "trx0trx.h" -#endif /* !UNIV_HOTBACKUP */ - -# include <string> +#include "trx0trx.h" +#include <string> #include "log.h" /** A constant to prevent the compiler from optimizing ut_delay() away. */ @@ -113,7 +104,7 @@ ut_time(void) return(time(NULL)); } -#ifndef UNIV_HOTBACKUP + /**********************************************************//** Returns system time. Upon successful completion, the value 0 is returned; otherwise the @@ -193,7 +184,6 @@ ut_time_ms(void) return((ulint) tv.tv_sec * 1000 + tv.tv_usec / 1000); } -#endif /* !UNIV_HOTBACKUP */ /**********************************************************//** Returns the difference of two times in seconds. @@ -293,78 +283,6 @@ ut_sprintf_timestamp( #endif } -#ifdef UNIV_HOTBACKUP -/**********************************************************//** -Sprintfs a timestamp to a buffer with no spaces and with ':' characters -replaced by '_'. */ -void -ut_sprintf_timestamp_without_extra_chars( -/*=====================================*/ - char* buf) /*!< in: buffer where to sprintf */ -{ -#ifdef _WIN32 - SYSTEMTIME cal_tm; - - GetLocalTime(&cal_tm); - - sprintf(buf, "%02d%02d%02d_%2d_%02d_%02d", - (int) cal_tm.wYear % 100, - (int) cal_tm.wMonth, - (int) cal_tm.wDay, - (int) cal_tm.wHour, - (int) cal_tm.wMinute, - (int) cal_tm.wSecond); -#else - struct tm* cal_tm_ptr; - time_t tm; - - struct tm cal_tm; - time(&tm); - localtime_r(&tm, &cal_tm); - cal_tm_ptr = &cal_tm; - sprintf(buf, "%02d%02d%02d_%2d_%02d_%02d", - cal_tm_ptr->tm_year % 100, - cal_tm_ptr->tm_mon + 1, - cal_tm_ptr->tm_mday, - cal_tm_ptr->tm_hour, - cal_tm_ptr->tm_min, - cal_tm_ptr->tm_sec); -#endif -} - -/**********************************************************//** -Returns current year, month, day. */ -void -ut_get_year_month_day( -/*==================*/ - ulint* year, /*!< out: current year */ - ulint* month, /*!< out: month */ - ulint* day) /*!< out: day */ -{ -#ifdef _WIN32 - SYSTEMTIME cal_tm; - - GetLocalTime(&cal_tm); - - *year = (ulint) cal_tm.wYear; - *month = (ulint) cal_tm.wMonth; - *day = (ulint) cal_tm.wDay; -#else - struct tm* cal_tm_ptr; - time_t tm; - - struct tm cal_tm; - time(&tm); - localtime_r(&tm, &cal_tm); - cal_tm_ptr = &cal_tm; - *year = (ulint) cal_tm_ptr->tm_year + 1900; - *month = (ulint) cal_tm_ptr->tm_mon + 1; - *day = (ulint) cal_tm_ptr->tm_mday; -#endif -} - -#else /* UNIV_HOTBACKUP */ - /*************************************************************//** Runs an idle loop on CPU. The argument gives the desired delay in microseconds on 100 MHz Pentium + Visual C++. @@ -390,7 +308,6 @@ ut_delay( return(j); } -#endif /* UNIV_HOTBACKUP */ /*************************************************************//** Prints the contents of a memory buffer in hex and ascii. */ @@ -495,7 +412,6 @@ ut_2_power_up( return(res); } -#ifndef UNIV_HOTBACKUP /** Get a fixed-length string, quoted as an SQL identifier. If the string contains a slash '/', the string will be output as two identifiers separated by a period (.), @@ -614,7 +530,6 @@ ut_copy_file( } } while (len > 0); } -#endif /* !UNIV_HOTBACKUP */ #ifdef _WIN32 # include <stdarg.h> |