branches/zip: Remove unneeded definitions and dependencies

from UNIV_HOTBACKUP builds.
This commit is contained in:
marko 2009-03-23 14:21:34 +00:00
parent b507d3d35f
commit d90bea085a
87 changed files with 997 additions and 349 deletions

View file

@ -31,6 +31,8 @@ Created 6/2/1994 Heikki Tuuri
#include "fsp0fsp.h"
#include "page0page.h"
#include "page0zip.h"
#ifndef UNIV_HOTBACKUP
#include "btr0cur.h"
#include "btr0sea.h"
#include "btr0pcur.h"
@ -921,6 +923,7 @@ btr_free_root(
while (!fseg_free_step(header, mtr));
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Reorganizes an index page. */
@ -956,29 +959,39 @@ btr_page_reorganize_low(
data_size1 = page_get_data_size(page);
max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1);
#ifndef UNIV_HOTBACKUP
/* Write the log record */
mlog_open_and_write_index(mtr, page, index, page_is_comp(page)
? MLOG_COMP_PAGE_REORGANIZE
: MLOG_PAGE_REORGANIZE, 0);
#endif /* !UNIV_HOTBACKUP */
/* Turn logging off */
log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
#ifndef UNIV_HOTBACKUP
temp_block = buf_block_alloc(0);
#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 */
buf_frame_copy(temp_page, page);
#ifndef UNIV_HOTBACKUP
if (UNIV_LIKELY(!recovery)) {
btr_search_drop_page_hash_index(block);
}
block->check_index_page_at_flush = TRUE;
#endif /* !UNIV_HOTBACKUP */
/* Recreate the page: note that global data on page (possible
segment headers, next page-field, etc.) is preserved intact */
page_create(block, mtr, dict_table_is_comp(index->table));
block->check_index_page_at_flush = TRUE;
/* Copy the records from the temporary space to the recreated page;
do not copy the lock bits yet */
@ -999,10 +1012,12 @@ btr_page_reorganize_low(
goto func_exit;
}
#ifndef UNIV_HOTBACKUP
if (UNIV_LIKELY(!recovery)) {
/* 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);
@ -1029,7 +1044,9 @@ func_exit:
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page));
#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);
@ -1037,6 +1054,7 @@ func_exit:
return(success);
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Reorganizes an index page.
IMPORTANT: if btr_page_reorganize() is invoked on a compressed leaf
@ -1054,6 +1072,7 @@ btr_page_reorganize(
{
return(btr_page_reorganize_low(FALSE, block, index, mtr));
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses a redo log record of reorganizing a page. */
@ -1080,6 +1099,7 @@ btr_parse_page_reorganize(
return(ptr);
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Empties an index page. @see btr_page_create().*/
static
@ -2220,6 +2240,9 @@ 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
@ -2279,6 +2302,7 @@ btr_set_min_rec_mark(
}
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Deletes on the upper level the node pointer to a page. */
UNIV_INTERN
@ -3654,3 +3678,4 @@ btr_validate_index(
return(TRUE);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -46,6 +46,8 @@ Created 10/16/1994 Heikki Tuuri
#include "btr0cur.ic"
#endif
#include "row0upd.h"
#ifndef UNIV_HOTBACKUP
#include "page0page.h"
#include "page0zip.h"
#include "rem0rec.h"
@ -53,7 +55,6 @@ Created 10/16/1994 Heikki Tuuri
#include "buf0lru.h"
#include "btr0btr.h"
#include "btr0sea.h"
#include "row0upd.h"
#include "trx0rec.h"
#include "trx0roll.h" /* trx_is_recv() */
#include "que0que.h"
@ -87,12 +88,14 @@ can be released by page reorganize, then it is reorganized */
FIL_NULL if none */
/*--------------------------------------*/
#define BTR_BLOB_HDR_SIZE 8
#endif /* !UNIV_HOTBACKUP */
/* A BLOB field reference full of zero, for use in assertions and tests.
Initially, BLOB field references are set to zero, in
dtuple_convert_big_rec(). */
UNIV_INTERN const byte field_ref_zero[BTR_EXTERN_FIELD_REF_SIZE];
#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
@ -161,6 +164,7 @@ btr_rec_get_externally_stored_len(
in units of a database page */
rec_t* rec, /* in: record */
const ulint* offsets);/* in: array returned by rec_get_offsets() */
#endif /* !UNIV_HOTBACKUP */
/**********************************************************
The following function is used to set the deleted bit of a record. */
@ -182,6 +186,7 @@ btr_rec_set_deleted_flag(
}
}
#ifndef UNIV_HOTBACKUP
/*==================== B-TREE SEARCH =========================*/
/************************************************************************
@ -1535,6 +1540,7 @@ 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. */
@ -1614,6 +1620,7 @@ func_exit:
return(ptr);
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
See if there is enough place in the page modification log to log
an update-in-place. */
@ -2394,6 +2401,7 @@ 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
@ -2475,6 +2483,7 @@ 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
@ -2599,6 +2608,7 @@ 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
@ -2643,6 +2653,7 @@ btr_cur_parse_del_mark_set_sec_rec(
return(ptr);
}
#ifndef UNIV_HOTBACKUP
/***************************************************************
Sets a secondary index record delete mark to TRUE or FALSE. */
UNIV_INTERN
@ -4818,3 +4829,4 @@ btr_rec_copy_externally_stored_field(
return(btr_copy_externally_stored_field(len, data,
zip_size, local_len, heap));
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -35,17 +35,20 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0buf.ic"
#endif
#include "buf0buddy.h"
#include "mem0mem.h"
#include "btr0btr.h"
#include "fil0fil.h"
#ifndef UNIV_HOTBACKUP
#include "buf0buddy.h"
#include "lock0lock.h"
#include "btr0sea.h"
#include "ibuf0ibuf.h"
#include "trx0undo.h"
#include "log0log.h"
#endif /* !UNIV_HOTBACKUP */
#include "srv0srv.h"
#include "dict0dict.h"
#include "log0recv.h"
#include "trx0undo.h"
#include "srv0srv.h"
#include "page0zip.h"
/*
@ -235,6 +238,7 @@ that the whole area may be needed in the near future, and issue
the read requests for the whole area.
*/
#ifndef UNIV_HOTBACKUP
/* Value in microseconds */
static const int WAIT_FOR_READ = 5000;
@ -270,6 +274,7 @@ struct buf_chunk_struct{
was allocated for the frames */
buf_block_t* blocks; /* array of buffer control blocks */
};
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Calculates a page checksum which is stored to the page when it is written
@ -338,9 +343,7 @@ buf_page_is_corrupted(
{
ulint checksum_field;
ulint old_checksum_field;
#ifndef UNIV_HOTBACKUP
ib_uint64_t current_lsn;
#endif
if (UNIV_LIKELY(!zip_size)
&& memcmp(read_buf + FIL_PAGE_LSN + 4,
read_buf + UNIV_PAGE_SIZE
@ -353,8 +356,11 @@ buf_page_is_corrupted(
}
#ifndef UNIV_HOTBACKUP
if (recv_lsn_checks_on && log_peek_lsn(&current_lsn)) {
if (current_lsn < mach_read_ull(read_buf + FIL_PAGE_LSN)) {
if (recv_lsn_checks_on) {
ib_uint64_t current_lsn;
if (log_peek_lsn(&current_lsn)
&& current_lsn < mach_read_ull(read_buf + FIL_PAGE_LSN)) {
ut_print_timestamp(stderr);
fprintf(stderr,
@ -438,7 +444,9 @@ buf_page_print(
ulint zip_size) /* in: compressed page size, or
0 for uncompressed pages */
{
#ifndef UNIV_HOTBACKUP
dict_index_t* index;
#endif /* !UNIV_HOTBACKUP */
ulint checksum;
ulint old_checksum;
ulint size = zip_size;
@ -552,6 +560,7 @@ buf_page_print(
(ulong) mach_read_from_4(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,
@ -562,6 +571,7 @@ 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)) {
case FIL_PAGE_INDEX:
@ -625,6 +635,7 @@ buf_page_print(
}
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Initializes a buffer control block when the buf_pool is created. */
static
@ -999,7 +1010,6 @@ buf_pool_free(void)
buf_pool->n_chunks = 0;
}
/************************************************************************
Drops the adaptive hash index. To prevent a livelock, this function
is only to be called while holding btr_search_latch and while
@ -1767,10 +1777,11 @@ buf_block_init_low(
block->n_bytes = 0;
block->left_side = TRUE;
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Decompress a block. */
static
UNIV_INTERN
ibool
buf_zip_decompress(
/*===============*/
@ -1834,6 +1845,7 @@ buf_zip_decompress(
return(FALSE);
}
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Gets the block to whose frame the pointer is pointing to. */
UNIV_INTERN
@ -2591,39 +2603,6 @@ buf_page_init_low(
#endif /* UNIV_DEBUG_FILE_ACCESSES */
}
#ifdef UNIV_HOTBACKUP
/************************************************************************
Inits a page to the buffer buf_pool, for use in ibbackup --restore. */
UNIV_INTERN
void
buf_page_init_for_backup_restore(
/*=============================*/
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
ulint zip_size,/* in: compressed page size in bytes
or 0 for uncompressed pages */
buf_block_t* block) /* in: block to init */
{
buf_block_init_low(block);
block->lock_hash_val = 0;
buf_page_init_low(&block->page);
block->page.state = BUF_BLOCK_FILE_PAGE;
block->page.space = space;
block->page.offset = offset;
page_zip_des_init(&block->page.zip);
/* We assume that block->page.data has been allocated
with zip_size == UNIV_PAGE_SIZE. */
ut_ad(zip_size <= UNIV_PAGE_SIZE);
ut_ad(ut_is_2pow(zip_size));
page_zip_set_size(&block->page.zip, zip_size);
}
#endif /* UNIV_HOTBACKUP */
/************************************************************************
Inits a page to the buffer buf_pool. */
static
@ -3909,3 +3888,33 @@ buf_get_free_list_len(void)
return(len);
}
#else /* !UNIV_HOTBACKUP */
/************************************************************************
Inits a page to the buffer buf_pool, for use in ibbackup --restore. */
UNIV_INTERN
void
buf_page_init_for_backup_restore(
/*=============================*/
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
ulint zip_size,/* in: compressed page size in bytes
or 0 for uncompressed pages */
buf_block_t* block) /* in: block to init */
{
block->page.state = BUF_BLOCK_FILE_PAGE;
block->page.space = space;
block->page.offset = offset;
page_zip_des_init(&block->page.zip);
/* We assume that block->page.data has been allocated
with zip_size == UNIV_PAGE_SIZE. */
ut_ad(zip_size <= UNIV_PAGE_SIZE);
ut_ad(ut_is_2pow(zip_size));
page_zip_set_size(&block->page.zip, zip_size);
if (zip_size) {
block->page.zip.data = block->frame + UNIV_PAGE_SIZE;
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -26,22 +26,22 @@ Created 11/11/1995 Heikki Tuuri
#ifdef UNIV_NONINL
#include "buf0flu.ic"
#include "trx0sys.h"
#endif
#include "buf0buf.h"
#include "srv0srv.h"
#include "page0zip.h"
#ifndef UNIV_HOTBACKUP
#include "ut0byte.h"
#include "ut0lst.h"
#include "page0page.h"
#include "page0zip.h"
#include "fil0fil.h"
#include "buf0buf.h"
#include "buf0lru.h"
#include "buf0rea.h"
#include "ibuf0ibuf.h"
#include "log0log.h"
#include "os0file.h"
#include "trx0sys.h"
#include "srv0srv.h"
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/**********************************************************************
@ -574,6 +574,7 @@ try_again:
mutex_exit(&(trx_doublewrite->mutex));
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Initializes a page for writing to the tablespace. */
@ -653,6 +654,7 @@ buf_flush_init_for_writing(
: BUF_NO_CHECKSUM_MAGIC);
}
#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
@ -1245,3 +1247,4 @@ buf_flush_validate(void)
return(ret);
}
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
#endif /* !UNIV_HOTBACKUP */

View file

@ -28,6 +28,7 @@ Created 5/30/1994 Heikki Tuuri
#include "data0data.ic"
#endif
#ifndef UNIV_HOTBACKUP
#include "rem0rec.h"
#include "rem0cmp.h"
#include "page0page.h"
@ -36,6 +37,7 @@ Created 5/30/1994 Heikki Tuuri
#include "btr0cur.h"
#include <ctype.h>
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/* data pointers of tuple fields are initialized to point here
@ -48,6 +50,7 @@ UNIV_INTERN ulint data_dummy;
# endif /* !UNIV_DEBUG_VALGRIND */
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Tests if dfield data length and content is equal to the given. */
UNIV_INTERN
@ -192,7 +195,9 @@ dump:
return(TRUE);
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/**************************************************************
Checks that a data field is typed. Asserts an error if not. */
UNIV_INTERN
@ -238,7 +243,6 @@ dtuple_check_typed(
return(TRUE);
}
#ifdef UNIV_DEBUG
/**************************************************************
Validates the consistency of a tuple which must be complete, i.e,
all fields must have been set. */
@ -291,6 +295,7 @@ dtuple_validate(
}
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Pretty prints a dfield value according to its data type. */
UNIV_INTERN
@ -756,3 +761,4 @@ dtuple_convert_back_big_rec(
mem_heap_free(vector->heap);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -185,6 +185,7 @@ dtype_validate(
return(TRUE);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Prints a data type structure. */
UNIV_INTERN
@ -276,3 +277,4 @@ dtype_print(
fprintf(stderr, " len %lu", (ulong) len);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -33,6 +33,7 @@ dict_index_t* dict_ind_redundant;
/* dummy index for ROW_FORMAT=COMPACT supremum and infimum records */
dict_index_t* dict_ind_compact;
#ifndef UNIV_HOTBACKUP
#include "buf0buf.h"
#include "data0type.h"
#include "mach0data.h"
@ -50,10 +51,8 @@ dict_index_t* dict_ind_compact;
#include "que0que.h"
#include "rem0cmp.h"
#include "row0merge.h"
#ifndef UNIV_HOTBACKUP
# include "m_ctype.h" /* my_isspace() */
# include "ha_prototypes.h" /* innobase_strcasecmp() */
#endif /* !UNIV_HOTBACKUP */
#include "m_ctype.h" /* my_isspace() */
#include "ha_prototypes.h" /* innobase_strcasecmp() */
#include <ctype.h>
@ -156,7 +155,6 @@ UNIV_INTERN FILE* dict_foreign_err_file = NULL;
/* mutex protecting the foreign and unique error buffers */
UNIV_INTERN mutex_t dict_foreign_err_mutex;
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Makes all characters in a NUL-terminated UTF-8 string lower case. */
UNIV_INTERN
@ -167,7 +165,6 @@ dict_casedn_str(
{
innobase_casedn_str(a);
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Checks if the database name in two table names is the same. */
@ -264,6 +261,7 @@ dict_table_decrement_handle_count(
mutex_exit(&dict_sys->mutex);
}
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Returns a column's name. */
@ -295,7 +293,7 @@ dict_table_get_col_name(
return(s);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Acquire the autoinc lock.*/
UNIV_INTERN
@ -394,6 +392,7 @@ dict_index_get_on_id_low(
return(NULL);
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Looks for column n in an index. */
@ -437,6 +436,7 @@ dict_index_get_nth_col_pos(
return(ULINT_UNDEFINED);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Returns TRUE if the index contains a column or a prefix of that column. */
UNIV_INTERN
@ -677,6 +677,7 @@ dict_table_get(
return(table);
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Adds system columns to a table object. */
@ -724,6 +725,7 @@ dict_table_add_system_columns(
#endif
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Adds a table object to the dictionary cache. */
UNIV_INTERN
@ -1712,6 +1714,7 @@ found:
;
}
}
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Adds a column to index. */
@ -1759,6 +1762,7 @@ dict_index_add_col(
}
}
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Copies fields contained in index2 to index1. */
static
@ -2198,7 +2202,6 @@ dict_foreign_remove_from_cache(
dict_foreign_free(foreign);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Looks for the foreign constraint from the foreign and referenced lists
of a table. */
@ -3866,7 +3869,6 @@ syntax_error:
return(DB_CANNOT_DROP_CONSTRAINT);
}
#endif /* UNIV_HOTBACKUP */
/*==================== END OF FOREIGN KEY PROCESSING ====================*/
@ -4625,6 +4627,7 @@ dict_index_name_print(
fputs(" of table ", file);
ut_print_name(file, trx, TRUE, index->table_name);
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Inits dict_ind_redundant and dict_ind_compact. */
@ -4660,6 +4663,7 @@ dict_ind_init(void)
dict_ind_redundant->cached = dict_ind_compact->cached = TRUE;
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Get index by name */
UNIV_INTERN
@ -4784,3 +4788,4 @@ dict_table_check_for_dup_indexes(
}
}
#endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */

View file

@ -32,7 +32,9 @@ Created 1/8/1996 Heikki Tuuri
#include "data0type.h"
#include "mach0data.h"
#include "dict0dict.h"
#include "lock0lock.h"
#ifndef UNIV_HOTBACKUP
# include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */
#define DICT_HEAP_SIZE 100 /* initial memory heap size when
creating a table or index object */
@ -72,6 +74,7 @@ dict_mem_table_create(
table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
* sizeof(dict_col_t));
#ifndef UNIV_HOTBACKUP
table->autoinc_lock = mem_heap_alloc(heap, lock_get_size());
mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
@ -81,10 +84,9 @@ dict_mem_table_create(
/* The number of transactions that are either waiting on the
AUTOINC lock or have been granted the lock. */
table->n_waiting_or_granted_auto_inc_locks = 0;
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
table->magic_n = DICT_TABLE_MAGIC_N;
#endif /* UNIV_DEBUG */
ut_d(table->magic_n = DICT_TABLE_MAGIC_N);
return(table);
}
@ -166,8 +168,10 @@ dict_mem_table_add_col(
ulint len) /* in: precision */
{
dict_col_t* col;
#ifndef UNIV_HOTBACKUP
ulint mbminlen;
ulint mbmaxlen;
#endif /* !UNIV_HOTBACKUP */
ulint i;
ut_ad(table);
@ -199,10 +203,12 @@ dict_mem_table_add_col(
col->prtype = (unsigned int) prtype;
col->len = (unsigned int) len;
#ifndef UNIV_HOTBACKUP
dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen);
col->mbminlen = (unsigned int) mbminlen;
col->mbmaxlen = (unsigned int) mbmaxlen;
#endif /* !UNIV_HOTBACKUP */
}
/**************************************************************************
@ -232,7 +238,9 @@ dict_mem_index_create(
index->heap = heap;
index->type = type;
#ifndef UNIV_HOTBACKUP
index->space = (unsigned int) space;
#endif /* !UNIV_HOTBACKUP */
index->name = mem_heap_strdup(heap, index_name);
index->table_name = table_name;
index->n_fields = (unsigned int) n_fields;

View file

@ -25,15 +25,11 @@ Created 10/25/1995 Heikki Tuuri
#include "fil0fil.h"
#include "mem0mem.h"
#include "sync0sync.h"
#include "hash0hash.h"
#include "os0file.h"
#include "os0sync.h"
#include "mach0data.h"
#include "ibuf0ibuf.h"
#include "buf0buf.h"
#include "buf0flu.h"
#include "buf0lru.h"
#include "log0recv.h"
#include "fsp0fsp.h"
#include "srv0srv.h"
@ -42,7 +38,14 @@ Created 10/25/1995 Heikki Tuuri
#include "mtr0log.h"
#include "dict0dict.h"
#include "page0zip.h"
#ifndef UNIV_HOTBACKUP
# include "buf0lru.h"
# include "ibuf0ibuf.h"
# include "sync0sync.h"
# include "os0sync.h"
#else /* !UNIV_HOTBACKUP */
static ulint srv_data_read, srv_data_written;
#endif /* !UNIV_HOTBACKUP */
/*
IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE
@ -197,8 +200,10 @@ struct fil_space_struct {
forbidden if this is > 0 */
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 */
@ -217,7 +222,9 @@ form a 'space' and it is handled here */
typedef struct fil_system_struct fil_system_t;
struct fil_system_struct {
#ifndef UNIV_HOTBACKUP
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 */
@ -408,6 +415,7 @@ fil_space_get_by_name(
return(space);
}
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Returns the version number of a tablespace, -1 if not found. */
UNIV_INTERN
@ -488,6 +496,7 @@ fil_space_get_type(
return(space->purpose);
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Checks if all the file nodes in a space are flushed. The caller must hold
@ -1753,6 +1762,7 @@ fil_read_flushed_lsn_and_arch_log_no(
/*================ SINGLE-TABLE TABLESPACES ==========================*/
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Increments the count of pending insert buffer page merges, if space is not
being deleted. */
@ -1817,6 +1827,7 @@ fil_decr_pending_ibuf_merges(
mutex_exit(&fil_system->mutex);
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Creates the database directory for a table if it does not exist yet. */
@ -2234,6 +2245,7 @@ try_again:
return(FALSE);
}
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Discards a single-table tablespace. The tablespace must be cached in the
memory cache. Discarding is like deleting a tablespace, but
@ -2268,6 +2280,7 @@ fil_discard_tablespace(
return(success);
}
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Renames the memory cache structures of a single-table tablespace. */
@ -2704,6 +2717,7 @@ error_exit2:
return(DB_SUCCESS);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
It is possible, though very improbable, that the lsn's in the tablespace to be
imported have risen above the current system lsn, if a lengthy purge, ibuf
@ -3002,6 +3016,7 @@ func_exit:
return(ret);
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_HOTBACKUP
/***********************************************************************
@ -3899,7 +3914,8 @@ fil_extend_tablespaces_to_stored_len(void)
mutex_exit(&fil_system->mutex); /* no need to protect with a
mutex, because this is a
single-threaded operation */
error = fil_read(TRUE, space->id, space->zip_size,
error = fil_read(TRUE, space->id,
dict_table_flags_to_zip_size(space->flags),
0, 0, UNIV_PAGE_SIZE, buf, NULL);
ut_a(error == DB_SUCCESS);
@ -4195,14 +4211,15 @@ fil_io(
# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
#endif
ut_ad(fil_validate());
#ifndef UNIV_LOG_DEBUG
#ifndef UNIV_HOTBACKUP
# ifndef UNIV_LOG_DEBUG
/* ibuf bitmap pages must be read in the sync aio mode: */
ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
|| !ibuf_bitmap_page(zip_size, block_offset)
|| sync || is_log);
ut_ad(!ibuf_inside() || is_log || (type == OS_FILE_WRITE)
|| ibuf_page(space_id, zip_size, block_offset, NULL));
#endif
# endif /* UNIV_LOG_DEBUG */
if (sync) {
mode = OS_AIO_SYNC;
} else if (is_log) {
@ -4214,6 +4231,10 @@ fil_io(
} else {
mode = OS_AIO_NORMAL;
}
#else /* !UNIV_HOTBACKUP */
ut_a(sync);
mode = OS_AIO_SYNC;
#endif /* !UNIV_HOTBACKUP */
if (type == OS_FILE_READ) {
srv_data_read+= len;
@ -4354,6 +4375,7 @@ fil_io(
return(DB_SUCCESS);
}
#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
@ -4415,6 +4437,7 @@ fil_aio_wait(
log_io_complete(message);
}
}
#endif /* UNIV_HOTBACKUP */
/**************************************************************************
Flushes to disk possible writes cached by the OS. If the space does not exist

View file

@ -30,18 +30,23 @@ Created 11/29/1995 Heikki Tuuri
#include "buf0buf.h"
#include "fil0fil.h"
#include "sync0sync.h"
#include "mtr0log.h"
#include "fut0fut.h"
#include "ut0byte.h"
#include "srv0srv.h"
#include "page0page.h"
#include "page0zip.h"
#include "ibuf0ibuf.h"
#include "btr0btr.h"
#include "btr0sea.h"
#include "dict0boot.h"
#ifdef UNIV_HOTBACKUP
# include "fut0lst.h"
#else /* UNIV_HOTBACKUP */
# include "sync0sync.h"
# include "fut0fut.h"
# include "srv0srv.h"
# include "ibuf0ibuf.h"
# include "btr0btr.h"
# include "btr0sea.h"
# include "dict0boot.h"
# include "log0log.h"
#endif /* UNIV_HOTBACKUP */
#include "dict0mem.h"
#include "log0log.h"
#define FSP_HEADER_OFFSET FIL_PAGE_DATA /* Offset of the space header
@ -225,6 +230,7 @@ the extent are free and which contain old tuple version to clean. */
/* Offset of the descriptor array on a descriptor page */
#define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Returns an extent to the free list of a space. */
static
@ -325,7 +331,7 @@ fseg_alloc_free_page_low(
direction they go alphabetically: FSP_DOWN,
FSP_UP, FSP_NO_DIR */
mtr_t* mtr); /* in: mtr handle */
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Reads the file space size stored in the header page. */
@ -339,6 +345,7 @@ fsp_get_size_low(
return(mach_read_from_4(page + FSP_HEADER_OFFSET + FSP_SIZE));
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Gets a pointer to the space header and x-locks its page. */
UNIV_INLINE
@ -829,6 +836,7 @@ 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. */
@ -841,7 +849,9 @@ fsp_init_file_page_low(
page_t* page = buf_block_get_frame(block);
page_zip_des_t* page_zip= buf_block_get_page_zip(block);
#ifndef UNIV_HOTBACKUP
block->check_index_page_at_flush = FALSE;
#endif /* !UNIV_HOTBACKUP */
if (UNIV_LIKELY_NULL(page_zip)) {
memset(page, 0, UNIV_PAGE_SIZE);
@ -868,6 +878,7 @@ fsp_init_file_page_low(
memset(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, 0, 8);
}
#ifndef UNIV_HOTBACKUP
/***************************************************************
Inits a file page whose prior contents should be ignored. */
static
@ -882,6 +893,7 @@ fsp_init_file_page(
mlog_write_initial_log_record(buf_block_get_frame(block),
MLOG_INIT_FILE_PAGE, mtr);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses a redo log record of a file page init. */
@ -938,6 +950,7 @@ fsp_header_init_fields(
flags);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Initializes the space header of a new created space and creates also the
insert buffer tree root if space == 0. */
@ -999,6 +1012,7 @@ fsp_header_init(
fsp_fill_free_list(TRUE, space, header, mtr);
}
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Reads the space id from the first page of a tablespace. */
@ -1057,6 +1071,7 @@ fsp_header_get_zip_size(
return(dict_table_flags_to_zip_size(flags));
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Increases the space size field of a space. */
UNIV_INTERN
@ -4282,3 +4297,4 @@ fsp_print(
fprintf(stderr, "NUMBER of file segments: %lu\n", (ulong) n_segs);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -52,7 +52,9 @@ ha_create_func(
hash table: must be a power of 2, or 0 */
{
hash_table_t* table;
#ifndef UNIV_HOTBACKUP
ulint i;
#endif /* !UNIV_HOTBACKUP */
table = hash_create(n);
@ -72,6 +74,7 @@ ha_create_func(
return(table);
}
#ifndef UNIV_HOTBACKUP
hash_create_mutexes(table, n_mutexes, mutex_level);
table->heaps = mem_alloc(n_mutexes * sizeof(void*));
@ -80,6 +83,7 @@ ha_create_func(
table->heaps[i] = mem_heap_create_in_btr_search(4096);
ut_a(table->heaps[i]);
}
#endif /* !UNIV_HOTBACKUP */
return(table);
}
@ -99,12 +103,14 @@ ha_clear(
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EXCLUSIVE));
#endif /* UNIV_SYNC_DEBUG */
#ifndef UNIV_HOTBACKUP
/* Free the memory heaps. */
n = table->n_mutexes;
for (i = 0; i < n; i++) {
mem_heap_free(table->heaps[i]);
}
#endif /* !UNIV_HOTBACKUP */
/* Clear the hash table. */
n = hash_get_n_cells(table);
@ -305,6 +311,7 @@ ha_search_and_update_if_found_func(
}
}
#ifndef UNIV_HOTBACKUP
/*********************************************************************
Removes from the chain determined by fold all nodes whose data pointer
points to the page given. */
@ -452,3 +459,4 @@ builds, see http://bugs.mysql.com/36941 */
(ulong) n_bufs);
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -29,6 +29,7 @@ Created 5/20/1997 Heikki Tuuri
#include "mem0mem.h"
#ifndef UNIV_HOTBACKUP
/****************************************************************
Reserves the mutex for a fold value in a hash table. */
UNIV_INTERN
@ -84,6 +85,7 @@ hash_mutex_exit_all(
mutex_exit(table->mutexes + i);
}
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Creates a hash table with >= n array cells. The actual number of cells is
@ -132,12 +134,15 @@ hash_table_free(
/*============*/
hash_table_t* table) /* in, own: hash table */
{
#ifndef UNIV_HOTBACKUP
ut_a(table->mutexes == NULL);
#endif /* !UNIV_HOTBACKUP */
ut_free(table->array);
mem_free(table);
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Creates a mutex array to protect a hash table. */
UNIV_INTERN
@ -165,3 +170,4 @@ hash_create_mutexes_func(
table->n_mutexes = n_mutexes;
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -24,10 +24,20 @@ Created 7/19/1997 Heikki Tuuri
#include "ibuf0ibuf.h"
/* Number of bits describing a single page */
#define IBUF_BITS_PER_PAGE 4
#if IBUF_BITS_PER_PAGE % 2
# error "IBUF_BITS_PER_PAGE must be an even number!"
#endif
/* The start address for an insert buffer bitmap page bitmap */
#define IBUF_BITMAP PAGE_DATA
#ifdef UNIV_NONINL
#include "ibuf0ibuf.ic"
#endif
#ifndef UNIV_HOTBACKUP
#include "buf0buf.h"
#include "buf0rea.h"
#include "fsp0fsp.h"
@ -196,9 +206,6 @@ ibuf_count_check(
}
#endif
/* The start address for an insert buffer bitmap page bitmap */
#define IBUF_BITMAP PAGE_DATA
/* Offsets in bits for the bits describing a single page in the bitmap */
#define IBUF_BITMAP_FREE 0
#define IBUF_BITMAP_BUFFERED 2
@ -206,12 +213,6 @@ ibuf_count_check(
tree, excluding the root page, or is
in the free list of the ibuf */
/* Number of bits describing a single page */
#define IBUF_BITS_PER_PAGE 4
#if IBUF_BITS_PER_PAGE % 2
# error "IBUF_BITS_PER_PAGE must be an even number!"
#endif
/* The mutex used to block pessimistic inserts to ibuf trees */
static mutex_t ibuf_pessimistic_insert_mutex;
@ -492,7 +493,7 @@ ibuf_init_at_db_start(void)
ibuf->index = dict_table_get_first_index(table);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Initializes an ibuf bitmap page. */
UNIV_INTERN
@ -524,7 +525,9 @@ ibuf_bitmap_page_init(
/* 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 */
}
/*************************************************************************
@ -547,7 +550,7 @@ ibuf_parse_bitmap_init(
return(ptr);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Gets the desired bits for a given page from a bitmap page. */
UNIV_INLINE
@ -3587,3 +3590,4 @@ ibuf_print(
mutex_exit(&ibuf_mutex);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -33,6 +33,7 @@ Created 6/2/1994 Heikki Tuuri
#include "mtr0mtr.h"
#include "btr0types.h"
#ifndef UNIV_HOTBACKUP
/* Maximum record size which can be stored on a page, without using the
special big record storage structure */
@ -103,6 +104,7 @@ btr_page_get(
ulint page_no, /* in: page number */
ulint mode, /* in: latch mode */
mtr_t* mtr); /* in: mtr */
#endif /* !UNIV_HOTBACKUP */
/******************************************************************
Gets the index id field of a page. */
UNIV_INLINE
@ -111,6 +113,7 @@ btr_page_get_index_id(
/*==================*/
/* out: index id */
const page_t* page); /* in: index page */
#ifndef UNIV_HOTBACKUP
/************************************************************
Gets the node level field in an index page. */
UNIV_INLINE
@ -312,6 +315,7 @@ btr_insert_on_non_leaf_level(
ulint level, /* in: level, must be > 0 */
dtuple_t* tuple, /* in: the record to be inserted */
mtr_t* mtr); /* in: mtr */
#endif /* !UNIV_HOTBACKUP */
/********************************************************************
Sets a record as the predefined minimum record. */
UNIV_INTERN
@ -320,6 +324,7 @@ btr_set_min_rec_mark(
/*=================*/
rec_t* rec, /* in/out: record */
mtr_t* mtr); /* in: mtr */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Deletes on the upper level the node pointer to a page. */
UNIV_INTERN
@ -371,6 +376,7 @@ 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. */
@ -396,6 +402,7 @@ btr_parse_page_reorganize(
dict_index_t* index, /* in: record descriptor */
buf_block_t* block, /* in: page to be reorganized, or NULL */
mtr_t* mtr); /* in: mtr or NULL */
#ifndef UNIV_HOTBACKUP
/******************************************************************
Gets the number of pages in a B-tree. */
UNIV_INTERN
@ -486,6 +493,7 @@ btr_validate_index(
#define BTR_N_LEAF_PAGES 1
#define BTR_TOTAL_SIZE 2
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL
#include "btr0btr.ic"

View file

@ -23,6 +23,7 @@ Created 6/2/1994 Heikki Tuuri
*******************************************************/
#include "mach0data.h"
#ifndef UNIV_HOTBACKUP
#include "mtr0mtr.h"
#include "mtr0log.h"
#include "page0zip.h"
@ -93,6 +94,7 @@ btr_page_set_index_id(
id, mtr);
}
}
#endif /* !UNIV_HOTBACKUP */
/******************************************************************
Gets the index id field of a page. */
@ -106,6 +108,7 @@ 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. */
UNIV_INLINE
@ -299,3 +302,4 @@ btr_leaf_page_release(
? MTR_MEMO_PAGE_S_FIX
: MTR_MEMO_PAGE_X_FIX);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -29,9 +29,6 @@ Created 10/16/1994 Heikki Tuuri
#include "dict0dict.h"
#include "page0cur.h"
#include "btr0types.h"
#include "que0types.h"
#include "row0types.h"
#include "ha0ha.h"
/* Mode flags for btr_cur operations; these can be ORed */
#define BTR_NO_UNDO_LOG_FLAG 1 /* do no undo logging */
@ -39,6 +36,11 @@ Created 10/16/1994 Heikki Tuuri
#define BTR_KEEP_SYS_FLAG 4 /* sys fields will be found from the
update vector or inserted entry */
#ifndef UNIV_HOTBACKUP
#include "que0types.h"
#include "row0types.h"
#include "ha0ha.h"
#define BTR_CUR_ADAPT
#define BTR_CUR_HASH_ADAPT
@ -399,6 +401,7 @@ btr_cur_pessimistic_delete(
deleted record on function exit */
enum trx_rb_ctx rb_ctx, /* in: rollback context */
mtr_t* mtr); /* in: mtr */
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses a redo log record of updating a record in-place. */
UNIV_INTERN
@ -436,6 +439,7 @@ 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. */
UNIV_INTERN
@ -734,6 +738,7 @@ extern ulint btr_cur_n_non_sea;
extern ulint btr_cur_n_sea;
extern ulint btr_cur_n_non_sea_old;
extern ulint btr_cur_n_sea_old;
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL
#include "btr0cur.ic"

View file

@ -22,6 +22,7 @@ The index tree cursor
Created 10/16/1994 Heikki Tuuri
*******************************************************/
#ifndef UNIV_HOTBACKUP
#include "btr0btr.h"
#ifdef UNIV_DEBUG
@ -198,3 +199,4 @@ btr_cur_can_delete_without_compress(
return(TRUE);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -29,11 +29,11 @@ Created 11/5/1995 Heikki Tuuri
#include "fil0fil.h"
#include "mtr0types.h"
#include "buf0types.h"
#include "sync0rw.h"
#include "hash0hash.h"
#include "ut0byte.h"
#include "os0proc.h"
#include "page0types.h"
#ifndef UNIV_HOTBACKUP
#include "os0proc.h"
/* Modes for buf_page_get_gen */
#define BUF_GET 10 /* get always */
@ -46,8 +46,6 @@ Created 11/5/1995 Heikki Tuuri
/* Modes for buf_page_get_known_nowait */
#define BUF_MAKE_YOUNG 51
#define BUF_KEEP_OLD 52
/* Magic value to use instead of checksums when they are disabled */
#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL
extern buf_pool_t* buf_pool; /* The buffer pool of the database */
#ifdef UNIV_DEBUG
@ -57,6 +55,13 @@ extern ibool buf_debug_prints;/* If this is set TRUE, the program
#endif /* UNIV_DEBUG */
extern ulint srv_buf_pool_write_requests; /* variable to count write request
issued */
#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 */
/* Magic value to use instead of checksums when they are disabled */
#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL
/* States of a control block (@see buf_page_struct).
The enumeration values must be 0..7. */
@ -78,6 +83,7 @@ enum buf_page_state {
before putting to the free list */
};
#ifndef UNIV_HOTBACKUP
/************************************************************************
Creates the buffer pool. */
UNIV_INTERN
@ -155,6 +161,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. */
UNIV_INLINE
@ -164,6 +171,7 @@ buf_frame_copy(
/* out: buf */
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
@ -283,7 +291,7 @@ buf_page_create(
a page */
ulint zip_size,/* in: compressed page size, or 0 */
mtr_t* mtr); /* in: mini-transaction handle */
#ifdef UNIV_HOTBACKUP
#else /* !UNIV_HOTBACKUP */
/************************************************************************
Inits a page to the buffer buf_pool, for use in ibbackup --restore. */
UNIV_INTERN
@ -296,7 +304,9 @@ buf_page_init_for_backup_restore(
ulint zip_size,/* in: compressed page size in bytes
or 0 for uncompressed pages */
buf_block_t* block); /* in: block to init */
#endif /* UNIV_HOTBACKUP */
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_HOTBACKUP
/************************************************************************
Releases a compressed-only page acquired with buf_page_get_zip(). */
UNIV_INLINE
@ -443,6 +453,9 @@ buf_block_get_modify_clock(
/*=======================*/
/* out: value */
buf_block_t* block); /* in: block */
#else /* !UNIV_HOTBACKUP */
# define buf_block_modify_clock_inc(block) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Calculates a page checksum which is stored to the page when it is written
to a file. Note that we must be careful to calculate the same value
@ -476,6 +489,7 @@ buf_page_is_corrupted(
const byte* read_buf, /* in: a database page */
ulint zip_size); /* in: size of compressed page;
0 for uncompressed pages */
#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. */
@ -524,6 +538,7 @@ void
buf_print(void);
/*============*/
#endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Prints a page to stderr. */
UNIV_INTERN
@ -533,6 +548,16 @@ buf_page_print(
const byte* read_buf, /* in: a database page */
ulint zip_size); /* in: compressed page size, or
0 for uncompressed pages */
/************************************************************************
Decompress a block. */
UNIV_INTERN
ibool
buf_zip_decompress(
/*===============*/
/* out: TRUE if successful */
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. */
@ -589,6 +614,7 @@ UNIV_INTERN
void
buf_pool_invalidate(void);
/*=====================*/
#endif /* !UNIV_HOTBACKUP */
/*========================================================================
--------------------------- LOWER LEVEL ROUTINES -------------------------
@ -651,6 +677,7 @@ buf_page_in_file(
/* out: TRUE if mapped */
const buf_page_t* bpage) /* in: pointer to control block */
__attribute__((pure));
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Determines if a block should be on unzip_LRU list. */
UNIV_INLINE
@ -797,6 +824,7 @@ buf_page_get_block(
/* out: control block, or NULL */
buf_page_t* bpage) /* in: control block, or NULL */
__attribute__((pure));
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*************************************************************************
Gets a pointer to the memory frame of a block. */
@ -869,6 +897,7 @@ Gets the compressed page descriptor corresponding to an uncompressed page
if applicable. */
#define buf_block_get_page_zip(block) \
(UNIV_LIKELY_NULL((block)->page.zip.data) ? &(block)->page.zip : NULL)
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Gets the block to whose frame the pointer is pointing to. */
UNIV_INTERN
@ -972,7 +1001,7 @@ UNIV_INTERN
ulint
buf_get_free_list_len(void);
/*=======================*/
#endif /* !UNIV_HOTBACKUP */
/* The common buffer control block structure
@ -996,6 +1025,7 @@ struct buf_page_struct{
BUF_BLOCK_READY_FOR_USE to
BUF_BLOCK_MEMORY need not be
protected by buf_page_get_mutex(). */
#ifndef UNIV_HOTBACKUP
unsigned flush_type:2; /* if this block is currently being
flushed to disk, this tells the
flush_type (@see enum buf_flush) */
@ -1010,10 +1040,11 @@ struct buf_page_struct{
protected by buf_pool_mutex */
unsigned buf_fix_count:24;/* count of how manyfold this block
is currently bufferfixed */
#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 */
#ifndef UNIV_HOTBACKUP
buf_page_t* hash; /* node used in chaining to
buf_pool->page_hash or
buf_pool->zip_hash */
@ -1087,6 +1118,7 @@ struct buf_page_struct{
/* this is set to TRUE when fsp
frees a page in buffer pool */
#endif /* UNIV_DEBUG_FILE_ACCESSES */
#endif /* !UNIV_HOTBACKUP */
};
/* The buffer control block structure */
@ -1099,6 +1131,11 @@ struct buf_block_struct{
be the first field, so that
buf_pool->page_hash can point
to buf_page_t or buf_block_t */
byte* frame; /* pointer to buffer frame which
is of size UNIV_PAGE_SIZE, and
aligned to an address divisible by
UNIV_PAGE_SIZE */
#ifndef UNIV_HOTBACKUP
UT_LIST_NODE_T(buf_block_t) unzip_LRU;
/* node of the decompressed LRU list;
a block is in the unzip_LRU list
@ -1109,10 +1146,6 @@ struct buf_block_struct{
decompressed LRU list;
used in debugging */
#endif /* UNIV_DEBUG */
byte* frame; /* pointer to buffer frame which
is of size UNIV_PAGE_SIZE, and
aligned to an address divisible by
UNIV_PAGE_SIZE */
mutex_t mutex; /* mutex protecting this block:
state (also protected by the buffer
pool mutex), io_fix, buf_fix_count,
@ -1192,6 +1225,7 @@ struct buf_block_struct{
an s-latch here; so we can use the
debug utilities in sync0rw */
#endif
#endif /* !UNIV_HOTBACKUP */
};
/* Check if a buf_block_t object is in a valid state. */
@ -1199,6 +1233,7 @@ struct buf_block_struct{
(buf_block_get_state(block) >= BUF_BLOCK_NOT_USED \
&& (buf_block_get_state(block) <= BUF_BLOCK_REMOVE_HASH))
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Compute the hash fold value for blocks in buf_pool->zip_hash. */
#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE)
@ -1359,6 +1394,7 @@ extern ulint buf_pool_mutex_exit_forbidden;
/* Release the buffer pool mutex. */
# define buf_pool_mutex_exit() mutex_exit(&buf_pool_mutex)
#endif
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Let us list the consistency conditions for different control block states.

View file

@ -29,10 +29,11 @@ The database buffer buf_pool
Created 11/5/1995 Heikki Tuuri
*******************************************************/
#include "mtr0mtr.h"
#ifndef UNIV_HOTBACKUP
#include "buf0flu.h"
#include "buf0lru.h"
#include "buf0rea.h"
#include "mtr0mtr.h"
/************************************************************************
Reads the freed_page_clock of a buffer block. */
@ -134,6 +135,7 @@ buf_pool_clock_tic(void)
return(buf_pool->ulint_clock);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Gets the state of a block. */
@ -262,6 +264,7 @@ buf_page_in_file(
return(FALSE);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Determines if a block should be on unzip_LRU list. */
UNIV_INLINE
@ -535,6 +538,7 @@ buf_page_get_block(
return(NULL);
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*************************************************************************
@ -556,7 +560,9 @@ 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:
@ -653,6 +659,7 @@ buf_block_get_zip_size(
return(block->page.zip.ssize ? 512 << block->page.zip.ssize : 0);
}
#ifndef UNIV_HOTBACKUP
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
/*************************************************************************
Gets the compressed page descriptor corresponding to an uncompressed page
@ -667,6 +674,7 @@ buf_frame_get_page_zip(
return(buf_block_get_page_zip(buf_block_align(ptr)));
}
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Gets the space id, page offset, and byte offset within page of a
@ -687,6 +695,7 @@ 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. */
@ -740,6 +749,7 @@ buf_block_free(
buf_pool_mutex_exit();
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Copies contents of a buffer frame to a given buffer. */
@ -758,6 +768,7 @@ buf_frame_copy(
return(buf);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Calculates a folded value of a file page address to use in the page hash
table. */
@ -1074,3 +1085,4 @@ buf_block_dbg_add_level(
sync_thread_add_level(&block->lock, level);
}
#endif /* UNIV_SYNC_DEBUG */
#endif /* !UNIV_HOTBACKUP */

View file

@ -26,9 +26,10 @@ Created 11/5/1995 Heikki Tuuri
#define buf0flu_h
#include "univ.i"
#include "buf0types.h"
#include "ut0byte.h"
#ifndef UNIV_HOTBACKUP
#include "mtr0types.h"
#include "buf0types.h"
/************************************************************************
Remove a block from the flush list of modified blocks. */
@ -51,6 +52,7 @@ UNIV_INTERN
void
buf_flush_free_margin(void);
/*=======================*/
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Initializes a page for writing to the tablespace. */
UNIV_INTERN
@ -61,6 +63,7 @@ buf_flush_init_for_writing(
void* page_zip_, /* in/out: compressed page, or NULL */
ib_uint64_t newest_lsn); /* in: newest modification lsn
to the page */
#ifndef UNIV_HOTBACKUP
/***********************************************************************
This utility flushes dirty blocks from the end of the LRU list or flush_list.
NOTE 1: in the case of an LRU flush the calling thread may own latches to
@ -142,6 +145,7 @@ sweep). */
#define BUF_FLUSH_FREE_BLOCK_MARGIN (5 + BUF_READ_AHEAD_AREA)
#define BUF_FLUSH_EXTRA_MARGIN (BUF_FLUSH_FREE_BLOCK_MARGIN / 4 + 100)
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL
#include "buf0flu.ic"

View file

@ -22,6 +22,7 @@ The database buffer pool flush algorithm
Created 11/5/1995 Heikki Tuuri
*******************************************************/
#ifndef UNIV_HOTBACKUP
#include "buf0buf.h"
#include "mtr0mtr.h"
@ -118,3 +119,4 @@ buf_flush_recv_note_modification(
buf_pool_mutex_exit();
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -167,6 +167,7 @@ SQL null*/
store the charset-collation number; one byte is left unused, though */
#define DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE 6
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Gets the MySQL type code from a dtype. */
UNIV_INLINE
@ -197,6 +198,7 @@ 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. */
@ -261,6 +263,7 @@ ulint
dtype_get_prtype(
/*=============*/
const dtype_t* type);
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Compute the mbminlen and mbmaxlen members of a data type structure. */
UNIV_INLINE
@ -300,6 +303,7 @@ dtype_is_utf8(
/*==========*/
/* out: TRUE if a subset of UTF-8 */
ulint prtype);/* in: precise data type */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Gets the type length. */
UNIV_INLINE
@ -307,6 +311,7 @@ ulint
dtype_get_len(
/*==========*/
const dtype_t* type);
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Gets the minimum length of a character, in bytes. */
UNIV_INLINE
@ -335,6 +340,7 @@ dtype_get_pad_char(
ULINT_UNDEFINED if no padding specified */
ulint mtype, /* in: main type */
ulint prtype); /* in: precise type */
#endif /* !UNIV_HOTBACKUP */
/***************************************************************************
Returns the size of a fixed size data type, 0 if not a fixed size type. */
UNIV_INLINE
@ -347,6 +353,7 @@ dtype_get_fixed_size_low(
ulint len, /* in: length */
ulint mbminlen, /* in: minimum length of a multibyte char */
ulint mbmaxlen); /* in: maximum length of a multibyte char */
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Returns the minimum size of a data type. */
UNIV_INLINE
@ -369,6 +376,7 @@ dtype_get_max_size_low(
/* out: maximum size */
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. */
@ -379,6 +387,7 @@ dtype_get_sql_null_size(
/* out: SQL null storage size
in ROW_FORMAT=REDUNDANT */
const dtype_t* type); /* in: type */
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Reads to a type the stored information which determines its alphabetical
ordering and the storage size of an SQL NULL value. */
@ -412,6 +421,7 @@ dtype_new_read_for_order_and_null_size(
/*===================================*/
dtype_t* type, /* in: type struct */
const byte* buf); /* in: buffer for stored type order info */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Validates a data type structure. */
@ -457,11 +467,12 @@ struct dtype_struct{
string data (in addition to
the string, MySQL uses 1 or 2
bytes to store the string length) */
#ifndef UNIV_HOTBACKUP
unsigned mbminlen:2; /* minimum length of a
character, in bytes */
unsigned mbmaxlen:3; /* maximum length of a
character, in bytes */
#endif /* !UNIV_HOTBACKUP */
};
#ifndef UNIV_NONINL

View file

@ -23,7 +23,8 @@ Created 1/16/1996 Heikki Tuuri
*******************************************************/
#include "mach0data.h"
#include "ha_prototypes.h"
#ifndef UNIV_HOTBACKUP
# include "ha_prototypes.h"
/*************************************************************************
Gets the MySQL charset-collation code for MySQL string types. */
@ -88,16 +89,11 @@ dtype_get_mblen(
multi-byte character */
{
if (dtype_is_string_type(mtype)) {
#ifndef UNIV_HOTBACKUP
innobase_get_cset_width(dtype_get_charset_coll(prtype),
mbminlen, mbmaxlen);
ut_ad(*mbminlen <= *mbmaxlen);
ut_ad(*mbminlen <= 2); /* mbminlen in dtype_t is 0..3 */
ut_ad(*mbmaxlen < 1 << 3); /* mbmaxlen in dtype_t is 0..7 */
#else /* !UNIV_HOTBACKUP */
ut_a(mtype <= DATA_BINARY);
*mbminlen = *mbmaxlen = 1;
#endif /* !UNIV_HOTBACKUP */
} else {
*mbminlen = *mbmaxlen = 0;
}
@ -120,6 +116,9 @@ 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. */
@ -195,6 +194,7 @@ dtype_get_len(
return(type->len);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Gets the minimum length of a character, in bytes. */
UNIV_INLINE
@ -385,6 +385,7 @@ dtype_new_read_for_order_and_null_size(
}
dtype_set_mblen(type);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************************
Returns the size of a fixed size data type, 0 if not a fixed size type. */
@ -424,14 +425,10 @@ dtype_get_fixed_size_low(
case DATA_DOUBLE:
return(len);
case DATA_MYSQL:
#ifndef UNIV_HOTBACKUP
if (prtype & DATA_BINARY_TYPE) {
return(len);
} else {
#ifdef UNIV_HOTBACKUP
if (mbminlen == mbmaxlen) {
return(len);
}
#else /* UNIV_HOTBACKUP */
/* We play it safe here and ask MySQL for
mbminlen and mbmaxlen. Although
mbminlen and mbmaxlen are
@ -463,8 +460,10 @@ dtype_get_fixed_size_low(
if (mbminlen == mbmaxlen) {
return(len);
}
#endif /* !UNIV_HOTBACKUP */
}
#else /* !UNIV_HOTBACKUP */
return(len);
#endif /* !UNIV_HOTBACKUP */
/* fall through for variable-length charsets */
case DATA_VARCHAR:
case DATA_BINARY:
@ -479,6 +478,7 @@ dtype_get_fixed_size_low(
return(0);
}
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Returns the minimum size of a data type. */
UNIV_INLINE
@ -570,6 +570,7 @@ dtype_get_max_size_low(
return(ULINT_MAX);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************************
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a type.
@ -582,6 +583,11 @@ dtype_get_sql_null_size(
in ROW_FORMAT=REDUNDANT */
const dtype_t* type) /* in: type */
{
#ifndef UNIV_HOTBACKUP
return(dtype_get_fixed_size_low(type->mtype, type->prtype, type->len,
type->mbminlen, type->mbmaxlen));
#else /* !UNIV_HOTBACKUP */
return(dtype_get_fixed_size_low(type->mtype, type->prtype, type->len,
0, 0));
#endif /* !UNIV_HOTBACKUP */
}

View file

@ -30,8 +30,6 @@ Created 1/8/1996 Heikki Tuuri
#include "dict0mem.h"
#include "data0type.h"
#include "data0data.h"
#include "sync0sync.h"
#include "sync0rw.h"
#include "mem0mem.h"
#include "rem0types.h"
#include "ut0mem.h"
@ -42,6 +40,8 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0types.h"
#ifndef UNIV_HOTBACKUP
# include "sync0sync.h"
# include "sync0rw.h"
/**********************************************************************
Makes all characters in a NUL-terminated UTF-8 string lower case. */
UNIV_INTERN
@ -49,7 +49,6 @@ void
dict_casedn_str(
/*============*/
char* a); /* in/out: string to put in lower case */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Get the database name length in a table name. */
UNIV_INTERN
@ -109,6 +108,7 @@ dict_col_copy_type(
/*===============*/
const dict_col_t* col, /* in: column */
dtype_t* type); /* out: data type */
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*************************************************************************
Assert that a column and a data type match. */
@ -120,6 +120,7 @@ dict_col_type_assert_equal(
const dict_col_t* col, /* in: column */
const dtype_t* type); /* in: data type */
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Returns the minimum size of the column. */
UNIV_INLINE
@ -220,6 +221,7 @@ void
dict_table_autoinc_unlock(
/*======================*/
dict_table_t* table); /* in/out: table */
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Adds system columns to a table object. */
UNIV_INTERN
@ -228,6 +230,7 @@ dict_table_add_system_columns(
/*==========================*/
dict_table_t* table, /* in/out: table */
mem_heap_t* heap); /* in: temporary heap */
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Adds a table object to the dictionary cache. */
UNIV_INTERN
@ -532,6 +535,7 @@ dict_table_get_next_index(
# define dict_table_get_first_index(table) UT_LIST_GET_FIRST((table)->indexes)
# define dict_table_get_next_index(index) UT_LIST_GET_NEXT(indexes, index)
#endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Check whether the index is the clustered index. */
UNIV_INLINE
@ -626,6 +630,7 @@ dict_table_get_sys_col_no(
/* out: column number */
const dict_table_t* table, /* in: table */
ulint sys); /* in: DATA_ROW_ID, ... */
#ifndef UNIV_HOTBACKUP
/************************************************************************
Returns the minimum data size of an index record. */
UNIV_INLINE
@ -634,6 +639,7 @@ dict_index_get_min_size(
/*====================*/
/* out: minimum data size in bytes */
const dict_index_t* index); /* in: index */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Check whether the table uses the compact page format. */
UNIV_INLINE
@ -689,6 +695,7 @@ dict_table_col_in_clustered_key(
prefix, is in the clustered key */
const dict_table_t* table, /* in: table */
ulint n); /* in: column number */
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Copies types of columns contained in table to tuple and sets all
fields of the tuple to the SQL NULL value. This function should
@ -731,6 +738,7 @@ dict_index_remove_from_cache(
/*=========================*/
dict_table_t* table, /* in/out: table */
dict_index_t* index); /* in, own: index */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Gets the number of fields in the internal representation of an index,
including fields added by the dictionary system. */
@ -877,6 +885,7 @@ dict_index_add_col(
const dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */
ulint prefix_len); /* in: column prefix length */
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Copies types of fields contained in index to tuple. */
UNIV_INTERN
@ -887,6 +896,7 @@ dict_index_copy_types(
const dict_index_t* index, /* in: index */
ulint n_fields); /* in: number of
field types to copy */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Gets the field column. */
UNIV_INLINE
@ -894,7 +904,7 @@ const dict_col_t*
dict_field_get_col(
/*===============*/
const dict_field_t* field);
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Returns an index object if it is found in the dictionary cache.
Assumes that dict_sys->mutex is already being held. */
@ -1139,6 +1149,7 @@ struct dict_sys_struct{
dict_table_t* sys_indexes; /* SYS_INDEXES table */
dict_table_t* sys_fields; /* SYS_FIELDS table */
};
#endif /* !UNIV_HOTBACKUP */
/* dummy index for ROW_FORMAT=REDUNDANT supremum and infimum records */
extern dict_index_t* dict_ind_redundant;

View file

@ -22,9 +22,10 @@ Data dictionary system
Created 1/8/1996 Heikki Tuuri
***********************************************************************/
#include "data0type.h"
#ifndef UNIV_HOTBACKUP
#include "dict0load.h"
#include "rem0types.h"
#include "data0type.h"
/*************************************************************************
Gets the column data type. */
@ -43,6 +44,7 @@ dict_col_copy_type(
type->mbminlen = col->mbminlen;
type->mbmaxlen = col->mbmaxlen;
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*************************************************************************
@ -61,13 +63,16 @@ 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->mbminlen == type->mbminlen);
ut_ad(col->mbmaxlen == type->mbmaxlen);
# endif /* !UNIV_HOTBACKUP */
return(TRUE);
}
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Returns the minimum size of the column. */
UNIV_INLINE
@ -91,6 +96,7 @@ 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. */
UNIV_INLINE
@ -156,6 +162,7 @@ dict_col_get_clust_pos(
return(ULINT_UNDEFINED);
}
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_DEBUG
/************************************************************************
Gets the first index on the table (the clustered index). */
@ -187,6 +194,7 @@ 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. */
@ -593,6 +601,7 @@ dict_index_get_nth_col_no(
return(dict_col_get_no(dict_index_get_nth_col(index, pos)));
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Returns the minimum data size of an index record. */
UNIV_INLINE
@ -782,4 +791,4 @@ dict_table_get_on_id_low(
return(table);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -31,14 +31,16 @@ Created 1/8/1996 Heikki Tuuri
#include "mem0mem.h"
#include "rem0types.h"
#include "btr0types.h"
#ifndef UNIV_HOTBACKUP
# include "lock0types.h"
# include "que0types.h"
# include "sync0rw.h"
#endif /* !UNIV_HOTBACKUP */
#include "ut0mem.h"
#include "ut0lst.h"
#include "ut0rnd.h"
#include "ut0byte.h"
#include "sync0rw.h"
#include "lock0types.h"
#include "hash0hash.h"
#include "que0types.h"
#include "trx0types.h"
/* Type flags of an index: OR'ing of the flags is allowed to define a
@ -232,9 +234,11 @@ struct dict_index_struct{
const char* 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 */
#endif /* !UNIV_HOTBACKUP */
unsigned type:4; /* index type (DICT_CLUSTERED, DICT_UNIQUE,
DICT_UNIVERSAL, DICT_IBUF) */
unsigned trx_id_offset:10;/* position of the trx id column
@ -258,6 +262,7 @@ struct dict_index_struct{
dropped in ha_innobase::prepare_drop_index(),
otherwise FALSE */
dict_field_t* fields; /* array of field descriptions */
#ifndef UNIV_HOTBACKUP
UT_LIST_NODE_T(dict_index_t)
indexes;/* list of indexes of the table */
btr_search_t* search_info; /* info used in optimistic searches */
@ -279,6 +284,7 @@ struct dict_index_struct{
index, or ut_dulint_zero if the index existed
when InnoDB was started up */
#endif /* ROW_MERGE_IS_INDEX_USABLE */
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */
# define DICT_INDEX_MAGIC_N 76789786
@ -372,6 +378,7 @@ struct dict_table_struct{
the string contains n_cols, it will be
allocated from a temporary heap. The final
string will be allocated from table->heap. */
#ifndef UNIV_HOTBACKUP
hash_node_t name_hash; /* hash chain node */
hash_node_t id_hash; /* hash chain node */
UT_LIST_BASE_NODE_T(dict_index_t)
@ -487,6 +494,7 @@ struct dict_table_struct{
/* The transaction that currently holds the
the AUTOINC lock on this table. */
/*----------------------*/
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */

View file

@ -25,8 +25,6 @@ Created 1/8/1996 Heikki Tuuri
#ifndef dict0types_h
#define dict0types_h
#include "ut0list.h"
typedef struct dict_sys_struct dict_sys_t;
typedef struct dict_col_struct dict_col_t;
typedef struct dict_field_struct dict_field_t;
@ -42,4 +40,8 @@ typedef dict_table_t dict_cluster_t;
typedef struct ind_node_struct ind_node_t;
typedef struct tab_node_struct tab_node_t;
/* Space id and page no where the dictionary header resides */
#define DICT_HDR_SPACE 0 /* the SYSTEM tablespace */
#define DICT_HDR_PAGE_NO FSP_DICT_HDR_PAGE_NO
#endif

View file

@ -26,7 +26,9 @@ Created 10/25/1995 Heikki Tuuri
#define fil0fil_h
#include "univ.i"
#ifndef UNIV_HOTBACKUP
#include "sync0rw.h"
#endif /* !UNIV_HOTBACKUP */
#include "dict0types.h"
#include "ut0byte.h"
#include "os0file.h"
@ -145,6 +147,7 @@ extern ulint fil_n_pending_log_flushes;
extern ulint fil_n_pending_tablespace_flushes;
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Returns the version number of a tablespace, -1 if not found. */
UNIV_INTERN
@ -172,6 +175,7 @@ fil_space_get_type(
/*===============*/
/* out: FIL_TABLESPACE or FIL_LOG */
ulint id); /* in: space id */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Appends a new file to the chain of files of a space. File must be closed. */
UNIV_INTERN
@ -290,6 +294,7 @@ void
fil_set_max_space_id_if_bigger(
/*===========================*/
ulint max_id);/* in: maximum known id */
#ifndef UNIV_HOTBACKUP
/********************************************************************
Writes the flushed lsn and the latest archived log number to the page
header of the first page of each data file in the system tablespace. */
@ -335,6 +340,7 @@ void
fil_decr_pending_ibuf_merges(
/*=========================*/
ulint id); /* in: space id */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Parses the body of a log record written about an .ibd file operation. That is,
the log record part after the standard (type, space id, page no) header of the
@ -371,6 +377,7 @@ fil_delete_tablespace(
/*==================*/
/* out: TRUE if success */
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
@ -385,6 +392,7 @@ fil_discard_tablespace(
/*===================*/
/* out: TRUE if success */
ulint id); /* in: space id */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Renames a single-table tablespace. The tablespace must be cached in the
tablespace memory cache. */
@ -426,6 +434,7 @@ fil_create_new_single_table_tablespace(
ulint size); /* in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
#ifndef UNIV_HOTBACKUP
/************************************************************************
Tries to open a single-table tablespace and optionally checks the space id is
right in it. If does not succeed, prints an error message to the .err log. This
@ -470,6 +479,7 @@ fil_reset_too_high_lsns(
ib_uint64_t current_lsn); /* in: reset lsn's if the lsn stamped
to FIL_PAGE_FILE_FLUSH_LSN in the
first page is too high */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
At the server startup, if we need crash recovery, scans the database
directories under the MySQL datadir, looking for .ibd files. Those files are
@ -513,6 +523,7 @@ fil_tablespace_exists_in_mem(
/*=========================*/
/* out: TRUE if exists */
ulint id); /* in: space id */
#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,
@ -540,6 +551,17 @@ fil_space_for_table_exists_in_mem(
information to the .err log if a
matching tablespace is not found from
memory */
#else /* !UNIV_HOTBACKUP */
/************************************************************************
Extends all tablespaces to the size stored in the space header. During the
ibbackup --apply-log phase we extended the spaces on-demand so that log records
could be appllied, but that may have left spaces still too small compared to
the size stored in the space header. */
UNIV_INTERN
void
fil_extend_tablespaces_to_stored_len(void);
/*======================================*/
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Tries to extend a data file so that it would accommodate the number of pages
given. The tablespace must be cached in the memory cache. If the space is big
@ -556,17 +578,6 @@ fil_extend_space_to_desired_size(
ulint size_after_extend);/* in: desired size in pages after the
extension; if the current space size is bigger
than this already, the function does nothing */
#ifdef UNIV_HOTBACKUP
/************************************************************************
Extends all tablespaces to the size stored in the space header. During the
ibbackup --apply-log phase we extended the spaces on-demand so that log records
could be appllied, but that may have left spaces still too small compared to
the size stored in the space header. */
UNIV_INTERN
void
fil_extend_tablespaces_to_stored_len(void);
/*======================================*/
#endif
/***********************************************************************
Tries to reserve free extents in a file space. */
UNIV_INTERN

View file

@ -44,7 +44,7 @@ typedef byte flst_node_t;
/* The physical size of a list node in bytes */
#define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE)
#ifndef UNIV_HOTBACKUP
/************************************************************************
Initializes a list base node. */
UNIV_INLINE
@ -211,4 +211,6 @@ flst_print(
#include "fut0lst.ic"
#endif
#endif /* !UNIV_HOTBACKUP */
#endif

View file

@ -140,6 +140,7 @@ ha_search_and_delete_if_found(
hash_table_t* table, /* in: hash table */
ulint fold, /* in: folded value of the searched data */
void* 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. */
@ -168,6 +169,7 @@ 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 */

View file

@ -63,7 +63,7 @@ innobase_raw_format(
char* buf, /* out: output buffer */
ulint buf_size); /* in: output buffer size
in bytes */
/*********************************************************************
Convert a table or index name to the MySQL system_charset_info (UTF-8)
and quote it if needed. */

View file

@ -27,7 +27,9 @@ Created 5/20/1997 Heikki Tuuri
#include "univ.i"
#include "mem0mem.h"
#include "sync0sync.h"
#ifndef UNIV_HOTBACKUP
# include "sync0sync.h"
#endif /* !UNIV_HOTBACKUP */
typedef struct hash_table_struct hash_table_t;
typedef struct hash_cell_struct hash_cell_t;
@ -46,6 +48,7 @@ hash_create(
/*========*/
/* out, own: created table */
ulint n); /* in: number of array cells */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Creates a mutex array to protect a hash table. */
UNIV_INTERN
@ -63,6 +66,7 @@ hash_create_mutexes_func(
#else /* UNIV_SYNC_DEBUG */
# define hash_create_mutexes(t,n,level) hash_create_mutexes_func(t,n)
#endif /* UNIV_SYNC_DEBUG */
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Frees a hash table. */
@ -80,10 +84,14 @@ hash_calc_hash(
/* out: hashed value */
ulint fold, /* in: folded value */
hash_table_t* table); /* in: hash table */
#ifndef UNIV_HOTBACKUP
/************************************************************************
Assert that the mutex for the table in a hash operation is owned. */
#define HASH_ASSERT_OWNED(TABLE, FOLD) \
# define HASH_ASSERT_OWNED(TABLE, FOLD) \
ut_ad(!(TABLE)->mutexes || mutex_own(hash_get_mutex(TABLE, FOLD)));
#else /* !UNIV_HOTBACKUP */
# define HASH_ASSERT_OWNED(TABLE, FOLD)
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Inserts a struct to a hash table. */
@ -293,6 +301,7 @@ 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.*/
@ -318,7 +327,6 @@ do {\
}\
} while (0)
/****************************************************************
Gets the mutex index for a fold value in a hash table. */
UNIV_INLINE
@ -394,7 +402,11 @@ void
hash_mutex_exit_all(
/*================*/
hash_table_t* table); /* in: hash table */
#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)
#endif /* !UNIV_HOTBACKUP */
struct hash_cell_struct{
void* node; /* hash chain node, NULL if none */
@ -410,6 +422,7 @@ struct hash_table_struct {
#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_mutexes;/* if mutexes != NULL, then the number of
mutexes, must be a power of 2 */
mutex_t* mutexes;/* NULL, or an array of mutexes used to
@ -418,6 +431,7 @@ struct hash_table_struct {
external chaining can be allocated from these
memory heaps; there are then n_mutexes many of
these heaps */
#endif /* !UNIV_HOTBACKUP */
mem_heap_t* heap;
ulint magic_n;
};

View file

@ -76,6 +76,7 @@ hash_calc_hash(
return(ut_hash_ulint(fold, table->n_cells));
}
#ifndef UNIV_HOTBACKUP
/****************************************************************
Gets the mutex index for a fold value in a hash table. */
UNIV_INLINE
@ -158,3 +159,4 @@ hash_get_mutex(
return(hash_get_nth_mutex(table, i));
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -27,12 +27,13 @@ Created 7/19/1997 Heikki Tuuri
#include "univ.i"
#include "dict0mem.h"
#include "mtr0mtr.h"
#include "que0types.h"
#include "ibuf0types.h"
#include "dict0mem.h"
#include "fsp0fsp.h"
#ifndef UNIV_HOTBACKUP
# include "ibuf0types.h"
/** Combinations of operations that can be buffered. Because the enum
values are used for indexing innobase_change_buffering_values[], they
should start at 0 and there should not be any gaps. */
@ -313,6 +314,7 @@ ibuf_contract_for_n_pages(
ulint n_pages);/* in: try to read at least this many pages to
the buffer pool and merge the ibuf contents to
them */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Parses a redo log record of an ibuf bitmap page init. */
UNIV_INTERN
@ -324,6 +326,7 @@ 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
/**********************************************************************
Gets the ibuf count for a given page. */
@ -354,6 +357,8 @@ ibuf_print(
#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

View file

@ -22,9 +22,10 @@ Insert buffer
Created 7/19/1997 Heikki Tuuri
*******************************************************/
#include "buf0lru.h"
#include "page0page.h"
#include "page0zip.h"
#ifndef UNIV_HOTBACKUP
#include "buf0lru.h"
extern ulint ibuf_flush_count;
@ -323,3 +324,4 @@ ibuf_update_free_bits_if_full(
ibuf_set_free_bits(block, after, before);
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -27,8 +27,11 @@ Created 12/9/1995 Heikki Tuuri
#include "univ.i"
#include "ut0byte.h"
#include "ut0lst.h"
#ifndef UNIV_HOTBACKUP
#include "sync0sync.h"
#include "sync0rw.h"
#endif /* !UNIV_HOTBACKUP */
typedef struct log_struct log_t;
typedef struct log_group_struct log_group_t;
@ -46,6 +49,7 @@ extern ibool log_debug_writes;
#define LOG_WAIT_ALL_GROUPS 93
#define LOG_MAX_N_GROUPS 32
#ifndef UNIV_HOTBACKUP
/********************************************************************
Sets the global variable log_fsp_current_free_limit. Also makes a checkpoint,
so that we know that the limit has been written to a log checkpoint field
@ -55,6 +59,7 @@ void
log_fsp_current_free_limit_set_and_checkpoint(
/*==========================================*/
ulint limit); /* in: limit to set */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Calculates where in log files we find a specified lsn. */
UNIV_INTERN
@ -72,6 +77,7 @@ log_calc_where_lsn_is(
files */
ib_int64_t log_file_size); /* in: log file size
(including the header) */
#ifndef UNIV_HOTBACKUP
/****************************************************************
Writes to the log the string given. The log must be released with
log_release. */
@ -271,20 +277,6 @@ UNIV_INTERN
void
log_groups_write_checkpoint_info(void);
/*==================================*/
#ifdef UNIV_HOTBACKUP
/**********************************************************
Writes info to a buffer of a log group when log files are created in
backup restoration. */
UNIV_INTERN
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 */
/************************************************************************
Starts an archiving operation. */
UNIV_INTERN
@ -337,6 +329,20 @@ log_archived_file_name_gen(
char* buf, /* in: buffer where to write */
ulint id, /* in: group id */
ulint file_no);/* in: file number */
#else /* !UNIV_HOTBACKUP */
/**********************************************************
Writes info to a buffer of a log group when log files are created in
backup restoration. */
UNIV_INTERN
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
@ -346,6 +352,7 @@ UNIV_INTERN
void
log_check_margins(void);
/*===================*/
#ifndef UNIV_HOTBACKUP
/**********************************************************
Reads a specified log segment to a buffer. */
UNIV_INTERN
@ -394,6 +401,7 @@ log_group_get_capacity(
/*===================*/
/* out: capacity in bytes */
const log_group_t* group); /* in: log group */
#endif /* !UNIV_HOTBACKUP */
/****************************************************************
Gets a log block flush bit. */
UNIV_INLINE
@ -717,7 +725,9 @@ struct log_struct{
ib_uint64_t lsn; /* log sequence number */
ulint buf_free; /* first free offset within the log
buffer */
#ifndef UNIV_HOTBACKUP
mutex_t mutex; /* mutex protecting the log */
#endif /* !UNIV_HOTBACKUP */
byte* buf; /* log buffer */
ulint buf_size; /* log buffer size in bytes */
ulint max_buf_free; /* recommended maximum value of
@ -740,6 +750,7 @@ struct log_struct{
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
@ -845,6 +856,7 @@ struct log_struct{
checkpoint write is running; a thread
should wait for this without owning
the log mutex */
#endif /* !UNIV_HOTBACKUP */
byte* checkpoint_buf; /* checkpoint header is read to this
buffer */
#ifdef UNIV_LOG_ARCHIVE

View file

@ -303,6 +303,7 @@ log_block_init_in_old_format(
log_block_set_first_rec_group(log_block, 0);
}
#ifndef UNIV_HOTBACKUP
/****************************************************************
Writes to the log the string given. The log must be released with
log_release. */
@ -409,3 +410,4 @@ log_free_check(void)
log_check_margins();
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -41,7 +41,7 @@ ibool
recv_read_cp_info_for_backup(
/*=========================*/
/* out: TRUE if success */
byte* hdr, /* in: buffer containing the log group
const byte* hdr, /* in: buffer containing the log group
header */
ib_uint64_t* lsn, /* out: checkpoint lsn */
ulint* offset, /* out: checkpoint offset in the log group */
@ -297,9 +297,11 @@ struct recv_addr_struct{
/* Recovery system data structure */
typedef struct recv_sys_struct recv_sys_t;
struct recv_sys_struct{
#ifndef UNIV_HOTBACKUP
mutex_t mutex; /* mutex protecting the fields apply_log_recs,
n_addrs, and the state field in each recv_addr
struct */
#endif /* !UNIV_HOTBACKUP */
ibool apply_log_recs;
/* this is TRUE when log rec application to
pages is allowed; this flag tells the

View file

@ -309,6 +309,7 @@ mach_dulint_parse_compressed(
byte* ptr, /* in: pointer to buffer from where to read */
byte* end_ptr,/* in: pointer to end of the buffer */
dulint* val); /* out: read value */
#ifndef UNIV_HOTBACKUP
/*************************************************************
Reads a double. It is stored in a little-endian format. */
UNIV_INLINE
@ -391,6 +392,8 @@ mach_read_int_type(
const byte* src, /* in: where to read from */
ulint len, /* in: length of src */
ibool unsigned_type); /* in: signed or unsigned flag */
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL
#include "mach0data.ic"
#endif

View file

@ -547,7 +547,7 @@ mach_dulint_read_much_compressed(
return(ut_dulint_create(high, low));
}
#ifndef UNIV_HOTBACKUP
/*************************************************************
Reads a double. It is stored in a little-endian format. */
UNIV_INLINE
@ -782,3 +782,4 @@ mach_read_int_type(
return(ret);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -24,7 +24,9 @@ Created 6/8/1994 Heikki Tuuri
*************************************************************************/
#ifdef UNIV_MEM_DEBUG
# ifndef UNIV_HOTBACKUP
extern mutex_t mem_hash_mutex;
# endif /* !UNIV_HOTBACKUP */
extern ulint mem_current_allocated_memory;
/**********************************************************************

View file

@ -28,9 +28,10 @@ Created 6/9/1994 Heikki Tuuri
#include "univ.i"
#include "ut0mem.h"
#include "ut0byte.h"
#include "ut0ut.h"
#include "ut0rnd.h"
#include "sync0sync.h"
#ifndef UNIV_HOTBACKUP
# include "sync0sync.h"
#endif /* UNIV_HOTBACKUP */
#include "ut0lst.h"
#include "mach0data.h"
@ -374,6 +375,7 @@ struct mem_block_info_struct {
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
@ -384,6 +386,7 @@ struct mem_block_info_struct {
/* if this block has been allocated from the buffer
pool, this contains the buf_block_t handle;
otherwise, this is NULL */
#endif /* !UNIV_HOTBACKUP */
#ifdef MEM_PERIODIC_CHECK
UT_LIST_NODE_T(mem_block_t) mem_block_list;
/* List of all mem blocks allocated; protected

View file

@ -23,8 +23,9 @@ Created 6/8/1994 Heikki Tuuri
*************************************************************************/
#include "mem0dbg.ic"
#include "mem0pool.h"
#ifndef UNIV_HOTBACKUP
# include "mem0pool.h"
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Creates a memory heap block where data can be allocated. */
@ -50,6 +51,7 @@ 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. */
UNIV_INTERN
@ -57,6 +59,7 @@ void
mem_heap_free_block_free(
/*=====================*/
mem_heap_t* heap); /* in: heap */
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Adds a new block to a memory heap. */
UNIV_INTERN
@ -330,10 +333,11 @@ mem_heap_empty(
mem_heap_t* heap) /* in: heap to empty */
{
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 */
}
/*********************************************************************
@ -488,10 +492,11 @@ mem_heap_free_func(
mem_hash_remove(heap, file_name, line);
#endif
#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
@ -590,10 +595,11 @@ mem_heap_get_size(
size += mem_block_get_len(block);
block = UT_LIST_GET_NEXT(list, block);
}
#ifndef UNIV_HOTBACKUP
if (heap->free_block) {
size += UNIV_PAGE_SIZE;
}
#endif /* !UNIV_HOTBACKUP */
return(size);
}

View file

@ -29,6 +29,7 @@ Created 12/7/1995 Heikki Tuuri
#include "mtr0mtr.h"
#include "dict0types.h"
#ifndef UNIV_HOTBACKUP
/************************************************************
Writes 1 - 4 bytes to a file page buffered in the buffer pool.
Writes the corresponding log record to the mini-transaction log. */
@ -164,6 +165,10 @@ 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) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Parses an initial log record written by mlog_write_initial_log_record. */
UNIV_INTERN
@ -203,7 +208,7 @@ 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
@ -221,6 +226,7 @@ mlog_open_and_write_index(
byte type, /* in: log item type */
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. */
@ -236,9 +242,11 @@ 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"

View file

@ -22,6 +22,7 @@ Mini-transaction logging routines
Created 12/7/1995 Heikki Tuuri
*******************************************************/
#ifndef UNIV_HOTBACKUP
#include "mach0data.h"
#include "ut0lst.h"
#include "buf0buf.h"
@ -245,3 +246,4 @@ mlog_write_initial_log_record_for_file_op(
return(log_ptr);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -195,6 +195,7 @@ mtr_rollback_to_savepoint(
/*======================*/
mtr_t* mtr, /* in: mtr */
ulint savepoint); /* in: savepoint */
#ifndef UNIV_HOTBACKUP
/**************************************************************
Releases the (index tree) s-latch stored in an mtr memo after a
savepoint. */
@ -205,6 +206,9 @@ mtr_release_s_latch_at_savepoint(
mtr_t* mtr, /* in: mtr */
ulint savepoint, /* in: savepoint */
rw_lock_t* lock); /* in: latch to release */
#else /* !UNIV_HOTBACKUP */
# define mtr_release_s_latch_at_savepoint(mtr,savepoint,lock) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Gets the logging mode of a mini-transaction. */
UNIV_INLINE
@ -241,6 +245,7 @@ mtr_read_dulint(
/* out: value read */
const byte* ptr, /* in: pointer from where to read */
mtr_t* mtr); /* in: mini-transaction handle */
#ifndef UNIV_HOTBACKUP
/*************************************************************************
This macro locks an rw-lock in s-mode. */
#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), __FILE__, __LINE__,\
@ -271,6 +276,7 @@ mtr_x_lock_func(
const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr); /* in: mtr */
#endif /* !UNIV_HOTBACKUP */
/*******************************************************
Releases an object in the memo stack. */
@ -282,6 +288,7 @@ mtr_memo_release(
void* object, /* in: object */
ulint type); /* in: object type: MTR_MEMO_S_LOCK, ... */
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**************************************************************
Checks if memo contains the given item. */
UNIV_INLINE
@ -310,6 +317,10 @@ void
mtr_print(
/*======*/
mtr_t* mtr); /* in: mtr */
# else /* !UNIV_HOTBACKUP */
# define mtr_memo_contains(mtr, object, type) TRUE
# define mtr_memo_contains_page(mtr, ptr, type) TRUE
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
/*######################################################################*/

View file

@ -22,8 +22,10 @@ Mini-transaction buffer
Created 11/26/1995 Heikki Tuuri
*******************************************************/
#include "sync0sync.h"
#include "sync0rw.h"
#ifndef UNIV_HOTBACKUP
# include "sync0sync.h"
# include "sync0rw.h"
#endif /* !UNIV_HOTBACKUP */
#include "mach0data.h"
/*******************************************************************
@ -96,6 +98,7 @@ mtr_set_savepoint(
return(dyn_array_get_data_size(memo));
}
#ifndef UNIV_HOTBACKUP
/**************************************************************
Releases the (index tree) s-latch stored in an mtr memo after a
savepoint. */
@ -128,7 +131,7 @@ mtr_release_s_latch_at_savepoint(
slot->object = NULL;
}
#ifdef UNIV_DEBUG
# ifdef UNIV_DEBUG
/**************************************************************
Checks if memo contains the given item. */
UNIV_INLINE
@ -164,7 +167,8 @@ mtr_memo_contains(
return(FALSE);
}
#endif /* UNIV_DEBUG */
# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Returns the log object of a mini-transaction buffer. */
@ -227,6 +231,7 @@ mtr_set_log_mode(
return(old_mode);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Locks a lock in s-mode. */
UNIV_INLINE
@ -264,3 +269,4 @@ mtr_x_lock_func(
mtr_memo_push(mtr, lock, MTR_MEMO_X_LOCK);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -155,6 +155,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
@ -171,6 +172,7 @@ page_cur_tuple_insert(
dict_index_t* index, /* in: record descriptor */
ulint n_ext, /* in: number of externally stored columns */
mtr_t* mtr); /* in: mini-transaction handle, or NULL */
#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
@ -243,6 +245,7 @@ page_cur_delete_rec(
dict_index_t* index, /* in: record descriptor */
const ulint* offsets,/* in: rec_get_offsets(cursor->rec, index) */
mtr_t* mtr); /* in: mini-transaction handle */
#ifndef UNIV_HOTBACKUP
/********************************************************************
Searches the right position for a page cursor. */
UNIV_INLINE
@ -294,6 +297,7 @@ 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. */
UNIV_INTERN

View file

@ -197,6 +197,7 @@ page_cur_move_to_prev(
cur->rec = page_rec_get_prev(cur->rec);
}
#ifndef UNIV_HOTBACKUP
/********************************************************************
Searches the right position for a page cursor. */
UNIV_INLINE
@ -271,6 +272,7 @@ page_cur_tuple_insert(
mem_heap_free(heap);
return(rec);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Inserts a record next to page cursor. Returns pointer to inserted record if
@ -297,4 +299,3 @@ page_cur_rec_insert(
index, rec, offsets, mtr));
}
}

View file

@ -248,6 +248,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. */
@ -259,6 +260,7 @@ 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. */
UNIV_INLINE
@ -288,6 +290,7 @@ page_get_middle_rec(
/*================*/
/* out: middle record */
page_t* page); /* in: page */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Compares a data tuple to a physical record. Differs from the function
cmp_dtuple_rec_with_match in the way that the record must reside on an
@ -314,6 +317,7 @@ page_cmp_dtuple_rec_with_match(
bytes within the first field not completely
matched; when function returns contains the
value for current comparison */
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Gets the page number. */
UNIV_INLINE

View file

@ -23,7 +23,9 @@ Created 2/2/1994 Heikki Tuuri
*******************************************************/
#include "mach0data.h"
#include "rem0cmp.h"
#ifndef UNIV_HOTBACKUP
# include "rem0cmp.h"
#endif /* !UNIV_HOTBACKUP */
#include "mtr0log.h"
#include "page0zip.h"
@ -182,6 +184,7 @@ 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. */
@ -206,6 +209,7 @@ page_header_reset_last_insert(
MLOG_2BYTES, mtr);
}
}
#endif /* !UNIV_HOTBACKUP */
/****************************************************************
Determine whether the page is in new-style compact format. */
@ -405,6 +409,7 @@ page_rec_is_infimum(
return(page_rec_is_infimum_low(page_offset(rec)));
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Compares a data tuple to a physical record. Differs from the function
cmp_dtuple_rec_with_match in the way that the record must reside on an
@ -453,6 +458,7 @@ page_cmp_dtuple_rec_with_match(
matched_fields,
matched_bytes));
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Gets the page number. */

View file

@ -54,6 +54,7 @@ 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. */
UNIV_INLINE
@ -79,6 +80,7 @@ page_zip_empty_size(
ulint n_fields, /* in: number of columns in the index */
ulint zip_size) /* in: compressed page size in bytes */
__attribute__((const));
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Initialize a compressed page descriptor. */
@ -400,6 +402,7 @@ page_zip_reorganize(
dict_index_t* index, /* in: index of the B-tree node */
mtr_t* mtr) /* in: mini-transaction */
__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
@ -418,6 +421,7 @@ page_zip_copy_recs(
dict_index_t* index, /* in: index of the B-tree */
mtr_t* mtr) /* in: mini-transaction */
__attribute__((nonnull(1,2,3,4)));
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Parses a log record of compressing an index page. */

View file

@ -155,6 +155,7 @@ 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. */
UNIV_INLINE
@ -194,6 +195,7 @@ page_zip_rec_needs_ext(
return(rec_size >= page_get_free_space_of_empty(comp) / 2);
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/**************************************************************************
@ -388,7 +390,9 @@ page_zip_write_header(
/* ut_ad(page_zip_validate(page_zip, str - pos)); */
if (UNIV_LIKELY_NULL(mtr)) {
#ifndef UNIV_HOTBACKUP
page_zip_write_header_log(str, length, mtr);
#endif /* !UNIV_HOTBACKUP */
}
}

View file

@ -631,6 +631,7 @@ rec_copy(
void* buf, /* in: buffer */
const rec_t* rec, /* in: physical record */
const ulint* offsets);/* in: array returned by rec_get_offsets() */
#ifndef UNIV_HOTBACKUP
/******************************************************************
Copies the first n fields of a physical record to a new physical record in
a buffer. */
@ -663,6 +664,7 @@ rec_fold(
in an incomplete last field */
dulint tree_id) /* in: index tree id */
__attribute__((pure));
#endif /* !UNIV_HOTBACKUP */
/*************************************************************
Builds a ROW_FORMAT=COMPACT record out of a data tuple. */
UNIV_INTERN
@ -745,6 +747,7 @@ rec_get_converted_size(
dict_index_t* index, /* in: record descriptor */
const dtuple_t* dtuple, /* in: data tuple */
ulint n_ext); /* in: number of externally stored columns */
#ifndef UNIV_HOTBACKUP
/******************************************************************
Copies the first n fields of a physical record to a data tuple.
The fields are copied to the memory heap. */
@ -758,6 +761,7 @@ rec_copy_prefix_to_dtuple(
ulint n_fields, /* in: number of fields
to copy */
mem_heap_t* heap); /* in: memory heap */
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Validates the consistency of a physical record. */
UNIV_INTERN
@ -775,6 +779,7 @@ rec_print_old(
/*==========*/
FILE* file, /* in: file where to print */
const rec_t* rec); /* in: physical record */
#ifndef UNIV_HOTBACKUP
/*******************************************************************
Prints a physical record in ROW_FORMAT=COMPACT. Ignores the
record header. */
@ -803,6 +808,7 @@ rec_print(
FILE* file, /* in: file where to print */
const rec_t* rec, /* in: physical record */
dict_index_t* index); /* in: record descriptor */
#endif /* UNIV_HOTBACKUP */
#define REC_INFO_BITS 6 /* This is single byte bit-field */

View file

@ -1585,6 +1585,7 @@ rec_get_converted_size(
return(data_size + extra_size);
}
#ifndef UNIV_HOTBACKUP
/****************************************************************
Folds a prefix of a physical record to a ulint. Folds only existing fields,
that is, checks that we do not run out of the record. */
@ -1650,3 +1651,4 @@ rec_fold(
return(fold);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -27,13 +27,16 @@ Created 12/27/1996 Heikki Tuuri
#include "univ.i"
#include "data0data.h"
#include "row0types.h"
#include "btr0types.h"
#include "btr0pcur.h"
#include "dict0types.h"
#include "trx0types.h"
#include "que0types.h"
#include "row0types.h"
#include "pars0types.h"
#ifndef UNIV_HOTBACKUP
# include "btr0pcur.h"
# include "que0types.h"
# include "pars0types.h"
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Creates an update vector object. */
@ -66,6 +69,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
@ -161,6 +165,7 @@ row_upd_changes_field_size_or_external(
dict_index_t* index, /* in: index */
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
const upd_t* update);/* in: update vector */
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Replaces the new column values stored in the update vector to the record
given. No field size changes are allowed. */
@ -174,6 +179,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
@ -307,6 +313,7 @@ row_upd_step(
/*=========*/
/* out: query thread to run next or NULL */
que_thr_t* thr); /* in: query thread */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Parses the log data of system field values. */
UNIV_INTERN
@ -353,6 +360,7 @@ struct upd_field_struct{
a secondary index record in btr0cur.c
this is the position in the secondary
index */
#ifndef UNIV_HOTBACKUP
unsigned orig_len:16; /* original length of the locally
stored part of an externally stored
column, or 0 */
@ -360,6 +368,7 @@ struct upd_field_struct{
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 */
};
@ -371,6 +380,7 @@ struct upd_struct{
upd_field_t* fields; /* array of update fields */
};
#ifndef UNIV_HOTBACKUP
/* Update node structure which also implements the delete operation
of a row */
@ -468,6 +478,8 @@ struct upd_node_struct{
#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"
#endif

View file

@ -23,10 +23,12 @@ Created 12/27/1996 Heikki Tuuri
*******************************************************/
#include "mtr0log.h"
#include "trx0trx.h"
#include "trx0undo.h"
#include "row0row.h"
#include "btr0sea.h"
#ifndef UNIV_HOTBACKUP
# include "trx0trx.h"
# include "trx0undo.h"
# include "row0row.h"
# include "btr0sea.h"
#endif /* !UNIV_HOTBACKUP */
#include "page0zip.h"
/*************************************************************************
@ -84,6 +86,7 @@ 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
@ -177,3 +180,4 @@ row_upd_rec_sys_fields(
trx_write_roll_ptr(rec + offset + DATA_TRX_ID_LEN, roll_ptr);
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -33,6 +33,7 @@ Created 10/10/1995 Heikki Tuuri
#define srv0srv_h
#include "univ.i"
#ifndef UNIV_HOTBACKUP
#include "sync0sync.h"
#include "os0sync.h"
#include "que0types.h"
@ -89,6 +90,7 @@ extern ulint srv_check_file_format_at_startup;
/* Place locks to records only i.e. do not use next-key locking except
on duplicate key checking and foreign key checking */
extern ibool srv_locks_unsafe_for_binlog;
#endif /* !UNIV_HOTBACKUP */
extern ulint srv_n_data_files;
extern char** srv_data_file_names;
@ -97,15 +99,12 @@ extern ulint* srv_data_file_is_raw_partition;
extern ibool srv_auto_extend_last_data_file;
extern ulint srv_last_file_size_max;
extern char** srv_log_group_home_dirs;
#ifndef UNIV_HOTBACKUP
extern ulong srv_auto_extend_increment;
extern ibool srv_created_new_raw;
#define SRV_NEW_RAW 1
#define SRV_OLD_RAW 2
extern char** srv_log_group_home_dirs;
extern ulint srv_n_log_groups;
extern ulint srv_n_log_files;
extern ulint srv_log_file_size;
@ -284,6 +283,10 @@ typedef struct srv_sys_struct srv_sys_t;
/* The server system */
extern srv_sys_t* srv_sys;
#endif /* !UNIV_HOTBACKUP */
#define SRV_NEW_RAW 1
#define SRV_OLD_RAW 2
/* Alternatives for the file flush option in Unix; see the InnoDB manual
about what these mean */
@ -319,7 +322,7 @@ of lower numbers are included. */
as committed */
#define SRV_FORCE_NO_LOG_REDO 6 /* do not do the log roll-forward
in connection with recovery */
#ifndef UNIV_HOTBACKUP
/** Types of threads existing in the system. */
enum srv_thread_type {
SRV_COM = 1, /**< threads serving communication and queries */
@ -581,5 +584,16 @@ struct srv_sys_struct{
};
extern ulint srv_n_threads_active[];
#else /* !UNIV_HOTBACKUP */
# define srv_use_checksums TRUE
# define srv_use_adaptive_hash_indexes FALSE
# define srv_force_recovery 0UL
# define srv_set_io_thread_op_info(t,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 */
#endif

View file

@ -70,6 +70,7 @@ srv_add_path_separator_if_needed(
/* out: string which has the separator if the
string is not empty */
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. */
@ -111,6 +112,7 @@ extern ulint srv_shutdown_state;
#define SRV_SHUTDOWN_CLEANUP 1
#define SRV_SHUTDOWN_LAST_PHASE 2
#define SRV_SHUTDOWN_EXIT_THREADS 3
#endif /* !UNIV_HOTBACKUP */
/* Log 'spaces' have id's >= this */
#define SRV_LOG_SPACE_FIRST_ID 0xFFFFFFF0UL

View file

@ -33,6 +33,7 @@ Created 9/11/1995 Heikki Tuuri
#define sync0rw_h
#include "univ.i"
#ifndef UNIV_HOTBACKUP
#include "ut0lst.h"
#include "sync0sync.h"
#include "os0sync.h"
@ -40,6 +41,7 @@ Created 9/11/1995 Heikki Tuuri
/* The following undef is to prevent a name conflict with a macro
in MySQL: */
#undef rw_lock_t
#endif /* !UNIV_HOTBACKUP */
/* Latch types; these are used also in btr0btr.h: keep the numerical values
smaller than 30 and the order of the numerical values like below! */
@ -47,6 +49,7 @@ smaller than 30 and the order of the numerical values like below! */
#define RW_X_LATCH 2
#define RW_NO_LATCH 3
#ifndef UNIV_HOTBACKUP
/* We decrement lock_word by this amount 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. The current value of
@ -563,5 +566,6 @@ struct rw_lock_debug_struct {
#ifndef UNIV_NONINL
#include "sync0rw.ic"
#endif
#endif /* !UNIV_HOTBACKUP */
#endif

View file

@ -30,10 +30,12 @@ Created 3/26/1996 Heikki Tuuri
#include "row0types.h"
#include "mtr0mtr.h"
#include "dict0types.h"
#include "que0types.h"
#include "data0data.h"
#include "rem0types.h"
#ifndef UNIV_HOTBACKUP
# include "que0types.h"
/***************************************************************************
Copies the undo record to the heap. */
UNIV_INLINE
@ -281,6 +283,7 @@ trx_undo_prev_version_build(
rec_t** old_vers);/* out, own: previous version, or NULL if
rec is the first inserted version, or if
history data has been deleted */
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses a redo log record of adding an undo log record. */
UNIV_INTERN
@ -303,6 +306,8 @@ trx_undo_parse_erase_page_end(
page_t* page, /* in: page or NULL */
mtr_t* mtr); /* in: mtr or NULL */
#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 */
@ -330,4 +335,6 @@ record */
#include "trx0rec.ic"
#endif
#endif
#endif /* !UNIV_HOTBACKUP */
#endif /* trx0rec_h */

View file

@ -22,6 +22,7 @@ Transaction undo log record
Created 3/26/1996 Heikki Tuuri
*******************************************************/
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Reads from an undo log record the record type. */
UNIV_INLINE
@ -114,3 +115,4 @@ trx_undo_rec_copy(
return(rec_copy);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -28,16 +28,17 @@ Created 3/26/1996 Heikki Tuuri
#include "univ.i"
#include "trx0types.h"
#include "fsp0fsp.h"
#include "fil0fil.h"
#include "fut0lst.h"
#include "buf0buf.h"
#ifndef UNIV_HOTBACKUP
#include "mtr0mtr.h"
#include "mtr0log.h"
#include "ut0byte.h"
#include "mem0mem.h"
#include "sync0sync.h"
#include "ut0lst.h"
#include "buf0buf.h"
#include "fil0fil.h"
#include "fut0lst.h"
#include "fsp0fsp.h"
#include "read0types.h"
#include "page0types.h"
@ -219,6 +220,7 @@ dulint
trx_sys_get_new_trx_no(void);
/*========================*/
/* out: new, allocated trx number */
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************
Writes a trx id to an index page. In case that the id size changes in
some future version, this function should be used instead of
@ -229,6 +231,7 @@ trx_write_trx_id(
/*=============*/
byte* ptr, /* in: pointer to memory where written */
dulint id); /* in: id */
#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
@ -295,18 +298,6 @@ UNIV_INTERN
void
trx_sys_print_mysql_binlog_offset(void);
/*===================================*/
#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
UNIV_INTERN
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 */
#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL master log offset info in the trx system header if
the magic number shows it valid. */
@ -380,6 +371,18 @@ trx_sys_file_format_max_upgrade(
bigger than the known max id */
const char** name, /* out: max file format name */
ulint format_id); /* in: file format identifier */
#else /* !UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
UNIV_INTERN
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 */
#endif /* !UNIV_HOTBACKUP */
/* The automatically created system rollback segment has this id */
#define TRX_SYS_SYSTEM_RSEG_ID 0
@ -435,6 +438,7 @@ this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
within that file */
#define TRX_SYS_MYSQL_LOG_NAME 12 /* MySQL log file name */
#ifndef UNIV_HOTBACKUP
/* The offset of the doublewrite buffer header on the trx system header page */
#define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200)
/*-------------------------------------------------------------*/
@ -540,6 +544,7 @@ struct trx_sys_struct{
two) is assigned, the field TRX_SYS_TRX_ID_STORE on the transaction system
page is updated */
#define TRX_SYS_TRX_ID_WRITE_MARGIN 256
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL
#include "trx0sys.ic"

View file

@ -22,8 +22,10 @@ Transaction system
Created 3/26/1996 Heikki Tuuri
*******************************************************/
#include "srv0srv.h"
#include "trx0trx.h"
#include "data0type.h"
#ifndef UNIV_HOTBACKUP
# include "srv0srv.h"
/* The typedef for rseg slot in the file copy */
typedef byte trx_sysf_rseg_t;
@ -211,6 +213,7 @@ 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
@ -229,6 +232,7 @@ trx_write_trx_id(
mach_write_to_6(ptr, id);
}
#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
@ -381,3 +385,4 @@ trx_sys_get_new_trx_no(void)
return(trx_sys_get_new_trx_id());
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -27,12 +27,13 @@ Created 3/26/1996 Heikki Tuuri
#include "univ.i"
#include "trx0types.h"
#include "dict0types.h"
#ifndef UNIV_HOTBACKUP
#include "lock0types.h"
#include "usr0types.h"
#include "que0types.h"
#include "mem0mem.h"
#include "read0types.h"
#include "dict0types.h"
#include "trx0xa.h"
#include "ut0vec.h"
@ -799,5 +800,6 @@ struct commit_node_struct{
#ifndef UNIV_NONINL
#include "trx0trx.ic"
#endif
#endif /* !UNIV_HOTBACKUP */
#endif

View file

@ -32,6 +32,7 @@ Created 3/26/1996 Heikki Tuuri
#include "page0types.h"
#include "trx0xa.h"
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Builds a roll pointer dulint. */
UNIV_INLINE
@ -62,6 +63,7 @@ trx_undo_roll_ptr_is_insert(
/*========================*/
/* out: TRUE if insert undo log */
dulint roll_ptr); /* in: roll pointer */
#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
@ -82,6 +84,7 @@ trx_read_roll_ptr(
/*==============*/
/* out: 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. */
UNIV_INLINE
@ -298,6 +301,7 @@ void
trx_undo_insert_cleanup(
/*====================*/
trx_t* trx); /* in: transaction handle */
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses the redo log entry of an undo log page initialization. */
UNIV_INTERN
@ -350,6 +354,7 @@ trx_undo_parse_discard_latest(
#define TRX_UNDO_PREPARED 5 /* contains an undo log of an
prepared transaction */
#ifndef UNIV_HOTBACKUP
/* Transaction undo log memory object; this is protected by the undo_mutex
in the corresponding transaction object */
@ -408,6 +413,7 @@ struct trx_undo_struct{
/* undo log objects in the rollback
segment are chained into lists */
};
#endif /* !UNIV_HOTBACKUP */
/* The offset of the undo log page header on pages of the undo log */
#define TRX_UNDO_PAGE_HDR FSEG_PAGE_DATA

View file

@ -25,6 +25,7 @@ Created 3/26/1996 Heikki Tuuri
#include "data0type.h"
#include "page0page.h"
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Builds a roll pointer dulint. */
UNIV_INLINE
@ -101,6 +102,7 @@ trx_undo_roll_ptr_is_insert(
return(high / (256 * 256 * 128));
}
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************
Writes a roll ptr to an index page. In case that the size changes in
@ -136,6 +138,7 @@ trx_read_roll_ptr(
return(mach_read_from_7(ptr));
}
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Gets an undo log page and x-latches it. */
UNIV_INLINE
@ -342,3 +345,4 @@ trx_undo_page_get_first_rec(
return(undo_page + start);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -26,8 +26,9 @@ Created 5/30/1994 Heikki Tuuri
#define ut0mem_h
#include "univ.i"
#include "os0sync.h"
#include <string.h>
#ifndef UNIV_HOTBACKUP
# include "os0sync.h"
/* The total amount of memory currently allocated from the operating
system with os_mem_alloc_large() or malloc(). Does not count malloc()
@ -36,6 +37,7 @@ extern ulint ut_total_allocated_memory;
/* Mutex protecting ut_total_allocated_memory and ut_mem_block_list */
extern os_fast_mutex_t ut_list_mutex;
#endif /* !UNIV_HOTBACKUP */
UNIV_INLINE
void*
@ -79,6 +81,7 @@ ut_malloc(
/*======*/
/* out, own: allocated memory */
ulint n); /* in: number of bytes to allocate */
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Tests if malloc of n bytes would succeed. ut_malloc() asserts if memory runs
out. It cannot be used if we want to return an error message. Prints to
@ -89,6 +92,7 @@ ut_test_malloc(
/*===========*/
/* out: TRUE if succeeded */
ulint n); /* in: try to allocate this many bytes */
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Frees a memory block allocated with ut_malloc. */
UNIV_INTERN
@ -96,6 +100,7 @@ void
ut_free(
/*====*/
void* ptr); /* in, own: memory block */
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Implements realloc. This is needed by /pars/lexyy.c. Otherwise, you should not
use this function because the allocation functions in mem0mem.h are the
@ -133,6 +138,7 @@ UNIV_INTERN
void
ut_free_all_mem(void);
/*=================*/
#endif /* !UNIV_HOTBACKUP */
UNIV_INLINE
char*

View file

@ -230,7 +230,7 @@ ut_get_year_month_day(
ulint* year, /* out: current year */
ulint* month, /* out: month */
ulint* day); /* out: day */
#endif /* UNIV_HOTBACKUP */
#else /* UNIV_HOTBACKUP */
/*****************************************************************
Runs an idle loop on CPU. The argument gives the desired delay
in microseconds on 100 MHz Pentium + Visual C++. */
@ -240,6 +240,7 @@ ut_delay(
/*=====*/
/* out: dummy value */
ulint delay); /* in: delay in microseconds on 100 MHz Pentium */
#endif /* UNIV_HOTBACKUP */
/*****************************************************************
Prints the contents of a memory buffer in hex and ascii. */
UNIV_INTERN
@ -259,6 +260,7 @@ ut_print_filename(
FILE* f, /* in: output stream */
const char* name); /* in: name to print */
#ifndef UNIV_HOTBACKUP
/* Forward declaration of transaction handle */
struct trx_struct;
@ -301,6 +303,7 @@ ut_copy_file(
/*=========*/
FILE* dest, /* in: output file */
FILE* src); /* in: input file to be appended to output */
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
snprintf(). */

View file

@ -28,6 +28,7 @@ Created 12/9/1995 Heikki Tuuri
#include "log0log.ic"
#endif
#ifndef UNIV_HOTBACKUP
#include "mem0mem.h"
#include "buf0buf.h"
#include "buf0flu.h"
@ -75,8 +76,6 @@ UNIV_INTERN log_t* log_sys = NULL;
#ifdef UNIV_DEBUG
UNIV_INTERN ibool log_do_write = TRUE;
UNIV_INTERN ibool log_debug_writes = FALSE;
#endif /* UNIV_DEBUG */
/* These control how often we print warnings if the last checkpoint is too
@ -562,6 +561,11 @@ log_group_calc_lsn_offset(
return(log_group_calc_real_offset((ulint)offset, group));
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
UNIV_INTERN ibool log_debug_writes = FALSE;
#endif /* UNIV_DEBUG */
/***********************************************************************
Calculates where in log files we find a specified lsn. */
@ -603,6 +607,7 @@ log_calc_where_lsn_is(
return(file_no);
}
#ifndef UNIV_HOTBACKUP
/************************************************************
Sets the field values in group to correspond to a given lsn. For this function
to work, the values must already be correctly initialized to correspond to
@ -611,7 +616,7 @@ UNIV_INTERN
void
log_group_set_fields(
/*=================*/
log_group_t* group, /* in: group */
log_group_t* group, /* in/out: group */
ib_uint64_t lsn) /* in: lsn for which the values should be
set */
{
@ -1799,6 +1804,7 @@ log_group_checkpoint(
ut_ad(((ulint)group & 0x1UL) == 0);
}
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_HOTBACKUP
/**********************************************************
@ -1854,6 +1860,7 @@ log_reset_first_header_and_checkpoint(
}
#endif /* UNIV_HOTBACKUP */
#ifndef UNIV_HOTBACKUP
/**********************************************************
Reads a checkpoint info from a log group header to log_sys->checkpoint_buf. */
UNIV_INTERN
@ -3306,3 +3313,4 @@ log_refresh_stats(void)
log_sys->n_log_ios_old = log_sys->n_log_ios;
log_sys->last_printout_time = time(NULL);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -31,25 +31,30 @@ Created 9/20/1997 Heikki Tuuri
#include "mem0mem.h"
#include "buf0buf.h"
#include "buf0flu.h"
#include "buf0rea.h"
#include "srv0srv.h"
#include "srv0start.h"
#include "mtr0mtr.h"
#include "mtr0log.h"
#include "page0cur.h"
#include "page0zip.h"
#include "btr0btr.h"
#include "btr0cur.h"
#include "ibuf0ibuf.h"
#include "trx0undo.h"
#include "trx0rec.h"
#include "trx0roll.h"
#include "row0merge.h"
#include "fil0fil.h"
#ifndef UNIV_HOTBACKUP
# include "buf0rea.h"
# include "srv0srv.h"
# include "srv0start.h"
# include "trx0roll.h"
# include "row0merge.h"
# include "sync0sync.h"
#else /* !UNIV_HOTBACKUP */
#ifdef UNIV_HOTBACKUP
/* This is set to FALSE if the backup was originally taken with the
ibbackup --include regexp option: then we do not want to create tables in
directories which were not included */
UNIV_INTERN ibool recv_replay_file_ops = TRUE;
#endif /* UNIV_HOTBACKUP */
#endif /* !UNIV_HOTBACKUP */
/* 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 */
@ -64,6 +69,7 @@ UNIV_INTERN ibool recv_recovery_on = FALSE;
UNIV_INTERN ibool recv_recovery_from_backup_on = FALSE;
#endif /* UNIV_LOG_ARCHIVE */
#ifndef UNIV_HOTBACKUP
UNIV_INTERN ibool recv_needed_recovery = FALSE;
UNIV_INTERN ibool recv_lsn_checks_on = FALSE;
@ -89,18 +95,18 @@ buffer pool before the pages have been recovered to the up-to-date state */
yet: the variable name is misleading */
UNIV_INTERN ibool recv_no_ibuf_operations = FALSE;
# define recv_is_making_a_backup FALSE
# define recv_is_from_backup FALSE
#else /* !UNIV_HOTBACKUP */
# define recv_needed_recovery FALSE
UNIV_INTERN ibool recv_is_making_a_backup = FALSE;
UNIV_INTERN ibool 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 */
UNIV_INTERN ulint recv_scan_print_counter = 0;
UNIV_INTERN ibool recv_is_from_backup = FALSE;
#ifdef UNIV_HOTBACKUP
UNIV_INTERN ibool recv_is_making_a_backup = FALSE;
#else
# define recv_is_making_a_backup FALSE
#endif /* UNIV_HOTBACKUP */
UNIV_INTERN ulint recv_previous_parsed_rec_type = 999999;
UNIV_INTERN ulint recv_previous_parsed_rec_offset = 0;
UNIV_INTERN ulint recv_previous_parsed_rec_is_multi = 0;
@ -122,6 +128,7 @@ UNIV_INTERN ib_uint64_t recv_max_page_lsn;
/* prototypes */
#ifndef UNIV_HOTBACKUP
/***********************************************************
Initialize crash recovery environment. Can be called iff
recv_needed_recovery == FALSE. */
@ -129,6 +136,7 @@ static
void
recv_init_crash_recovery(void);
/*===========================*/
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Creates the recovery system. */
@ -219,7 +227,8 @@ recv_sys_empty_hash(void)
recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256);
}
#ifndef UNIV_LOG_DEBUG
#ifndef UNIV_HOTBACKUP
# ifndef UNIV_LOG_DEBUG
/************************************************************
Frees the recovery system. */
static
@ -239,7 +248,7 @@ recv_sys_free(void)
mutex_exit(&(recv_sys->mutex));
}
#endif /* UNIV_LOG_DEBUG */
# endif /* UNIV_LOG_DEBUG */
/************************************************************
Truncates possible corrupted or extra records from a log group. */
@ -459,6 +468,7 @@ recv_synchronize_groups(
mutex_enter(&(log_sys->mutex));
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************************
Checks the consistency of the checkpoint info */
@ -466,8 +476,8 @@ static
ibool
recv_check_cp_is_consistent(
/*========================*/
/* out: TRUE if ok */
byte* buf) /* in: buffer containing checkpoint info */
/* out: TRUE if ok */
const byte* buf) /* in: buffer containing checkpoint info */
{
ulint fold;
@ -489,6 +499,7 @@ recv_check_cp_is_consistent(
return(TRUE);
}
#ifndef UNIV_HOTBACKUP
/************************************************************
Looks for the maximum consistent checkpoint from the log groups. */
static
@ -589,8 +600,7 @@ not_consistent:
return(DB_SUCCESS);
}
#ifdef UNIV_HOTBACKUP
#else /* !UNIV_HOTBACKUP */
/***********************************************************************
Reads the checkpoint info needed in hot backup. */
UNIV_INTERN
@ -598,7 +608,7 @@ ibool
recv_read_cp_info_for_backup(
/*=========================*/
/* out: TRUE if success */
byte* hdr, /* in: buffer containing the log group
const byte* hdr, /* in: buffer containing the log group
header */
ib_uint64_t* lsn, /* out: checkpoint lsn */
ulint* offset, /* out: checkpoint offset in the log group */
@ -612,7 +622,7 @@ recv_read_cp_info_for_backup(
{
ulint max_cp = 0;
ib_uint64_t max_cp_no = 0;
byte* cp_buf;
const byte* cp_buf;
cp_buf = hdr + LOG_CHECKPOINT_1;
@ -661,7 +671,7 @@ recv_read_cp_info_for_backup(
return(TRUE);
}
#endif /* UNIV_HOTBACKUP */
#endif /* !UNIV_HOTBACKUP */
/**********************************************************
Checks the 4-byte checksum to the trailer checksum field of a log block.
@ -1496,6 +1506,7 @@ recv_recover_page_func(
mtr_commit(&mtr);
}
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Reads in pages which have hashed log records, from an area around a given
page number. */
@ -1692,8 +1703,7 @@ loop:
mutex_exit(&(recv_sys->mutex));
}
#ifdef UNIV_HOTBACKUP
#else /* !UNIV_HOTBACKUP */
/***********************************************************************
Applies log records in the hash table to a backup. */
UNIV_INTERN
@ -1712,7 +1722,7 @@ recv_apply_log_recs_for_backup(void)
recv_sys->apply_log_recs = TRUE;
recv_sys->apply_batch_on = TRUE;
block = buf_LRU_get_free_block(UNIV_PAGE_SIZE);
block = back_block1;
fputs("InnoDB: Starting an apply batch of log records"
" to the database...\n"
@ -1780,6 +1790,10 @@ recv_apply_log_recs_for_backup(void)
recv_addr->space, zip_size,
recv_addr->page_no, 0, zip_size,
block->page.zip.data, NULL);
if (error == DB_SUCCESS
&& !buf_zip_decompress(block, TRUE)) {
exit(1);
}
} else {
error = fil_io(OS_FILE_READ, TRUE,
recv_addr->space, 0,
@ -1834,10 +1848,9 @@ skip_this_recv_addr:
}
}
buf_block_free(block);
recv_sys_empty_hash();
}
#endif /* UNIV_HOTBACKUP */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************
Tries to parse a single log record and returns its length. */
@ -2485,6 +2498,7 @@ recv_scan_log_recs(
of startup type, we must initiate crash recovery
environment before parsing these log records. */
#ifndef UNIV_HOTBACKUP
if (recv_log_scan_is_startup_type
&& !recv_needed_recovery) {
@ -2494,6 +2508,7 @@ recv_scan_log_recs(
recv_sys->scanned_lsn);
recv_init_crash_recovery();
}
#endif /* !UNIV_HOTBACKUP */
/* We were able to find more log data: add it to the
parsing buffer if parse_start_lsn is already
@ -2571,6 +2586,7 @@ 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. */
@ -3164,6 +3180,7 @@ recv_reset_logs(
mutex_enter(&(log_sys->mutex));
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_HOTBACKUP
/**********************************************************

View file

@ -24,10 +24,12 @@ Created 6/9/1994 Heikki Tuuri
*************************************************************************/
#ifdef UNIV_MEM_DEBUG
# ifndef UNIV_HOTBACKUP
/* The mutex which protects in the debug version the hash table
containing the list of live memory heaps, and also the global
variables below. */
UNIV_INTERN mutex_t mem_hash_mutex;
# endif /* !UNIV_HOTBACKUP */
/* The following variables contain information about the
extent of memory allocations. Only used in the debug version.
@ -38,7 +40,10 @@ static ulint mem_n_allocations = 0;
static ulint mem_total_allocated_memory = 0;
UNIV_INTERN ulint mem_current_allocated_memory = 0;
static ulint mem_max_allocated_memory = 0;
# ifndef UNIV_HOTBACKUP
static ulint mem_last_print_info = 0;
static ibool mem_hash_initialized = FALSE;
# endif /* !UNIV_HOTBACKUP */
/* Size of the hash table for memory management tracking */
#define MEM_HASH_SIZE 997
@ -65,7 +70,6 @@ static mem_hash_cell_t mem_hash_table[MEM_HASH_SIZE];
/* The base node of the list of all allocated heaps */
static mem_hash_cell_t mem_all_list_base;
static ibool mem_hash_initialized = FALSE;
UNIV_INLINE
@ -128,6 +132,7 @@ mem_field_trailer_get_check(byte* field)
}
#endif /* UNIV_MEM_DEBUG */
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Initializes the memory system. */
UNIV_INTERN
@ -164,6 +169,7 @@ mem_init(
mem_comm_pool = mem_pool_create(size);
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_MEM_DEBUG
/**********************************************************************
@ -683,8 +689,9 @@ mem_all_freed(void)
mutex_exit(&mem_hash_mutex);
if (heap_count == 0) {
# ifndef UNIV_HOTBACKUP
ut_a(mem_pool_get_reserved(mem_comm_pool) == 0);
# endif /* !UNIV_HOTBACKUP */
return(TRUE);
} else {
@ -709,7 +716,9 @@ mem_validate_no_assert(void)
ulint n_blocks;
ulint i;
# ifndef UNIV_HOTBACKUP
mem_pool_validate(mem_comm_pool);
# endif /* !UNIV_HOTBACKUP */
mutex_enter(&mem_hash_mutex);
@ -887,6 +896,7 @@ mem_analyze_corruption(
}
}
#ifndef UNIV_HOTBACKUP
/*********************************************************************
Prints information of dynamic memory usage and currently allocated
memory heaps or buffers. Can only be used in the debug version. */
@ -1012,3 +1022,4 @@ mem_print_new_info(void)
{
mem_print_info_low(FALSE);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -331,7 +331,9 @@ mem_heap_create_block(
const char* file_name,/* in: file name where created */
ulint line) /* in: line where created */
{
#ifndef UNIV_HOTBACKUP
buf_block_t* buf_block = NULL;
#endif /* !UNIV_HOTBACKUP */
mem_block_t* block;
ulint len;
@ -345,6 +347,7 @@ mem_heap_create_block(
/* 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);
@ -374,6 +377,13 @@ mem_heap_create_block(
ut_ad(block);
block->buf_block = buf_block;
block->free_block = NULL;
#else /* !UNIV_HOTBACKUP */
len = MEM_BLOCK_HEADER_SIZE + MEM_SPACE_NEEDED(n);
block = ut_malloc(len);
ut_ad(block);
#endif /* !UNIV_HOTBACKUP */
block->magic_n = MEM_BLOCK_MAGIC_N;
ut_strlcpy_rev(block->file_name, file_name, sizeof(block->file_name));
block->line = line;
@ -395,8 +405,6 @@ mem_heap_create_block(
mem_block_set_free(block, MEM_BLOCK_HEADER_SIZE);
mem_block_set_start(block, MEM_BLOCK_HEADER_SIZE);
block->free_block = NULL;
ut_ad((ulint)MEM_BLOCK_HEADER_SIZE < len);
return(block);
@ -469,7 +477,9 @@ mem_heap_block_free(
{
ulint type;
ulint len;
buf_block_t* buf_block;
#ifndef UNIV_HOTBACKUP
buf_block_t* buf_block = block->buf_block;
#endif /* !UNIV_HOTBACKUP */
if (block->magic_n != MEM_BLOCK_MAGIC_N) {
mem_analyze_corruption(block);
@ -486,7 +496,6 @@ mem_heap_block_free(
#endif
type = heap->type;
len = block->len;
buf_block = block->buf_block;
block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
#ifdef UNIV_MEM_DEBUG
@ -498,6 +507,7 @@ mem_heap_block_free(
UNIV_MEM_ASSERT_AND_FREE(block, len);
#endif /* UNIV_MEM_DEBUG */
#ifndef UNIV_HOTBACKUP
if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) {
ut_ad(!buf_block);
@ -507,8 +517,12 @@ 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. */
UNIV_INTERN
@ -524,6 +538,7 @@ mem_heap_free_block_free(
heap->free_block = NULL;
}
}
#endif /* !UNIV_HOTBACKUP */
#ifdef MEM_PERIODIC_CHECK
/**********************************************************************

View file

@ -29,10 +29,13 @@ Created 12/7/1995 Heikki Tuuri
#endif
#include "buf0buf.h"
#include "dict0boot.h"
#include "dict0dict.h"
#include "log0recv.h"
#include "page0page.h"
#ifndef UNIV_HOTBACKUP
# include "dict0boot.h"
/************************************************************
Catenates n bytes to the mtr log. */
UNIV_INTERN
@ -86,6 +89,7 @@ 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. */
@ -236,6 +240,7 @@ mlog_parse_nbytes(
return(ptr);
}
#ifndef UNIV_HOTBACKUP
/************************************************************
Writes 1 - 4 bytes to a file page buffered in the buffer pool.
Writes the corresponding log record to the mini-transaction log. */
@ -374,6 +379,7 @@ mlog_log_string(
mlog_catenate_string(mtr, ptr, len);
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Parses a log record written by mlog_write_string. */
@ -426,6 +432,7 @@ 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. */
@ -523,6 +530,7 @@ mlog_open_and_write_index(
}
return(log_ptr);
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Parses a log record written by mlog_open_and_write_index. */

View file

@ -33,6 +33,7 @@ Created 11/26/1995 Heikki Tuuri
#include "mtr0log.h"
#include "log0log.h"
#ifndef UNIV_HOTBACKUP
/*********************************************************************
Releases the item in the slot given. */
UNIV_INLINE
@ -160,6 +161,7 @@ mtr_log_reserve_and_write(
mtr->end_lsn = log_close();
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Commits a mini-transaction. */
@ -169,13 +171,16 @@ mtr_commit(
/*=======*/
mtr_t* mtr) /* in: mini-transaction */
{
#ifndef UNIV_HOTBACKUP
ibool write_log;
#endif /* !UNIV_HOTBACKUP */
ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_ACTIVE);
ut_d(mtr->state = MTR_COMMITTING);
#ifndef UNIV_HOTBACKUP
write_log = mtr->modifications && mtr->n_log_recs;
if (write_log) {
@ -195,12 +200,14 @@ mtr_commit(
if (write_log) {
log_release();
}
#endif /* !UNIV_HOTBACKUP */
ut_d(mtr->state = MTR_COMMITTED);
dyn_array_free(&(mtr->memo));
dyn_array_free(&(mtr->log));
}
#ifndef UNIV_HOTBACKUP
/**************************************************************
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
@ -270,6 +277,7 @@ mtr_memo_release(
}
}
}
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Reads 1 - 4 bytes from a file page buffered in the buffer pool. */
@ -314,6 +322,7 @@ mtr_read_dulint(
}
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**************************************************************
Checks if memo contains the given page. */
UNIV_INTERN
@ -342,4 +351,5 @@ mtr_print(
(ulong) dyn_array_get_data_size(&(mtr->memo)),
(ulong) dyn_array_get_data_size(&(mtr->log)));
}
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */

View file

@ -30,6 +30,7 @@ Created 10/4/1994 Heikki Tuuri
#include "page0zip.h"
#include "mtr0log.h"
#include "log0recv.h"
#ifndef UNIV_HOTBACKUP
#include "rem0cmp.h"
static ulint page_rnd = 976722341;
@ -713,6 +714,9 @@ 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. */
@ -1466,6 +1470,7 @@ use_heap:
return(insert_rec);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************
Writes a log record of copying a record list end to a new created page. */
UNIV_INLINE
@ -1493,6 +1498,7 @@ 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. */
@ -1550,6 +1556,7 @@ 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. */
@ -1753,6 +1760,9 @@ 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. */

View file

@ -31,12 +31,14 @@ Created 2/2/1994 Heikki Tuuri
#include "page0cur.h"
#include "page0zip.h"
#include "lock0lock.h"
#include "fut0lst.h"
#include "btr0sea.h"
#include "buf0buf.h"
#include "srv0srv.h"
#include "btr0btr.h"
#ifndef UNIV_HOTBACKUP
# include "srv0srv.h"
# include "lock0lock.h"
# include "fut0lst.h"
# include "btr0sea.h"
#endif /* !UNIV_HOTBACKUP */
/* THE INDEX PAGE
==============
@ -209,12 +211,14 @@ page_set_max_trx_id(
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
dulint trx_id) /* in: transaction id */
{
const ibool is_hashed = block->is_hashed;
page_t* page = buf_block_get_frame(block);
#ifndef UNIV_HOTBACKUP
const ibool is_hashed = block->is_hashed;
if (is_hashed) {
rw_lock_x_lock(&btr_search_latch);
}
#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
@ -227,9 +231,11 @@ page_set_max_trx_id(
8, NULL);
}
#ifndef UNIV_HOTBACKUP
if (is_hashed) {
rw_lock_x_unlock(&btr_search_latch);
}
#endif /* !UNIV_HOTBACKUP */
}
/****************************************************************
@ -271,6 +277,7 @@ page_mem_alloc_heap(
return(NULL);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************
Writes a log record of page creation. */
UNIV_INLINE
@ -286,6 +293,9 @@ page_create_write_log(
? MLOG_COMP_PAGE_CREATE
: MLOG_PAGE_CREATE, mtr);
}
#else /* !UNIV_HOTBACKUP */
# define page_create_write_log(frame,mtr,comp) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses a redo log record of creating a page. */
@ -584,6 +594,7 @@ 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.
@ -827,6 +838,9 @@ 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. */
@ -1132,6 +1146,7 @@ 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. */
@ -1233,6 +1248,7 @@ page_rec_write_index_page_no(
mlog_write_ulint(data, page_no, MLOG_4BYTES, mtr);
}
#endif /* !UNIV_HOTBACKUP */
/******************************************************************
Used to delete n slots from the directory. This function updates
@ -1444,6 +1460,7 @@ page_dir_balance_slot(
}
}
#ifndef UNIV_HOTBACKUP
/****************************************************************
Returns the middle record of the record list. If there are an even number
of records in the list, returns the first record of the upper half-list. */
@ -1491,6 +1508,7 @@ page_get_middle_rec(
return(rec);
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Returns the number of records before the given record in chain.
@ -1556,6 +1574,7 @@ 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. */
@ -1746,6 +1765,7 @@ page_print(
page_dir_print(page, dn);
page_print_list(block, index, rn);
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
The following is used to validate a record on a page. This function
@ -1795,6 +1815,7 @@ page_rec_validate(
return(TRUE);
}
#ifndef UNIV_HOTBACKUP
/*******************************************************************
Checks that the first directory slot points to the infimum record and
the last to the supremum. This function is intended to track if the
@ -1830,6 +1851,7 @@ page_check_dir(
buf_page_print(page, 0);
}
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
This function checks the consistency of an index page when we do not
@ -2526,6 +2548,7 @@ func_exit2:
return(ret);
}
#ifndef UNIV_HOTBACKUP
/*******************************************************************
Looks in the page record list for a record with the given heap number. */
UNIV_INTERN
@ -2572,3 +2595,4 @@ page_find_rec_with_heap_no(
}
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -31,15 +31,20 @@ Created June 2005 by Marko Makela
#include "page0page.h"
#include "mtr0log.h"
#include "ut0sort.h"
#include "dict0boot.h"
#include "dict0dict.h"
#include "btr0sea.h"
#include "btr0cur.h"
#include "page0types.h"
#include "lock0lock.h"
#include "log0recv.h"
#include "zlib.h"
#include "buf0lru.h"
#ifndef UNIV_HOTBACKUP
# include "buf0lru.h"
# include "btr0sea.h"
# include "dict0boot.h"
# include "lock0lock.h"
#else /* !UNIV_HOTBACKUP */
# define lock_move_reorganize_page(block, temp_block) ((void) 0)
# define buf_LRU_stat_inc_unzip() ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
@ -106,6 +111,7 @@ 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. */
UNIV_INTERN
@ -129,6 +135,7 @@ page_zip_empty_size(
- compressBound(2 * (n_fields + 1));
return(size > 0 ? (ulint) size : 0);
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Gets the size of the compressed page trailer (the dense page directory),
@ -251,6 +258,7 @@ page_zip_dir_get(
- PAGE_ZIP_DIR_SLOT_SIZE * (slot + 1)));
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Write a log record of compressing an index page. */
static
@ -312,6 +320,7 @@ 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
@ -1360,7 +1369,9 @@ 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));
@ -3610,6 +3621,7 @@ 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)) {
@ -3625,6 +3637,7 @@ 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 */
}
}
@ -3752,6 +3765,7 @@ 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)) {
@ -3767,6 +3781,7 @@ 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 */
}
}
@ -4286,6 +4301,7 @@ corrupt:
return(ptr + len);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Write a log record of writing to the uncompressed header portion of a page. */
UNIV_INTERN
@ -4320,6 +4336,7 @@ 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
@ -4359,10 +4376,15 @@ page_zip_reorganize(
/* Disable logging */
log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
#ifndef UNIV_HOTBACKUP
temp_block = buf_block_alloc(0);
temp_page = temp_block->frame;
btr_search_drop_page_hash_index(block);
block->check_index_page_at_flush = TRUE;
#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 */
buf_frame_copy(temp_page, page);
@ -4371,7 +4393,6 @@ page_zip_reorganize(
segment headers, next page-field, etc.) is preserved intact */
page_create(block, mtr, TRUE);
block->check_index_page_at_flush = TRUE;
/* Copy the records from the temporary space to the recreated page;
do not copy the lock bits yet */
@ -4390,16 +4411,21 @@ page_zip_reorganize(
/* Restore the old page and exit. */
buf_frame_copy(page, temp_page);
#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
@ -4486,6 +4512,7 @@ page_zip_copy_recs(
page_zip_compress_write_log(page_zip, page, index, mtr);
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Parses a log record of compressing an index page. */

View file

@ -1623,6 +1623,7 @@ rec_print_old(
rec_validate_old(rec);
}
#ifndef UNIV_HOTBACKUP
/*******************************************************************
Prints a physical record in ROW_FORMAT=COMPACT. Ignores the
record header. */
@ -1718,3 +1719,4 @@ rec_print(
}
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -29,10 +29,12 @@ Created 12/27/1996 Heikki Tuuri
#endif
#include "dict0dict.h"
#include "trx0undo.h"
#include "rem0rec.h"
#ifndef UNIV_HOTBACKUP
#include "dict0boot.h"
#include "dict0crea.h"
#include "mach0data.h"
#include "trx0undo.h"
#include "btr0btr.h"
#include "btr0cur.h"
#include "que0que.h"
@ -313,6 +315,7 @@ upd_node_create(
return(node);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Updates the trx id and roll ptr field in a clustered index record in database
@ -347,6 +350,7 @@ row_upd_rec_sys_fields_in_recovery(
}
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Sets the trx id or roll ptr field of a clustered index entry. */
UNIV_INTERN
@ -445,6 +449,7 @@ row_upd_changes_field_size_or_external(
return(FALSE);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Replaces the new column values stored in the update vector to the record
@ -491,6 +496,7 @@ 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. */
@ -520,6 +526,7 @@ row_upd_write_sys_vals_to_log(
return(log_ptr);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Parses the log data of system field values. */
@ -554,6 +561,7 @@ row_upd_parse_sys_vals(
return(ptr);
}
#ifndef UNIV_HOTBACKUP
/***************************************************************
Writes to the redo log the new values of the fields occurring in the index. */
UNIV_INTERN
@ -624,6 +632,7 @@ row_upd_index_write_log(
mlog_close(mtr, log_ptr);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Parses the log data written by row_upd_index_write_log. */
@ -704,6 +713,7 @@ row_upd_index_parse(
return(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
@ -2166,3 +2176,4 @@ error_handling:
return(thr);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -29,54 +29,53 @@ Starts the InnoDB database server
Created 2/16/1996 Heikki Tuuri
*************************************************************************/
#include "os0proc.h"
#include "sync0sync.h"
#include "ut0mem.h"
#include "mem0mem.h"
#include "data0data.h"
#include "data0type.h"
#include "dict0dict.h"
#include "buf0buf.h"
#include "buf0flu.h"
#include "buf0rea.h"
#include "os0file.h"
#include "os0thread.h"
#include "fil0fil.h"
#include "fsp0fsp.h"
#include "rem0rec.h"
#include "rem0cmp.h"
#include "mtr0mtr.h"
#include "log0log.h"
#include "log0recv.h"
#include "page0page.h"
#include "page0cur.h"
#include "trx0trx.h"
#include "dict0boot.h"
#include "dict0load.h"
#include "trx0sys.h"
#include "dict0crea.h"
#include "btr0btr.h"
#include "btr0pcur.h"
#include "btr0cur.h"
#include "btr0sea.h"
#include "rem0rec.h"
#include "srv0srv.h"
#include "que0que.h"
#include "usr0sess.h"
#include "lock0lock.h"
#include "trx0roll.h"
#include "trx0purge.h"
#include "row0ins.h"
#include "row0sel.h"
#include "row0upd.h"
#include "row0row.h"
#include "row0mysql.h"
#include "lock0lock.h"
#include "ibuf0ibuf.h"
#include "pars0pars.h"
#include "btr0sea.h"
#include "srv0start.h"
#include "que0que.h"
#include "srv0srv.h"
#ifndef UNIV_HOTBACKUP
# include "os0proc.h"
# include "sync0sync.h"
# include "buf0flu.h"
# include "buf0rea.h"
# include "dict0boot.h"
# include "dict0load.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 "btr0pcur.h"
/* Log sequence number immediately after startup */
UNIV_INTERN ib_uint64_t srv_start_lsn;
@ -93,15 +92,12 @@ UNIV_INTERN ibool srv_start_raw_disk_in_use = FALSE;
UNIV_INTERN ibool srv_startup_is_before_trx_rollback_phase = FALSE;
UNIV_INTERN ibool srv_is_being_started = FALSE;
UNIV_INTERN ibool srv_was_started = FALSE;
#ifndef UNIV_HOTBACKUP
static ibool srv_start_has_been_called = FALSE;
#endif /* !UNIV_HOTBACKUP */
/* At a shutdown the value first climbs to SRV_SHUTDOWN_CLEANUP
and then to SRV_SHUTDOWN_LAST_PHASE */
UNIV_INTERN ulint srv_shutdown_state = 0;
#ifndef UNIV_HOTBACKUP
static os_file_t files[1000];
static mutex_t ios_mutex;
@ -445,7 +441,6 @@ srv_free_paths_and_sizes(void)
/************************************************************************
I/o-handler thread function. */
static
os_thread_ret_t
io_handler_thread(
/*==============*/

View file

@ -30,15 +30,16 @@ Created 3/26/1996 Heikki Tuuri
#include "fsp0fsp.h"
#include "mach0data.h"
#include "trx0rseg.h"
#include "trx0trx.h"
#include "trx0undo.h"
#include "mtr0log.h"
#ifndef UNIV_HOTBACKUP
#include "dict0dict.h"
#include "ut0mem.h"
#include "row0ext.h"
#include "row0upd.h"
#include "que0que.h"
#include "trx0purge.h"
#include "trx0rseg.h"
#include "row0row.h"
/*=========== UNDO LOG RECORD CREATION AND DECODING ====================*/
@ -82,6 +83,7 @@ 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. */
@ -130,6 +132,7 @@ trx_undo_parse_add_undo_rec(
return(ptr + len);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Calculates the free space left for extending an undo log record. */
UNIV_INLINE
@ -1092,6 +1095,7 @@ trx_undo_rec_get_partial_row(
return(ptr);
}
#endif /* !UNIV_HOTBACKUP */
/***************************************************************************
Erases the unused undo log page end. */
@ -1136,6 +1140,7 @@ 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
@ -1605,3 +1610,4 @@ trx_undo_prev_version_build(
return(DB_SUCCESS);
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -28,6 +28,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0sys.ic"
#endif
#ifndef UNIV_HOTBACKUP
#include "fsp0fsp.h"
#include "mtr0mtr.h"
#include "trx0trx.h"
@ -713,41 +714,6 @@ trx_sys_update_mysql_binlog_offset(
MLOG_4BYTES, mtr);
}
#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
UNIV_INTERN
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) {
fprintf(stderr,
"ibbackup: Last MySQL binlog file position %lu %lu,"
" file name %s\n",
(ulong) mach_read_from_4(
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
(ulong) mach_read_from_4(
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_OFFSET_LOW),
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_NAME);
}
}
#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Stores the MySQL binlog offset info in the trx system header if
the magic number shows it valid, and print the info to stderr */
@ -1330,3 +1296,37 @@ trx_sys_file_format_close(void)
{
/* Does nothing at the moment */
}
#else /* !UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
UNIV_INTERN
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) {
fprintf(stderr,
"ibbackup: Last MySQL binlog file position %lu %lu,"
" file name %s\n",
(ulong) mach_read_from_4(
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
(ulong) mach_read_from_4(
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_OFFSET_LOW),
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_NAME);
}
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -29,13 +29,13 @@ Created 3/26/1996 Heikki Tuuri
#endif
#include "fsp0fsp.h"
#ifndef UNIV_HOTBACKUP
#include "mach0data.h"
#include "trx0rseg.h"
#include "trx0trx.h"
#include "srv0srv.h"
#include "trx0rec.h"
#include "trx0purge.h"
#include "trx0xa.h"
/* How should the old versions in the history list be managed?
----------------------------------------------------------
@ -91,6 +91,7 @@ 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. */
@ -101,6 +102,8 @@ trx_undo_page_init(
page_t* undo_page, /* in: undo log segment page */
ulint type, /* in: undo log segment type */
mtr_t* mtr); /* in: mtr */
#ifndef UNIV_HOTBACKUP
/************************************************************************
Creates and initializes an undo log memory object. */
static
@ -117,6 +120,7 @@ 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
@ -140,7 +144,7 @@ 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. */
static
@ -347,6 +351,9 @@ 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. */
@ -402,6 +409,7 @@ trx_undo_page_init(
trx_undo_page_init_log(undo_page, type, mtr);
}
#ifndef UNIV_HOTBACKUP
/*******************************************************************
Creates a new undo log segment in file. */
static
@ -514,6 +522,9 @@ trx_undo_header_create_log(
mlog_catenate_dulint_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
@ -587,6 +598,7 @@ trx_undo_header_create(
return(free);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Write X/Open XA Transaction Identification (XID) to undo log header */
static
@ -681,6 +693,9 @@ trx_undo_insert_header_reuse_log(
mlog_catenate_dulint_compressed(mtr, trx_id);
}
#else /* !UNIV_HOTBACKUP */
# define trx_undo_insert_header_reuse_log(undo_page,trx_id,mtr) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
/***************************************************************
Parses the redo log entry of an undo log page header create or reuse. */
@ -776,6 +791,7 @@ trx_undo_insert_header_reuse(
return(free);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Writes the redo log entry of an update undo log header discard. */
UNIV_INLINE
@ -787,6 +803,9 @@ 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. */
@ -851,6 +870,7 @@ 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. */
UNIV_INTERN
@ -1981,3 +2001,4 @@ trx_undo_insert_cleanup(
mutex_exit(&(rseg->mutex));
}
#endif /* !UNIV_HOTBACKUP */

View file

@ -57,10 +57,15 @@ 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 %lu"
" in file %s line %lu\n",
os_thread_pf(os_thread_get_curr_id()), file, line);
#endif /* UNIV_HOTBACKUP */
if (expr) {
fprintf(stderr,
"InnoDB: Failing assertion: %s\n", expr);
@ -106,9 +111,11 @@ ut_dbg_stop_thread(
const char* file,
ulint line)
{
#ifndef UNIV_HOTBACKUP
fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n",
os_thread_pf(os_thread_get_curr_id()), file, line);
os_thread_sleep(1000000000);
#endif /* !UNIV_HOTBACKUP */
}
# endif
#endif /* __NETWARE__ */

View file

@ -28,9 +28,9 @@ Created 5/11/1994 Heikki Tuuri
#include "ut0mem.ic"
#endif
#include "mem0mem.h"
#include "os0thread.h"
#include "srv0srv.h"
#ifndef UNIV_HOTBACKUP
# include "os0thread.h"
# include "srv0srv.h"
#include <stdlib.h>
@ -74,6 +74,7 @@ ut_mem_init(void)
UT_LIST_INIT(ut_mem_block_list);
ut_mem_block_list_inited = TRUE;
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
@ -90,6 +91,7 @@ ut_malloc_low(
ibool assert_on_error)/* in: if TRUE, we crash mysqld if the
memory cannot be allocated */
{
#ifndef UNIV_HOTBACKUP
ulint retry_count;
void* ret;
@ -208,6 +210,17 @@ retry:
os_fast_mutex_unlock(&ut_list_mutex);
return((void*)((byte*)ret + sizeof(ut_mem_block_t)));
#else /* !UNIV_HOTBACKUP */
void* ret = malloc(n);
ut_a(ret || !assert_on_error);
# ifdef UNIV_SET_MEM_TO_ZERO
if (set_to_zero) {
memset(ret, '\0', n);
}
# endif
return(ret);
#endif /* !UNIV_HOTBACKUP */
}
/**************************************************************************
@ -220,9 +233,14 @@ ut_malloc(
/* out, own: allocated memory */
ulint n) /* in: number of bytes to allocate */
{
#ifndef UNIV_HOTBACKUP
return(ut_malloc_low(n, TRUE, TRUE));
#else /* !UNIV_HOTBACKUP */
return(malloc(n));
#endif /* !UNIV_HOTBACKUP */
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Tests if malloc of n bytes would succeed. ut_malloc() asserts if memory runs
out. It cannot be used if we want to return an error message. Prints to
@ -262,6 +280,7 @@ ut_test_malloc(
return(TRUE);
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Frees a memory block allocated with ut_malloc. */
@ -271,6 +290,7 @@ ut_free(
/*====*/
void* ptr) /* in, own: memory block */
{
#ifndef UNIV_HOTBACKUP
ut_mem_block_t* block;
if (UNIV_LIKELY(srv_use_sys_malloc)) {
@ -291,8 +311,12 @@ ut_free(
free(block);
os_fast_mutex_unlock(&ut_list_mutex);
#else /* !UNIV_HOTBACKUP */
free(ptr);
#endif /* !UNIV_HOTBACKUP */
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Implements realloc. This is needed by /pars/lexyy.c. Otherwise, you should not
use this function because the allocation functions in mem0mem.h are the
@ -403,6 +427,7 @@ ut_free_all_mem(void)
(ulong) ut_total_allocated_memory);
}
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
Copies up to size - 1 characters from the NUL-terminated string src to
@ -499,6 +524,7 @@ ut_memcpyq(
return(dest);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once. */
@ -671,3 +697,4 @@ test_ut_str_sql_format()
}
#endif /* UNIV_COMPILE_TEST_FUNCS */
#endif /* !UNIV_HOTBACKUP */

View file

@ -32,9 +32,9 @@ Created 5/11/1994 Heikki Tuuri
#include <string.h>
#include <ctype.h>
#include "trx0trx.h"
#include "ha_prototypes.h"
#ifndef UNIV_HOTBACKUP
# include "trx0trx.h"
# include "ha_prototypes.h"
# include "mysql_com.h" /* NAME_LEN */
#endif /* UNIV_HOTBACKUP */
@ -369,6 +369,7 @@ ut_get_year_month_day(
}
#endif /* UNIV_HOTBACKUP */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Runs an idle loop on CPU. The argument gives the desired delay
in microseconds on 100 MHz Pentium + Visual C++. */
@ -393,6 +394,7 @@ ut_delay(
return(j);
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
Prints the contents of a memory buffer in hex and ascii. */
@ -474,7 +476,7 @@ ut_print_filename(
done:
putc('\'', f);
}
#ifndef UNIV_HOTBACKUP
/**************************************************************************
Outputs a fixed-length string, quoted as an SQL identifier.
If the string contains a slash '/', the string will be
@ -509,9 +511,6 @@ ut_print_namel(
const char* name, /* in: name to print */
ulint namelen)/* in: length of name */
{
#ifdef UNIV_HOTBACKUP
fwrite(name, 1, namelen, f);
#else
/* 2 * NAME_LEN for database and table name,
and some slack for the #mysql50# prefix and quotes */
char buf[3 * NAME_LEN];
@ -523,7 +522,6 @@ ut_print_namel(
table_id);
fwrite(buf, 1, bufend - buf, f);
#endif
}
/**************************************************************************
@ -551,6 +549,7 @@ ut_copy_file(
}
} while (len > 0);
}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************************
snprintf(). */