summaryrefslogtreecommitdiff
path: root/storage/innobase/trx
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2016-12-30 15:04:10 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2016-12-30 16:05:42 +0200
commit63574f1275eda0f0ed439f4896b6e7daf6832a8f (patch)
treeaead50be1af894234be2be8d06c341e328bf8636 /storage/innobase/trx
parent9ebd76733198578e0ac8ca854d667ab114b3d581 (diff)
downloadmariadb-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/trx')
-rw-r--r--storage/innobase/trx/trx0rec.cc10
-rw-r--r--storage/innobase/trx/trx0sys.cc209
-rw-r--r--storage/innobase/trx/trx0undo.cc23
3 files changed, 0 insertions, 242 deletions
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 */