Commit 6129c15f authored by marko's avatar marko

branches/innodb+: Merge revisions 4528:4657 from branches/zip:

  ------------------------------------------------------------------------
  r4530 | marko | 2009-03-24 14:02:29 +0200 (Tue, 24 Mar 2009) | 3 lines

  branches/zip: Remove references to UNIV_HOTBACKUP from files that are
  not used when building InnoDB Hot Backup.  Declare
  innobase_invalidate_query_cache() in ha_prototypes.h.
  ------------------------------------------------------------------------
  r4531 | marko | 2009-03-24 15:46:12 +0200 (Tue, 24 Mar 2009) | 7 lines

  branches/zip: Note that buf_page_t::list and buf_page_t::in_flush_list
  are only protected by buf_pool_mutex, not by the block mutex.

  buf_page_release(): Remove the assertion on in_flush_list.
  The function is only holding block->mutex, not buf_pool_mutex.
  This was reported by Sunny.  This was the only piece of code
  that accessed in_flush_list while not holding buf_pool_mutex.
  ------------------------------------------------------------------------
  r4532 | calvin | 2009-03-24 17:59:45 +0200 (Tue, 24 Mar 2009) | 13 lines

  branches/zip: Mantis issue #201 - remove innodb_plugin_init() due to
  new option --ignore_builtin_innodb

  Starting 5.1.33, MySQL has a new option --ignore_builtin_innodb
  for using the dynamic plugin. It is required to remove
  innodb_plugin_init() in the plugin.

  This patch removes innodb_plugin_init() as well as functions,
  variables used by innodb_plugin_init().

  rb://98

  Approved by: Marko
  ------------------------------------------------------------------------
  r4543 | inaam | 2009-03-25 19:18:33 +0200 (Wed, 25 Mar 2009) | 17 lines

  branches/zip

  SHOW ENGINE INNODB MUTEX shows all mutexes and rw_locks. This can
  be overwhelming particularly when the buffer pool is very large
  (note that each block in buffer pool has at least one mutex, one
  rw_lock and an additional mutex if rw_lock does not use atomics).
  With this patch status of following mutexes and rw-locks is not shown:

  1) block->mutex
  2) block->lock
  3) block->lock->mutex (if applicable)
  4) All other mutexes and rw-locks for which number of os-waits are zero

  Addresses issue# 179 rb://99

  Approved by: Marko
  ------------------------------------------------------------------------
  r4579 | marko | 2009-03-31 10:40:58 +0300 (Tue, 31 Mar 2009) | 3 lines

  branches/zip: struct read_view_struct: Add clarifying comments about
  low_limit_id and up_limit_id.
  ------------------------------------------------------------------------
  r4630 | calvin | 2009-04-02 15:46:47 +0300 (Thu, 02 Apr 2009) | 6 lines

  branches/zip: Mantis issue #197 - Make srv_spin_wait_delay configurable

  New parameter innodb_spin_wait_delay to set the maximum delay between
  polling for a spin lock. 5 is the default.

  Approved by: Marko (on IM)
  ------------------------------------------------------------------------
  r4631 | marko | 2009-04-02 16:23:12 +0300 (Thu, 02 Apr 2009) | 24 lines

  branches/zip: Refuse to use newly created indexes that may lack
  history.  This addresses Mantis issue #116.

  dict_index_t: Enable the storage of trx_id.

  row_prebuilt_t: Make many fields bit-fields to reduce the memory
  footprint. Add index_usable.

  ha_innobase::change_active_index(): Check if the index is usable and
  set prebuilt->index_usable accordingly. Unfortunately, the return
  status of this function is ignored by MySQL, and the actual refusal to
  use the index must be made in row_search_for_mysql().

  row_search_for_mysql(): Return DB_MISSING_HISTORY if
  !prebuilt->index_usable.

  convert_error_code_to_mysql(): Map DB_MISSING_HISTORY to
  HA_ERR_TABLE_DEF_CHANGED.

  innodb-index.test: Add a test case where access to a newly created
  secondary index must be blocked for old transactions.

  rb://100 approved by Heikki Tuuri
  ------------------------------------------------------------------------
  r4647 | vasil | 2009-04-06 10:05:25 +0300 (Mon, 06 Apr 2009) | 4 lines

  branches/zip:

  Add changelog entry for c4630.
  ------------------------------------------------------------------------
  r4648 | vasil | 2009-04-06 10:07:26 +0300 (Mon, 06 Apr 2009) | 4 lines

  branches/zip:

  Fix formatting in ChangeLog to be consistent.
  ------------------------------------------------------------------------
  r4657 | marko | 2009-04-06 15:13:45 +0300 (Mon, 06 Apr 2009) | 1 line

  branches/zip: Remove the bogus failure reported in Issue #219.
  ------------------------------------------------------------------------
parent 9bff4590
2009-04-06 The InnoDB Team
* sync/sync0rw.c:
Avoid a bogus failure in UNIV_SYNC_DEBUG diagnostics.
2009-04-02 The InnoDB Team
* handler/ha_innodb.cc, include/srv0srv.h, srv/srv0srv.c:
Add new parameter innodb_spin_wait_delay to set the maximum delay
between polling for a spin lock.
2009-04-02 The InnoDB Team
* dict/dict0crea.c, handler/ha_innodb.cc, handler/ha_innodb.h,
include/dict0mem.h, include/row0merge.h, include/row0mysql.h,
mysql-test/innodb-index.result, mysql-test/innodb-index.test,
row/row0merge.c, row/row0sel.c:
In consistent reads, refuse to use newly created indexes that may
lack history.
2009-03-20 The InnoDB Team
* buf/buf0buf.c, include/log0recv.h, log/log0recv.c:
......
......@@ -1994,6 +1994,36 @@ buf_block_align(
return(NULL);
}
/************************************************************************
Find out if a pointer belongs to a buf_block_t. It can be a pointer to
the buf_block_t itself or a member of it */
UNIV_INTERN
ibool
buf_pointer_is_block_field(
/*=======================*/
/* out: TRUE if ptr belongs
to a buf_block_t struct */
const void* ptr) /* in: pointer not
dereferenced */
{
const buf_chunk_t* chunk = buf_pool->chunks;
const buf_chunk_t* const echunk = chunk + buf_pool->n_chunks;
/* TODO: protect buf_pool->chunks with a mutex (it will
currently remain constant after buf_pool_init()) */
while (chunk < echunk) {
if (ptr >= (void *)chunk->blocks
&& ptr < (void *)(chunk->blocks + chunk->size)) {
return(TRUE);
}
chunk++;
}
return(FALSE);
}
/************************************************************************
Find out if a buffer block was created by buf_chunk_init(). */
static
......@@ -2006,9 +2036,6 @@ buf_block_is_uncompressed(
const buf_block_t* block) /* in: pointer to block,
not dereferenced */
{
const buf_chunk_t* chunk = buf_pool->chunks;
const buf_chunk_t* const echunk = chunk + buf_pool->n_chunks;
ut_ad(buf_pool_mutex_own());
if (UNIV_UNLIKELY((((ulint) block) % sizeof *block) != 0)) {
......@@ -2016,17 +2043,7 @@ buf_block_is_uncompressed(
return(FALSE);
}
while (chunk < echunk) {
if (block >= chunk->blocks
&& block < chunk->blocks + chunk->size) {
return(TRUE);
}
chunk++;
}
return(FALSE);
return(buf_pointer_is_block_field((void *)block));
}
/************************************************************************
......
......@@ -561,10 +561,8 @@ dict_build_index_def_step(
ins_node_set_new_row(node->ind_def, row);
#ifdef ROW_MERGE_IS_INDEX_USABLE
/* Note that the index was created by this transaction. */
index->trx_id = trx->id;
#endif /* ROW_MERGE_IS_INDEX_USABLE */
index->trx_id = (ib_uint64_t) ut_conv_dulint_to_longlong(trx->id);
return(DB_SUCCESS);
}
......@@ -1156,7 +1154,6 @@ dict_create_index_step(
return(thr);
}
#ifndef UNIV_HOTBACKUP
/********************************************************************
Creates the foreign key constraints system tables inside InnoDB
at database creation or database start if they are not found or are
......@@ -1500,4 +1497,3 @@ dict_create_add_foreigns_to_dictionary(
return(DB_SUCCESS);
}
#endif /* !UNIV_HOTBACKUP */
......@@ -24,9 +24,7 @@ Created 4/24/1996 Heikki Tuuri
*******************************************************/
#include "dict0load.h"
#ifndef UNIV_HOTBACKUP
#include "mysql_version.h"
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_NONINL
#include "dict0load.ic"
......@@ -960,7 +958,7 @@ dict_load_table(
mem_heap_empty(heap);
err = dict_load_indexes(table, heap);
#ifndef UNIV_HOTBACKUP
/* If the force recovery flag is set, we open the table irrespective
of the error condition, since the user may want to dump data from the
clustered index. However we load the foreign key information only if
......@@ -971,7 +969,7 @@ dict_load_table(
dict_table_remove_from_cache(table);
table = NULL;
}
# if 0
#if 0
if (err != DB_SUCCESS && table != NULL) {
mutex_enter(&dict_foreign_err_mutex);
......@@ -994,8 +992,7 @@ dict_load_table(
mutex_exit(&dict_foreign_err_mutex);
}
# endif /* 0 */
#endif /* !UNIV_HOTBACKUP */
#endif /* 0 */
mem_heap_free(heap);
return(table);
......@@ -1113,7 +1110,6 @@ dict_load_sys_table(
mem_heap_free(heap);
}
#ifndef UNIV_HOTBACKUP
/************************************************************************
Loads foreign key constraint col names (also for the referenced table). */
static
......@@ -1457,4 +1453,3 @@ dict_load_foreigns(
return(DB_SUCCESS);
}
#endif /* !UNIV_HOTBACKUP */
This diff is collapsed.
......@@ -119,14 +119,6 @@ class ha_innobase: public handler
void try_semi_consistent_read(bool yes);
void unlock_row();
#ifdef ROW_MERGE_IS_INDEX_USABLE
/** Check if an index can be used by this transaction.
* @param keynr key number to check
* @return true if available, false if the index
* does not contain old records that exist
* in the read view of this transaction */
bool is_index_available(uint keynr);
#endif /* ROW_MERGE_IS_INDEX_USABLE */
int index_init(uint index, bool sorted);
int index_end();
int index_read(uchar * buf, const uchar * key,
......
......@@ -72,12 +72,6 @@ uint* wdl_lower_case_table_names;
ulong* wdl_specialflag;
int* wdl_my_umask;
/***********************************************************************
The following is defined in ha_innodb.cc. It is used for copying the
system variables from the builtin innodb plugin to the dynamic plugin.
*/
extern struct st_mysql_plugin* builtin_innobase_plugin_ptr;
/***********************************************************************
The preffered load-address defined in PE (portable executable format).*/
#if defined(_M_IA64)
......@@ -643,12 +637,6 @@ wdl_get_external_variables(void)
"?binlog_format_names@@3PAPBDA",
wdl_binlog_format_names, char*);
/* It is fine if builtin_innobase_plugin is not available. */
builtin_innobase_plugin_ptr = (struct st_mysql_plugin*)
wdl_get_varaddr_from_map(
hmod,
"?builtin_innobase_plugin@@3PAUst_mysql_plugin@@A");
#ifndef DBUG_OFF
GET_PROC_ADDR(_db_enter_);
GET_PROC_ADDR(_db_return_);
......
......@@ -912,6 +912,22 @@ buf_block_align(
/*============*/
/* out: pointer to block, never NULL */
const byte* ptr); /* in: pointer to a frame */
/************************************************************************
Find out if a pointer belongs to a buf_block_t. It can be a pointer to
the buf_block_t itself or a member of it */
UNIV_INTERN
ibool
buf_pointer_is_block_field(
/*=======================*/
/* out: TRUE if ptr belongs
to a buf_block_t struct */
const void* ptr); /* in: pointer not
dereferenced */
#define buf_pool_is_block_mutex(m) \
buf_pointer_is_block_field((void *)(m))
#define buf_pool_is_block_lock(l) \
buf_pointer_is_block_field((void *)(l))
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
/*************************************************************************
Gets the compressed page descriptor corresponding to an uncompressed page
......@@ -1086,9 +1102,10 @@ struct buf_page_struct{
/* 2. Page flushing fields; protected by buf_pool_mutex */
UT_LIST_NODE_T(buf_page_t) list;
/* based on state, this is a list
node in one of the following lists
in buf_pool:
/* based on state, this is a
list node, protected only by
buf_pool_mutex, in one of the
following lists in buf_pool:
BUF_BLOCK_NOT_USED: free
BUF_BLOCK_FILE_PAGE: flush_list
......
......@@ -1056,10 +1056,6 @@ buf_page_release(
#endif
block->page.buf_fix_count--;
/* Dirty blocks should be in the flush list. */
ut_ad(!block->page.oldest_modification
|| block->page.in_flush_list);
mutex_exit(&block->mutex);
if (rw_latch == RW_S_LATCH) {
......
......@@ -97,7 +97,6 @@ dict_drop_index_tree(
rec_t* rec, /* in/out: record in the clustered index
of SYS_INDEXES table */
mtr_t* mtr); /* in: mtr having the latch on the record page */
#ifndef UNIV_HOTBACKUP
/********************************************************************
Creates the foreign key constraints system tables inside InnoDB
at database creation or database start if they are not found or are
......@@ -129,7 +128,6 @@ dict_create_add_foreigns_to_dictionary(
was generated here */
dict_table_t* table, /* in: table */
trx_t* trx); /* in: transaction */
#endif /* !UNIV_HOTBACKUP */
/* Table create node structure */
......
......@@ -87,7 +87,6 @@ void
dict_load_sys_table(
/*================*/
dict_table_t* table); /* in: system table */
#ifndef UNIV_HOTBACKUP
/***************************************************************************
Loads foreign key constraints where the table is either the foreign key
holder or where the table is referenced by a foreign key. Adds these
......@@ -102,7 +101,6 @@ dict_load_foreigns(
const char* table_name, /* in: table name */
ibool check_charsets);/* in: TRUE=check charsets
compatibility */
#endif /* !UNIV_HOTBACKUP */
/************************************************************************
Prints to the standard output information on all tables found in the data
dictionary system table. */
......
......@@ -279,11 +279,9 @@ struct dict_index_struct{
index tree */
rw_lock_t lock; /* read-write lock protecting the upper levels
of the index tree */
#ifdef ROW_MERGE_IS_INDEX_USABLE
dulint trx_id; /* id of the transaction that created this
index, or ut_dulint_zero if the index existed
ib_uint64_t trx_id; /* id of the transaction that created this
index, or 0 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 */
......
......@@ -19,9 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef HA_INNODB_PROTOTYPES_H
#define HA_INNODB_PROTOTYPES_H
#ifndef UNIV_HOTBACKUP
#include "univ.i" /* ulint, uint */
#include "trx0types.h"
#include "m_ctype.h" /* CHARSET_INFO */
/* Prototypes for global functions in ha_innodb.cc that are called by
......@@ -64,6 +62,22 @@ innobase_raw_format(
ulint buf_size); /* in: output buffer size
in bytes */
/*********************************************************************
Invalidates the MySQL query cache for the table. */
UNIV_INTERN
void
innobase_invalidate_query_cache(
/*============================*/
trx_t* trx, /* in: transaction which
modifies the table */
const char* full_name, /* in: concatenation of
database name, null char '\0',
table name, null char '\0';
NOTE that in Windows this is
always in LOWER CASE! */
ulint full_name_len); /* in: full name length where
also the null chars count */
/*********************************************************************
Convert a table or index name to the MySQL system_charset_info (UTF-8)
and quote it if needed. */
......@@ -264,4 +278,3 @@ thd_lock_wait_timeout(
the global innodb_lock_wait_timeout */
#endif
#endif
......@@ -42,13 +42,6 @@ os_fast_mutex_trylock(
EnterCriticalSection(fast_mutex);
return(0);
#else
#if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)
/* Since the hot backup version is standalone, MySQL does not redefine
pthread_mutex_trylock for HP-UX-10.20, and consequently we must invert
the return value here */
return((ulint) (1 - pthread_mutex_trylock(fast_mutex)));
#else
/* NOTE that the MySQL my_pthread.h redefines pthread_mutex_trylock
so that it returns 0 on success. In the operating system
......@@ -58,5 +51,4 @@ os_fast_mutex_trylock(
return((ulint) pthread_mutex_trylock(fast_mutex));
#endif
#endif
}
......@@ -133,16 +133,21 @@ struct read_view_struct{
can be removed in purge if not needed by other
views */
dulint low_limit_id; /* The read should not see any transaction
with trx id >= this value */
with trx id >= this value. In other words,
this is the "high water mark". */
dulint up_limit_id; /* The read should see all trx ids which
are strictly smaller (<) than this value */
are strictly smaller (<) than this value.
In other words,
this is the "low water mark". */
ulint n_trx_ids; /* Number of cells in the trx_ids array */
dulint* trx_ids; /* Additional trx ids which the read should
not see: typically, these are the active
transactions at the time when the read is
serialized, except the reading transaction
itself; the trx ids in this array are in a
descending order */
descending order. These trx_ids should be
between the "low" and "high" water marks,
that is, up_limit_id and low_limit_id. */
dulint creator_trx_id; /* trx id of creating transaction, or
(0, 0) used in purge */
UT_LIST_NODE_T(read_view_t) view_list;
......
......@@ -141,7 +141,6 @@ cmp_dtuple_is_prefix_of_rec(
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record */
const ulint* offsets);/* in: array returned by rec_get_offsets() */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Compare two physical records that contain the same number of columns,
none of which are stored externally. */
......@@ -156,7 +155,6 @@ cmp_rec_rec_simple(
const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */
const dict_index_t* index); /* in: data dictionary index */
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
This function is used to compare two physical records. Only the common
first fields are compared, and if an externally stored field is
......
......@@ -152,7 +152,6 @@ row_merge_create_index(
dict_table_t* table, /* in: the index is on this table */
const merge_index_def_t* /* in: the index definition */
index_def);
#ifdef ROW_MERGE_IS_INDEX_USABLE
/*************************************************************************
Check if a transaction can use an index. */
UNIV_INTERN
......@@ -163,7 +162,6 @@ row_merge_is_index_usable(
the transaction else FALSE*/
const trx_t* trx, /* in: transaction */
const dict_index_t* index); /* in: index to check */
#endif /* ROW_MERGE_IS_INDEX_USABLE */
/*************************************************************************
If there are views that refer to the old table name then we "attach" to
the new instance of the table else we drop it immediately. */
......
......@@ -351,7 +351,6 @@ void
row_mysql_unfreeze_data_dictionary(
/*===============================*/
trx_t* trx); /* in/out: transaction */
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Creates a table for MySQL. If the name of the table ends in
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
......@@ -502,7 +501,6 @@ row_check_table_for_mysql(
/* out: DB_ERROR or DB_SUCCESS */
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
handle */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Determines if a table is a magic monitor table. */
......@@ -573,52 +571,54 @@ struct row_prebuilt_struct {
or ROW_PREBUILT_FREED when the
struct has been freed */
dict_table_t* table; /* Innobase table handle */
dict_index_t* index; /* current index for a search, if
any */
trx_t* trx; /* current transaction handle */
ibool sql_stat_start; /* TRUE when we start processing of
unsigned sql_stat_start:1;/* TRUE when we start processing of
an SQL statement: we may have to set
an intention lock on the table,
create a consistent read view etc. */
ibool mysql_has_locked; /* this is set TRUE when MySQL
unsigned mysql_has_locked:1; /* this is set TRUE when MySQL
calls external_lock on this handle
with a lock flag, and set FALSE when
with the F_UNLOCK flag */
ibool clust_index_was_generated;
unsigned clust_index_was_generated:1;
/* if the user did not define a
primary key in MySQL, then Innobase
automatically generated a clustered
index where the ordering column is
the row id: in this case this flag
is set to TRUE */
dict_index_t* index; /* current index for a search, if
any */
ulint read_just_key; /* set to 1 when MySQL calls
unsigned index_usable:1; /* caches the value of
row_merge_is_index_usable(trx,index) */
unsigned read_just_key:1;/* set to 1 when MySQL calls
ha_innobase::extra with the
argument HA_EXTRA_KEYREAD; it is enough
to read just columns defined in
the index (i.e., no read of the
clustered index record necessary) */
ibool used_in_HANDLER;/* TRUE if we have been using this
unsigned used_in_HANDLER:1;/* TRUE if we have been using this
handle in a MySQL HANDLER low level
index cursor command: then we must
store the pcur position even in a
unique search from a clustered index,
because HANDLER allows NEXT and PREV
in such a situation */
ulint template_type; /* ROW_MYSQL_WHOLE_ROW,
unsigned template_type:2;/* ROW_MYSQL_WHOLE_ROW,
ROW_MYSQL_REC_FIELDS,
ROW_MYSQL_DUMMY_TEMPLATE, or
ROW_MYSQL_NO_TEMPLATE */
ulint n_template; /* number of elements in the
unsigned n_template:10; /* number of elements in the
template */
ulint null_bitmap_len;/* number of bytes in the SQL NULL
unsigned null_bitmap_len:10;/* number of bytes in the SQL NULL
bitmap at the start of a row in the
MySQL format */
ibool need_to_access_clustered; /* if we are fetching
unsigned need_to_access_clustered:1; /* if we are fetching
columns through a secondary index
and at least one column is not in
the secondary index, then this is
set to TRUE */
ibool templ_contains_blob;/* TRUE if the template contains
unsigned templ_contains_blob:1;/* TRUE if the template contains
BLOB column(s) */
mysql_row_templ_t* mysql_template;/* template used to transform
rows fast between MySQL and Innobase
......
......@@ -190,7 +190,7 @@ extern ibool srv_error_monitor_active;
extern ulong srv_n_spin_wait_rounds;
extern ulong srv_n_free_tickets_to_enter;
extern ulong srv_thread_sleep_delay;
extern ulint srv_spin_wait_delay;
extern ulong srv_spin_wait_delay;
extern ibool srv_priority_boost;
extern ulint srv_mem_pool_size;
......
......@@ -40,9 +40,7 @@ Created 9/5/1995 Heikki Tuuri
#include "os0sync.h"
#include "sync0arr.h"
#ifndef UNIV_HOTBACKUP
extern my_bool timed_mutexes;
#endif /* UNIV_HOTBACKUP */
/**********************************************************************
Initializes the synchronization data structures. */
......@@ -515,9 +513,8 @@ struct mutex_struct {
ulint magic_n;
# define MUTEX_MAGIC_N (ulint)979585
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
ulong count_os_wait; /* count of os_wait */
# ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
ulong count_using; /* count of times mutex used */
ulong count_spin_loop; /* count of spin loops */
ulong count_spin_rounds; /* count of spin rounds */
......@@ -526,8 +523,7 @@ struct mutex_struct {
ulonglong lmax_spent_time; /* mutex os_wait timer msec */
const char* cmutex_name;/* mutex name */
ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */
# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
};
/* The global array of wait cells for implementation of the databases own
......
......@@ -254,9 +254,7 @@ mutex_enter_func(
/* Note that we do not peek at the value of lock_word before trying
the atomic test_and_set; we could peek, and possibly save time. */
#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex->count_using++;
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
ut_d(mutex->count_using++);
if (!mutex_test_and_set(mutex)) {
ut_d(mutex->thread_id = os_thread_get_curr_id());
......
......@@ -1438,7 +1438,6 @@ lock_rec_has_expl(
}
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/*************************************************************************
Checks if some other transaction has a lock request in the queue. */
static
......@@ -1485,7 +1484,6 @@ lock_rec_other_has_expl_req(
return(NULL);
}
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
/*************************************************************************
......@@ -4330,8 +4328,6 @@ lock_rec_print(
}
}
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_DEBUG
/* Print the number of lock structs from lock_print_info_summary() only
in non-production builds for performance reasons, see
......@@ -4575,7 +4571,7 @@ lock_print_info_all_transactions(
goto loop;
}
# ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
/*************************************************************************
Validates the lock queue on a table. */
static
......@@ -4910,8 +4906,7 @@ lock_validate(void)
return(TRUE);
}
# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
/*============ RECORD LOCK CHECKS FOR ROW OPERATIONS ====================*/
/*************************************************************************
......
......@@ -1132,3 +1132,39 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
BEGIN;
SELECT * FROM t1;
a b
3 a
3 b
1 c
0 d
1 e
CREATE INDEX t1a ON t1(a);
SELECT * FROM t1;
a b
3 a
3 b
1 c
0 d
1 e
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
ERROR HY000: Table definition has changed, please retry transaction
SELECT * FROM t1;
a b
3 a
3 b
1 c
0 d
1 e
COMMIT;
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
a b
0 d
1 c
1 e
3 a
3 b
DROP TABLE t1;
......@@ -509,3 +509,26 @@ SHOW CREATE TABLE t2;
DROP TABLE t2;
DROP TABLE t1;
connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
connection b;
BEGIN;
SELECT * FROM t1;
connection a;
CREATE INDEX t1a ON t1(a);
connection b;
SELECT * FROM t1;
--error ER_TABLE_DEF_CHANGED
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
SELECT * FROM t1;
COMMIT;
SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
connection default;
disconnect a;
disconnect b;
DROP TABLE t1;
......@@ -161,12 +161,8 @@ os_event_create(
os_fast_mutex_init(&(event->os_mutex));
#if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)
ut_a(0 == pthread_cond_init(&(event->cond_var),
pthread_condattr_default));
#else
ut_a(0 == pthread_cond_init(&(event->cond_var), NULL));
#endif
event->is_set = FALSE;
/* We return this value in os_event_reset(), which can then be
......@@ -674,12 +670,8 @@ os_fast_mutex_init(
ut_a(fast_mutex);
InitializeCriticalSection((LPCRITICAL_SECTION) fast_mutex);
#else
#if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)
ut_a(0 == pthread_mutex_init(fast_mutex, pthread_mutexattr_default));
#else
ut_a(0 == pthread_mutex_init(fast_mutex, MY_MUTEX_INIT_FAST));
#endif
#endif
if (UNIV_LIKELY(os_sync_mutex_inited)) {
/* When creating os_sync_mutex itself (in Unix) we cannot
......
......@@ -73,7 +73,6 @@ cmp_debug_dtuple_rec_with_match(
returns, contains the value for current
comparison */
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/*****************************************************************
This function is used to compare two data fields for which the data type
is such that we must use MySQL code to compare them. The prototype here
......@@ -92,7 +91,6 @@ innobase_mysql_cmp(
const unsigned char* b, /* in: data field */
unsigned int b_length); /* in: data field length,
not UNIV_SQL_NULL */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Transforms the character code so that it is ordered appropriately for the
language. This is only used for the latin1 char set. MySQL does the
......@@ -161,7 +159,6 @@ cmp_cols_are_equal(
return(col1->mtype != DATA_INT || col1->len == col2->len);
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Innobase uses this function to compare two data fields for which the data type
is such that we must compare whole fields or call MySQL to do the comparison */
......@@ -288,7 +285,6 @@ cmp_whole_field(
return(0);
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
This function is used to compare two data fields for which we know the
......@@ -308,7 +304,6 @@ cmp_data_data_slow(
buffer) */
ulint len2) /* in: data field length or UNIV_SQL_NULL */
{
#ifndef UNIV_HOTBACKUP
ulint data1_byte;
ulint data2_byte;
ulint cur_bytes;
......@@ -401,12 +396,6 @@ cmp_data_data_slow(
data1++;
data2++;
}
#else /* !UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* !UNIV_HOTBACKUP */
return(0); /* Not reached */
}
......@@ -442,7 +431,6 @@ cmp_dtuple_rec_with_match(
matched; when function returns, contains the
value for current comparison */
{
#ifndef UNIV_HOTBACKUP
const dfield_t* dtuple_field; /* current field in logical record */
ulint dtuple_f_len; /* the length of the current field
in the logical record */
......@@ -650,13 +638,6 @@ cmp_dtuple_rec_with_match(
*matched_bytes = cur_bytes;
return(ret);
#else /* !UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(0);
#endif /* !UNIV_HOTBACKUP */
}
/******************************************************************
......@@ -720,7 +701,6 @@ cmp_dtuple_is_prefix_of_rec(
return(FALSE);
}
#ifndef UNIV_HOTBACKUP
/*****************************************************************
Compare two physical records that contain the same number of columns,
none of which are stored externally. */
......@@ -870,7 +850,6 @@ cmp_rec_rec_simple(
/* If we ran out of fields, rec1 was equal to rec2. */
return(0);
}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************
This function is used to compare two physical records. Only the common
......@@ -897,7 +876,6 @@ cmp_rec_rec_with_match(
matched; when the function returns, contains
the value for the current comparison */
{
#ifndef UNIV_HOTBACKUP
ulint rec1_n_fields; /* the number of fields in rec */
ulint rec1_f_len; /* length of current field in rec */
const byte* rec1_b_ptr; /* pointer to the current byte
......@@ -1111,13 +1089,6 @@ cmp_rec_rec_with_match(
*matched_bytes = cur_bytes;
return(ret);
#else /* !UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(0);
#endif /* !UNIV_HOTBACKUP */
}
#ifdef UNIV_DEBUG
......
......@@ -28,6 +28,7 @@ Created 4/20/1996 Heikki Tuuri
#include "row0ins.ic"
#endif
#include "ha_prototypes.h"
#include "dict0dict.h"
#include "dict0boot.h"
#include "trx0undo.h"
......@@ -50,23 +51,6 @@ Created 4/20/1996 Heikki Tuuri
#define ROW_INS_NEXT 2
/*********************************************************************
This prototype is copied from /mysql/sql/ha_innodb.cc.
Invalidates the MySQL query cache for the table.
NOTE that the exact prototype of this function has to be in
/innobase/row/row0ins.c! */
extern
void
innobase_invalidate_query_cache(
/*============================*/
trx_t* trx, /* in: transaction which modifies the table */
char* full_name, /* in: concatenation of database name, null
char '\0', table name, null char'\0';
NOTE that in Windows this is always
in LOWER CASE! */
ulint full_name_len); /* in: full name length where also the null
chars count */
/*************************************************************************
Creates an insert node struct. */
UNIV_INTERN
......@@ -767,10 +751,7 @@ row_ins_invalidate_query_cache(
ut_a(ptr);
*ptr = '\0';
/* We call a function in ha_innodb.cc */
#ifndef UNIV_HOTBACKUP
innobase_invalidate_query_cache(thr_get_trx(thr), buf, len);
#endif
mem_free(buf);
}
......@@ -1172,7 +1153,6 @@ row_ins_set_shared_rec_lock(
return(err);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Sets a exclusive lock on a record. Used in locking possible duplicate key
records */
......@@ -1203,7 +1183,6 @@ row_ins_set_exclusive_rec_lock(
return(err);
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Checks if foreign key constraint fails for an index entry. Sets shared locks
......@@ -1611,7 +1590,6 @@ row_ins_check_foreign_constraints(
return(DB_SUCCESS);
}
#ifndef UNIV_HOTBACKUP
/*******************************************************************
Checks if a unique key violation to rec would occur at the index entry
insert. */
......@@ -1663,7 +1641,6 @@ row_ins_dupl_error_with_rec(
return(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Scans a unique non-clustered index at a given index entry to determine
......@@ -1679,7 +1656,6 @@ row_ins_scan_sec_index_for_duplicate(
dtuple_t* entry, /* in: index entry */
que_thr_t* thr) /* in: query thread */
{
#ifndef UNIV_HOTBACKUP
ulint n_unique;
ulint i;
int cmp;
......@@ -1789,13 +1765,6 @@ row_ins_scan_sec_index_for_duplicate(
dtuple_set_n_fields_cmp(entry, n_fields_cmp);
return(err);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(DB_FAIL);
#endif /* UNIV_HOTBACKUP */
}
/*******************************************************************
......@@ -1815,7 +1784,6 @@ row_ins_duplicate_error_in_clust(
que_thr_t* thr, /* in: query thread */
mtr_t* mtr) /* in: mtr */
{
#ifndef UNIV_HOTBACKUP
ulint err;
rec_t* rec;
ulint n_unique;
......@@ -1939,13 +1907,6 @@ row_ins_duplicate_error_in_clust(
mem_heap_free(heap);
}
return(err);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(DB_FAIL);
#endif /* UNIV_HOTBACKUP */
}
/*******************************************************************
......
......@@ -2229,12 +2229,11 @@ row_merge_create_index(
ut_a(index);
#ifdef ROW_MERGE_IS_INDEX_USABLE
/* Note the id of the transaction that created this
index, we use it to restrict readers from accessing
this index, to ensure read consistency. */
index->trx_id = trx->id;
#endif /* ROW_MERGE_IS_INDEX_USABLE */
index->trx_id = (ib_uint64_t)
ut_conv_dulint_to_longlong(trx->id);
} else {
index = NULL;
}
......@@ -2242,7 +2241,6 @@ row_merge_create_index(
return(index);
}
#ifdef ROW_MERGE_IS_INDEX_USABLE
/*************************************************************************
Check if a transaction can use an index. */
UNIV_INTERN
......@@ -2252,13 +2250,11 @@ row_merge_is_index_usable(
const trx_t* trx, /* in: transaction */
const dict_index_t* index) /* in: index to check */
{
if (!trx->read_view) {
return(TRUE);
}
return(ut_dulint_cmp(index->trx_id, trx->read_view->low_limit_id) < 0);
return(!trx->read_view || read_view_sees_trx_id(
trx->read_view,
ut_dulint_create((ulint) (index->trx_id >> 32),
(ulint) index->trx_id & 0xFFFFFFFF)));
}
#endif /* ROW_MERGE_IS_INDEX_USABLE */
/*************************************************************************
Drop the old table. */
......
......@@ -78,7 +78,6 @@ the above strings. */
((str1_len) == sizeof(str2_onstack) \
&& memcmp(str1, str2_onstack, sizeof(str2_onstack)) == 0)
#ifndef UNIV_HOTBACKUP
/***********************************************************************
Determine if the given name is a name reserved for MySQL system tables. */
static
......@@ -98,7 +97,6 @@ row_mysql_is_system_table(
|| 0 == strcmp(name + 6, "user")
|| 0 == strcmp(name + 6, "db"));
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
If a table is not yet in the drop list, adds the table to the list of tables
......@@ -489,7 +487,6 @@ row_mysql_handle_errors(
que_thr_t* thr, /* in: query thread */
trx_savept_t* savept) /* in: savepoint or NULL */
{
#ifndef UNIV_HOTBACKUP
ulint err;
handle_new_error:
......@@ -583,13 +580,6 @@ row_mysql_handle_errors(
trx->error_state = DB_SUCCESS;
return(FALSE);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(FALSE);
#endif /* UNIV_HOTBACKUP */
}
/************************************************************************
......@@ -1743,7 +1733,6 @@ row_mysql_unlock_data_dictionary(
trx->dict_operation_lock_mode = 0;
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Creates a table for MySQL. If the name of the table ends in
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
......@@ -2110,12 +2099,11 @@ row_table_add_foreign_constraints(
err = dict_create_foreign_constraints(trx, sql_string, name,
reject_fks);
#ifndef UNIV_HOTBACKUP
if (err == DB_SUCCESS) {
/* Check that also referencing constraints are ok */
err = dict_load_foreigns(name, TRUE);
}
#endif /* !UNIV_HOTBACKUP */
if (err != DB_SUCCESS) {
/* We have special error handling here */
......@@ -3375,9 +3363,7 @@ row_drop_table_for_mysql(
trx->op_info = "";
#ifndef UNIV_HOTBACKUP
srv_wake_master_thread();
#endif /* !UNIV_HOTBACKUP */
return((int) err);
}
......@@ -4198,7 +4184,6 @@ row_check_table_for_mysql(
return(ret);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Determines if a table is a magic monitor table. */
......
......@@ -849,8 +849,6 @@ row_search_index_entry(
return(ROW_FOUND);
}
#ifndef UNIV_HOTBACKUP
#include <my_sys.h>
/***********************************************************************
......@@ -1045,8 +1043,6 @@ row_raw_format(
return(ret);
}
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_COMPILE_TEST_FUNCS
#include "ut0dbg.h"
......
......@@ -3343,6 +3343,11 @@ row_search_for_mysql(
return(DB_ERROR);
}
if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
return(DB_MISSING_HISTORY);
}
if (UNIV_UNLIKELY(prebuilt->magic_n != ROW_PREBUILT_ALLOCATED)) {
fprintf(stderr,
"InnoDB: Error: trying to free a corrupt\n"
......
......@@ -347,7 +347,7 @@ UNIV_INTERN ulong srv_replication_delay = 0;
UNIV_INTERN ulong srv_n_spin_wait_rounds = 20;
UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
UNIV_INTERN ulong srv_thread_sleep_delay = 10000;
UNIV_INTERN ulint srv_spin_wait_delay = 5;
UNIV_INTERN ulong srv_spin_wait_delay = 5;
UNIV_INTERN ibool srv_priority_boost = TRUE;
#ifdef UNIV_DEBUG
......@@ -362,12 +362,11 @@ UNIV_INTERN ulint srv_n_rows_inserted = 0;
UNIV_INTERN ulint srv_n_rows_updated = 0;
UNIV_INTERN ulint srv_n_rows_deleted = 0;
UNIV_INTERN ulint srv_n_rows_read = 0;
#ifndef UNIV_HOTBACKUP
static ulint srv_n_rows_inserted_old = 0;
static ulint srv_n_rows_updated_old = 0;
static ulint srv_n_rows_deleted_old = 0;
static ulint srv_n_rows_read_old = 0;
#endif /* !UNIV_HOTBACKUP */
UNIV_INTERN ulint srv_n_lock_wait_count = 0;
UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
......@@ -666,7 +665,6 @@ srv_table_get_nth_slot(
return(srv_sys->threads + index);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Gets the number of threads in the system. */
UNIV_INTERN
......@@ -772,7 +770,6 @@ srv_suspend_thread(void)
return(event);
}
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Releases threads of the type given from suspension in the thread table.
......@@ -1292,7 +1289,6 @@ srv_boot(void)
return(DB_SUCCESS);
}
#ifndef UNIV_HOTBACKUP
/*************************************************************************
Reserves a slot in the thread table for the current MySQL OS thread.
NOTE! The kernel mutex has to be reserved by the caller! */
......@@ -1357,7 +1353,6 @@ srv_table_reserve_slot_for_mysql(void)
return(slot);
}
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************
Puts a MySQL OS thread to wait for a lock to be released. If an error
......@@ -1372,7 +1367,6 @@ srv_suspend_mysql_thread(
que_thr_t* thr) /* in: query thread associated with the MySQL
OS thread */
{
#ifndef UNIV_HOTBACKUP
srv_slot_t* slot;
os_event_t event;
double wait_time;
......@@ -1537,12 +1531,6 @@ srv_suspend_mysql_thread(
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
}
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
/************************************************************************
......@@ -1555,7 +1543,6 @@ srv_release_mysql_thread_if_suspended(
que_thr_t* thr) /* in: query thread associated with the
MySQL OS thread */
{
#ifndef UNIV_HOTBACKUP
srv_slot_t* slot;
ulint i;
......@@ -1575,15 +1562,8 @@ srv_release_mysql_thread_if_suspended(
}
/* not found */
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
#endif /* UNIV_HOTBACKUP */
}
#ifndef UNIV_HOTBACKUP
/**********************************************************************
Refreshes the values used to calculate per-second averages. */
static
......@@ -2640,4 +2620,3 @@ srv_master_thread(
OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */
}
#endif /* !UNIV_HOTBACKUP */
......@@ -238,11 +238,8 @@ rw_lock_create_func(
lock->mutex.cfile_name = cfile_name;
lock->mutex.cline = cline;
# if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
lock->mutex.cmutex_name = cmutex_name;
lock->mutex.mutex_type = 1;
# endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
ut_d(lock->mutex.cmutex_name = cmutex_name);
ut_d(lock->mutex.mutex_type = 1);
#else /* INNODB_RW_LOCKS_USE_ATOMICS */
# ifdef UNIV_DEBUG
UT_NOT_USED(cmutex_name);
......@@ -953,7 +950,12 @@ rw_lock_print(
"RW-LATCH: %p ", (void*) lock);
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_enter(&(lock->mutex));
/* We used to acquire lock->mutex here, but it would cause a
recursive call to sync_thread_add_level() if UNIV_SYNC_DEBUG
is defined. Since this function is only invoked from
sync_thread_levels_g(), let us choose the smaller evil:
performing dirty reads instead of causing bogus deadlocks or
assertion failures. */
#endif
if (lock->lock_word != X_LOCK_DECR) {
......@@ -969,9 +971,6 @@ rw_lock_print(
info = UT_LIST_GET_NEXT(list, info);
}
}
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_exit(&(lock->mutex));
#endif
}
/*************************************************************************
......
......@@ -255,9 +255,8 @@ mutex_create_func(
#endif /* UNIV_SYNC_DEBUG */
mutex->cfile_name = cfile_name;
mutex->cline = cline;
#ifndef UNIV_HOTBACKUP
mutex->count_os_wait = 0;
# ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
mutex->cmutex_name= cmutex_name;
mutex->count_using= 0;
mutex->mutex_type= 0;
......@@ -266,8 +265,7 @@ mutex_create_func(
mutex->count_spin_loop= 0;
mutex->count_spin_rounds= 0;
mutex->count_os_yield= 0;
# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
/* Check that lock_word is aligned; this is important on Intel */
ut_ad(((ulint)(&(mutex->lock_word))) % 4 == 0);
......@@ -439,13 +437,13 @@ mutex_spin_wait(
{
ulint index; /* index of the reserved wait cell */
ulint i; /* spin round count */
#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
#ifdef UNIV_DEBUG
ib_int64_t lstart_time = 0, lfinish_time; /* for timing os_wait */
ulint ltime_diff;
ulint sec;
ulint ms;
uint timer_started = 0;
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
ut_ad(mutex);
/* This update is not thread safe, but we don't mind if the count
......@@ -465,9 +463,7 @@ mutex_spin_wait(
a memory word. */
spin_loop:
#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex->count_spin_loop++;
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
ut_d(mutex->count_spin_loop++);
while (mutex_get_lock_word(mutex) != 0 && i < SYNC_SPIN_ROUNDS) {
if (srv_spin_wait_delay) {
......@@ -478,14 +474,14 @@ mutex_spin_wait(
}
if (i == SYNC_SPIN_ROUNDS) {
#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
#ifdef UNIV_DEBUG
mutex->count_os_yield++;
if (timed_mutexes == 1 && timer_started==0) {
ut_usectime(&sec, &ms);
lstart_time= (ib_int64_t)sec * 1000000 + ms;
timer_started = 1;
}
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
os_thread_yield();
}
......@@ -499,9 +495,7 @@ mutex_spin_wait(
mutex_spin_round_count += i;
#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex->count_spin_rounds += i;
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
ut_d(mutex->count_spin_rounds += i);
if (mutex_test_and_set(mutex) == 0) {
/* Succeeded! */
......@@ -578,9 +572,8 @@ mutex_spin_wait(
mutex_os_wait_count++;
#ifndef UNIV_HOTBACKUP
mutex->count_os_wait++;
# ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
/* !!!!! Sometimes os_wait can be called without os_thread_yield */
if (timed_mutexes == 1 && timer_started==0) {
......@@ -588,14 +581,13 @@ mutex_spin_wait(
lstart_time= (ib_int64_t)sec * 1000000 + ms;
timer_started = 1;
}
# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
sync_array_wait_event(sync_primary_wait_array, index);
goto mutex_loop;
finish_timing:
#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
#ifdef UNIV_DEBUG
if (timed_mutexes == 1 && timer_started==1) {
ut_usectime(&sec, &ms);
lfinish_time= (ib_int64_t)sec * 1000000 + ms;
......@@ -607,7 +599,7 @@ mutex_spin_wait(
mutex->lmax_spent_time= ltime_diff;
}
}
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
return;
}
......
......@@ -68,7 +68,6 @@ trx_general_rollback_for_mysql(
trx_savept_t* savept) /* in: pointer to savepoint undo number, if
partial rollback requested */
{
#ifndef UNIV_HOTBACKUP
mem_heap_t* heap;
que_thr_t* thr;
roll_node_t* roll_node;
......@@ -120,13 +119,6 @@ trx_general_rollback_for_mysql(
srv_active_wake_master_thread();
return((int) trx->error_state);
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never
be called in InnoDB Hot Backup. */
ut_error;
return(DB_FAIL);
#endif /* UNIV_HOTBACKUP */
}
/***********************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment