mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Applying InnoDB Plugin 1.0.5 snapshot, part 2
From r5639 to r5685 Detailed revision comments: r5639 | marko | 2009-08-06 05:39:34 -0500 (Thu, 06 Aug 2009) | 3 lines branches/zip: mem_heap_block_free(): If innodb_use_sys_malloc is set, do not tell Valgrind that the memory is free, to avoid a bogus warning in Valgrind's built-in free() hook. r5642 | calvin | 2009-08-06 18:04:03 -0500 (Thu, 06 Aug 2009) | 2 lines branches/zip: remove duplicate "the" in comments. r5662 | marko | 2009-08-11 04:54:16 -0500 (Tue, 11 Aug 2009) | 1 line branches/zip: Bump the version number to 1.0.5 after releasing 1.0.4. r5663 | marko | 2009-08-11 06:42:37 -0500 (Tue, 11 Aug 2009) | 2 lines branches/zip: trx_general_rollback_for_mysql(): Remove the redundant parameter partial. If savept==NULL, partial==FALSE. r5670 | marko | 2009-08-12 08:16:37 -0500 (Wed, 12 Aug 2009) | 2 lines branches/zip: trx_undo_rec_copy(): Add const qualifier to undo_rec. This is a non-functional change. r5671 | marko | 2009-08-13 03:46:33 -0500 (Thu, 13 Aug 2009) | 5 lines branches/zip: ha_innobase::add_index(): Fix Bug #46557: after a successful operation, read innodb_table->flags from the newly created table object, not from the old one that was just freed. Approved by Sunny. r5681 | sunny | 2009-08-14 01:16:24 -0500 (Fri, 14 Aug 2009) | 3 lines branches/zip: When building HotBackup srv_use_sys_malloc is #ifdef out. We move access to the this variable within a !UNIV_HOTBACKUP block. r5684 | sunny | 2009-08-20 03:05:30 -0500 (Thu, 20 Aug 2009) | 10 lines branches/zip: Fix bug# 46650: Innodb assertion autoinc_lock == lock in lock_table_remove_low on INSERT SELECT We only store the autoinc locks that are granted in the transaction's autoinc lock vector. A transacton, that has been rolled back due to a deadlock because of an AUTOINC lock attempt, will not have added that lock to the vector. We need to check for that when we remove that lock. rb://145 Approved by Marko. r5685 | sunny | 2009-08-20 03:18:29 -0500 (Thu, 20 Aug 2009) | 2 lines branches/zip: Update the ChangeLog with r5684 change.
This commit is contained in:
@ -1,3 +1,20 @@
|
|||||||
|
2009-08-20 The InnoDB Team
|
||||||
|
|
||||||
|
* lock/lock0lock.c:
|
||||||
|
Fix Bug#46650 InnoDB plugin: We only store the autoinc locks that are
|
||||||
|
granted in the transaction's autoinc lock vector. A transacton, that
|
||||||
|
has been rolled back due to a deadlock because of an AUTOINC lock
|
||||||
|
attempt, will not have added that lock to the vector. We need to check
|
||||||
|
for that when we remove that lock.
|
||||||
|
|
||||||
|
2009-08-13 The InnoDB Team
|
||||||
|
|
||||||
|
* handler/handler0alter.cc:
|
||||||
|
Fix Bug#46657 InnoDB plugin: invalid read in index_merge_innodb test
|
||||||
|
On a successful CREATE INDEX, diagnostic code read the table flags
|
||||||
|
from a recently freed table object. Read them from the newly
|
||||||
|
created object instead.
|
||||||
|
|
||||||
2009-07-20 The InnoDB Team
|
2009-07-20 The InnoDB Team
|
||||||
|
|
||||||
* handler/ha_innodb.cc, buf/buf0rea.c, include/srv0srv.h, srv/srv0srv.c
|
* handler/ha_innodb.cc, buf/buf0rea.c, include/srv0srv.h, srv/srv0srv.c
|
||||||
|
@ -797,7 +797,7 @@ btr_create(
|
|||||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
|
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new index page on the the allocated segment page */
|
/* Create a new index page on the allocated segment page */
|
||||||
page_zip = buf_block_get_page_zip(block);
|
page_zip = buf_block_get_page_zip(block);
|
||||||
|
|
||||||
if (UNIV_LIKELY_NULL(page_zip)) {
|
if (UNIV_LIKELY_NULL(page_zip)) {
|
||||||
@ -1902,7 +1902,7 @@ func_start:
|
|||||||
n_uniq, &heap);
|
n_uniq, &heap);
|
||||||
|
|
||||||
/* If the new record is less than the existing record
|
/* If the new record is less than the existing record
|
||||||
the the split in the middle will copy the existing
|
the split in the middle will copy the existing
|
||||||
record to the new node. */
|
record to the new node. */
|
||||||
if (cmp_dtuple_rec(tuple, first_rec, offsets) < 0) {
|
if (cmp_dtuple_rec(tuple, first_rec, offsets) < 0) {
|
||||||
split_rec = page_get_middle_rec(page);
|
split_rec = page_get_middle_rec(page);
|
||||||
|
@ -378,7 +378,7 @@ buf_read_page(
|
|||||||
Applies linear read-ahead if in the buf_pool the page is a border page of
|
Applies linear read-ahead if in the buf_pool the page is a border page of
|
||||||
a linear read-ahead area and all the pages in the area have been accessed.
|
a linear read-ahead area and all the pages in the area have been accessed.
|
||||||
Does not read any page if the read-ahead mechanism is not activated. Note
|
Does not read any page if the read-ahead mechanism is not activated. Note
|
||||||
that the the algorithm looks at the 'natural' adjacent successor and
|
that the algorithm looks at the 'natural' adjacent successor and
|
||||||
predecessor of the page, which on the leaf level of a B-tree are the next
|
predecessor of the page, which on the leaf level of a B-tree are the next
|
||||||
and previous page in the chain of leaves. To know these, the page specified
|
and previous page in the chain of leaves. To know these, the page specified
|
||||||
in (space, offset) must already be present in the buf_pool. Thus, the
|
in (space, offset) must already be present in the buf_pool. Thus, the
|
||||||
|
@ -1099,7 +1099,7 @@ fsp_header_inc_size(
|
|||||||
|
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
Gets the current free limit of the system tablespace. The free limit
|
Gets the current free limit of the system tablespace. The free limit
|
||||||
means the place of the first page which has never been put to the the
|
means the place of the first page which has never been put to the
|
||||||
free list for allocation. The space above that address is initialized
|
free list for allocation. The space above that address is initialized
|
||||||
to zero. Sets also the global variable log_fsp_current_free_limit.
|
to zero. Sets also the global variable log_fsp_current_free_limit.
|
||||||
@return free limit in megabytes */
|
@return free limit in megabytes */
|
||||||
|
@ -663,7 +663,7 @@ ha_innobase::add_index(
|
|||||||
if (UNIV_UNLIKELY(error)) {
|
if (UNIV_UNLIKELY(error)) {
|
||||||
err_exit:
|
err_exit:
|
||||||
mem_heap_free(heap);
|
mem_heap_free(heap);
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx_free_for_mysql(trx);
|
trx_free_for_mysql(trx);
|
||||||
trx_commit_for_mysql(prebuilt->trx);
|
trx_commit_for_mysql(prebuilt->trx);
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
@ -801,7 +801,7 @@ error_handling:
|
|||||||
alter table t drop index b, add index (b);
|
alter table t drop index b, add index (b);
|
||||||
|
|
||||||
The fix will have to parse the SQL and note that the index
|
The fix will have to parse the SQL and note that the index
|
||||||
being added has the same name as the the one being dropped and
|
being added has the same name as the one being dropped and
|
||||||
ignore that in the dup index check.*/
|
ignore that in the dup index check.*/
|
||||||
//dict_table_check_for_dup_indexes(prebuilt->table);
|
//dict_table_check_for_dup_indexes(prebuilt->table);
|
||||||
#endif
|
#endif
|
||||||
@ -863,6 +863,7 @@ error_handling:
|
|||||||
indexed_table->n_mysql_handles_opened++;
|
indexed_table->n_mysql_handles_opened++;
|
||||||
|
|
||||||
error = row_merge_drop_table(trx, innodb_table);
|
error = row_merge_drop_table(trx, innodb_table);
|
||||||
|
innodb_table = indexed_table;
|
||||||
goto convert_error;
|
goto convert_error;
|
||||||
|
|
||||||
case DB_TOO_BIG_RECORD:
|
case DB_TOO_BIG_RECORD:
|
||||||
|
@ -48,7 +48,7 @@ buf_read_page(
|
|||||||
Applies linear read-ahead if in the buf_pool the page is a border page of
|
Applies linear read-ahead if in the buf_pool the page is a border page of
|
||||||
a linear read-ahead area and all the pages in the area have been accessed.
|
a linear read-ahead area and all the pages in the area have been accessed.
|
||||||
Does not read any page if the read-ahead mechanism is not activated. Note
|
Does not read any page if the read-ahead mechanism is not activated. Note
|
||||||
that the the algorithm looks at the 'natural' adjacent successor and
|
that the algorithm looks at the 'natural' adjacent successor and
|
||||||
predecessor of the page, which on the leaf level of a B-tree are the next
|
predecessor of the page, which on the leaf level of a B-tree are the next
|
||||||
and previous page in the chain of leaves. To know these, the page specified
|
and previous page in the chain of leaves. To know these, the page specified
|
||||||
in (space, offset) must already be present in the buf_pool. Thus, the
|
in (space, offset) must already be present in the buf_pool. Thus, the
|
||||||
|
@ -317,7 +317,7 @@ struct dict_foreign_struct{
|
|||||||
char* id; /*!< id of the constraint as a
|
char* id; /*!< id of the constraint as a
|
||||||
null-terminated string */
|
null-terminated string */
|
||||||
unsigned n_fields:10; /*!< number of indexes' first fields
|
unsigned n_fields:10; /*!< number of indexes' first fields
|
||||||
for which the the foreign key
|
for which the foreign key
|
||||||
constraint is defined: we allow the
|
constraint is defined: we allow the
|
||||||
indexes to contain more fields than
|
indexes to contain more fields than
|
||||||
mentioned in the constraint, as long
|
mentioned in the constraint, as long
|
||||||
|
@ -42,7 +42,7 @@ fsp_init(void);
|
|||||||
/*==========*/
|
/*==========*/
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
Gets the current free limit of the system tablespace. The free limit
|
Gets the current free limit of the system tablespace. The free limit
|
||||||
means the place of the first page which has never been put to the the
|
means the place of the first page which has never been put to the
|
||||||
free list for allocation. The space above that address is initialized
|
free list for allocation. The space above that address is initialized
|
||||||
to zero. Sets also the global variable log_fsp_current_free_limit.
|
to zero. Sets also the global variable log_fsp_current_free_limit.
|
||||||
@return free limit in megabytes */
|
@return free limit in megabytes */
|
||||||
|
@ -283,7 +283,7 @@ log_make_checkpoint_at(
|
|||||||
later lsn, if IB_ULONGLONG_MAX, makes
|
later lsn, if IB_ULONGLONG_MAX, makes
|
||||||
a checkpoint at the latest lsn */
|
a checkpoint at the latest lsn */
|
||||||
ibool write_always); /*!< in: the function normally checks if
|
ibool write_always); /*!< in: the function normally checks if
|
||||||
the the new checkpoint would have a
|
the new checkpoint would have a
|
||||||
greater lsn than the previous one: if
|
greater lsn than the previous one: if
|
||||||
not, then no physical write is done;
|
not, then no physical write is done;
|
||||||
by setting this parameter TRUE, a
|
by setting this parameter TRUE, a
|
||||||
|
@ -89,7 +89,7 @@ cmp_dfield_dfield(
|
|||||||
/*************************************************************//**
|
/*************************************************************//**
|
||||||
This function is used to compare a data tuple to a physical record.
|
This function is used to compare a data tuple to a physical record.
|
||||||
Only dtuple->n_fields_cmp first fields are taken into account for
|
Only dtuple->n_fields_cmp first fields are taken into account for
|
||||||
the the data tuple! If we denote by n = n_fields_cmp, then rec must
|
the data tuple! If we denote by n = n_fields_cmp, then rec must
|
||||||
have either m >= n fields, or it must differ from dtuple in some of
|
have either m >= n fields, or it must differ from dtuple in some of
|
||||||
the m fields rec has. If rec has an externally stored field we do not
|
the m fields rec has. If rec has an externally stored field we do not
|
||||||
compare it but return with value 0 if such a comparison should be
|
compare it but return with value 0 if such a comparison should be
|
||||||
|
@ -65,7 +65,7 @@ most significant bytes and bits are written below less significant.
|
|||||||
- offset_of_this_record) mod 64Ki,
|
- offset_of_this_record) mod 64Ki,
|
||||||
where mod is the modulo as a non-negative
|
where mod is the modulo as a non-negative
|
||||||
number;
|
number;
|
||||||
we can calculate the the offset of the next
|
we can calculate the offset of the next
|
||||||
record with the formula:
|
record with the formula:
|
||||||
relative_offset + offset_of_this_record
|
relative_offset + offset_of_this_record
|
||||||
mod UNIV_PAGE_SIZE
|
mod UNIV_PAGE_SIZE
|
||||||
|
@ -44,8 +44,8 @@ UNIV_INLINE
|
|||||||
trx_undo_rec_t*
|
trx_undo_rec_t*
|
||||||
trx_undo_rec_copy(
|
trx_undo_rec_copy(
|
||||||
/*==============*/
|
/*==============*/
|
||||||
trx_undo_rec_t* undo_rec, /*!< in: undo log record */
|
const trx_undo_rec_t* undo_rec, /*!< in: undo log record */
|
||||||
mem_heap_t* heap); /*!< in: heap where copied */
|
mem_heap_t* heap); /*!< in: heap where copied */
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
Reads the undo log record type.
|
Reads the undo log record type.
|
||||||
@return record type */
|
@return record type */
|
||||||
|
@ -100,8 +100,8 @@ UNIV_INLINE
|
|||||||
trx_undo_rec_t*
|
trx_undo_rec_t*
|
||||||
trx_undo_rec_copy(
|
trx_undo_rec_copy(
|
||||||
/*==============*/
|
/*==============*/
|
||||||
trx_undo_rec_t* undo_rec, /*!< in: undo log record */
|
const trx_undo_rec_t* undo_rec, /*!< in: undo log record */
|
||||||
mem_heap_t* heap) /*!< in: heap where copied */
|
mem_heap_t* heap) /*!< in: heap where copied */
|
||||||
{
|
{
|
||||||
ulint len;
|
ulint len;
|
||||||
|
|
||||||
|
@ -208,9 +208,9 @@ int
|
|||||||
trx_general_rollback_for_mysql(
|
trx_general_rollback_for_mysql(
|
||||||
/*===========================*/
|
/*===========================*/
|
||||||
trx_t* trx, /*!< in: transaction handle */
|
trx_t* trx, /*!< in: transaction handle */
|
||||||
ibool partial,/*!< in: TRUE if partial rollback requested */
|
|
||||||
trx_savept_t* savept);/*!< in: pointer to savepoint undo number, if
|
trx_savept_t* savept);/*!< in: pointer to savepoint undo number, if
|
||||||
partial rollback requested */
|
partial rollback requested, or NULL for
|
||||||
|
complete rollback */
|
||||||
/*******************************************************************//**
|
/*******************************************************************//**
|
||||||
Rolls back a transaction back to a named savepoint. Modifications after the
|
Rolls back a transaction back to a named savepoint. Modifications after the
|
||||||
savepoint are undone but InnoDB does NOT release the corresponding locks
|
savepoint are undone but InnoDB does NOT release the corresponding locks
|
||||||
|
@ -34,11 +34,11 @@ typedef byte trx_sysf_rseg_t;
|
|||||||
|
|
||||||
/* Rollback segment specification slot offsets */
|
/* Rollback segment specification slot offsets */
|
||||||
/*-------------------------------------------------------------*/
|
/*-------------------------------------------------------------*/
|
||||||
#define TRX_SYS_RSEG_SPACE 0 /* space where the the segment
|
#define TRX_SYS_RSEG_SPACE 0 /* space where the segment
|
||||||
header is placed; starting with
|
header is placed; starting with
|
||||||
MySQL/InnoDB 5.1.7, this is
|
MySQL/InnoDB 5.1.7, this is
|
||||||
UNIV_UNDEFINED if the slot is unused */
|
UNIV_UNDEFINED if the slot is unused */
|
||||||
#define TRX_SYS_RSEG_PAGE_NO 4 /* page number where the the segment
|
#define TRX_SYS_RSEG_PAGE_NO 4 /* page number where the segment
|
||||||
header is placed; this is FIL_NULL
|
header is placed; this is FIL_NULL
|
||||||
if the slot is unused */
|
if the slot is unused */
|
||||||
/*-------------------------------------------------------------*/
|
/*-------------------------------------------------------------*/
|
||||||
|
@ -360,7 +360,7 @@ enum trx_dict_op {
|
|||||||
operation modes in crash recovery. */
|
operation modes in crash recovery. */
|
||||||
TRX_DICT_OP_TABLE = 1,
|
TRX_DICT_OP_TABLE = 1,
|
||||||
/** The transaction is creating or dropping an index in an
|
/** The transaction is creating or dropping an index in an
|
||||||
existing table. In crash recovery, the the data dictionary
|
existing table. In crash recovery, the data dictionary
|
||||||
must be locked, but the table must not be dropped. */
|
must be locked, but the table must not be dropped. */
|
||||||
TRX_DICT_OP_INDEX = 2
|
TRX_DICT_OP_INDEX = 2
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri
|
|||||||
|
|
||||||
#define INNODB_VERSION_MAJOR 1
|
#define INNODB_VERSION_MAJOR 1
|
||||||
#define INNODB_VERSION_MINOR 0
|
#define INNODB_VERSION_MINOR 0
|
||||||
#define INNODB_VERSION_BUGFIX 4
|
#define INNODB_VERSION_BUGFIX 5
|
||||||
|
|
||||||
/* The following is the InnoDB version as shown in
|
/* The following is the InnoDB version as shown in
|
||||||
SELECT plugin_version FROM information_schema.plugins;
|
SELECT plugin_version FROM information_schema.plugins;
|
||||||
|
@ -214,7 +214,7 @@ a waiting s-lock request on the next record? If this s-lock was placed
|
|||||||
by a read cursor moving in the ascending order in the index, we cannot
|
by a read cursor moving in the ascending order in the index, we cannot
|
||||||
do the insert immediately, because when we finally commit our transaction,
|
do the insert immediately, because when we finally commit our transaction,
|
||||||
the read cursor should see also the new inserted record. So we should
|
the read cursor should see also the new inserted record. So we should
|
||||||
move the read cursor backward from the the next record for it to pass over
|
move the read cursor backward from the next record for it to pass over
|
||||||
the new inserted record. This move backward may be too cumbersome to
|
the new inserted record. This move backward may be too cumbersome to
|
||||||
implement. If we in this situation just enqueue a second x-lock request
|
implement. If we in this situation just enqueue a second x-lock request
|
||||||
for our transaction on the next record, then the deadlock mechanism
|
for our transaction on the next record, then the deadlock mechanism
|
||||||
@ -3580,7 +3580,8 @@ lock_table_remove_low(
|
|||||||
and lock_grant()). Therefore it can be empty and we
|
and lock_grant()). Therefore it can be empty and we
|
||||||
need to check for that. */
|
need to check for that. */
|
||||||
|
|
||||||
if (!ib_vector_is_empty(trx->autoinc_locks)) {
|
if (!lock_get_wait(lock)
|
||||||
|
&& !ib_vector_is_empty(trx->autoinc_locks)) {
|
||||||
lock_t* autoinc_lock;
|
lock_t* autoinc_lock;
|
||||||
|
|
||||||
autoinc_lock = ib_vector_pop(trx->autoinc_locks);
|
autoinc_lock = ib_vector_pop(trx->autoinc_locks);
|
||||||
@ -3653,8 +3654,10 @@ lock_table_enqueue_waiting(
|
|||||||
|
|
||||||
if (lock_deadlock_occurs(lock, trx)) {
|
if (lock_deadlock_occurs(lock, trx)) {
|
||||||
|
|
||||||
lock_reset_lock_and_trx_wait(lock);
|
/* The order here is important, we don't want to
|
||||||
|
lose the state of the lock before calling remove. */
|
||||||
lock_table_remove_low(lock);
|
lock_table_remove_low(lock);
|
||||||
|
lock_reset_lock_and_trx_wait(lock);
|
||||||
|
|
||||||
return(DB_DEADLOCK);
|
return(DB_DEADLOCK);
|
||||||
}
|
}
|
||||||
|
@ -2047,7 +2047,7 @@ log_make_checkpoint_at(
|
|||||||
later lsn, if IB_ULONGLONG_MAX, makes
|
later lsn, if IB_ULONGLONG_MAX, makes
|
||||||
a checkpoint at the latest lsn */
|
a checkpoint at the latest lsn */
|
||||||
ibool write_always) /*!< in: the function normally checks if
|
ibool write_always) /*!< in: the function normally checks if
|
||||||
the the new checkpoint would have a
|
the new checkpoint would have a
|
||||||
greater lsn than the previous one: if
|
greater lsn than the previous one: if
|
||||||
not, then no physical write is done;
|
not, then no physical write is done;
|
||||||
by setting this parameter TRUE, a
|
by setting this parameter TRUE, a
|
||||||
|
@ -475,16 +475,18 @@ mem_heap_block_free(
|
|||||||
len = block->len;
|
len = block->len;
|
||||||
block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
|
block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
|
||||||
|
|
||||||
|
#ifndef UNIV_HOTBACKUP
|
||||||
|
if (!srv_use_sys_malloc) {
|
||||||
#ifdef UNIV_MEM_DEBUG
|
#ifdef UNIV_MEM_DEBUG
|
||||||
/* In the debug version we set the memory to a random combination
|
/* In the debug version we set the memory to a random
|
||||||
of hex 0xDE and 0xAD. */
|
combination of hex 0xDE and 0xAD. */
|
||||||
|
|
||||||
mem_erase_buf((byte*)block, len);
|
mem_erase_buf((byte*)block, len);
|
||||||
#else /* UNIV_MEM_DEBUG */
|
#else /* UNIV_MEM_DEBUG */
|
||||||
UNIV_MEM_ASSERT_AND_FREE(block, len);
|
UNIV_MEM_ASSERT_AND_FREE(block, len);
|
||||||
#endif /* UNIV_MEM_DEBUG */
|
#endif /* UNIV_MEM_DEBUG */
|
||||||
|
|
||||||
#ifndef UNIV_HOTBACKUP
|
}
|
||||||
if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) {
|
if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) {
|
||||||
|
|
||||||
ut_ad(!buf_block);
|
ut_ad(!buf_block);
|
||||||
@ -495,6 +497,14 @@ mem_heap_block_free(
|
|||||||
buf_block_free(buf_block);
|
buf_block_free(buf_block);
|
||||||
}
|
}
|
||||||
#else /* !UNIV_HOTBACKUP */
|
#else /* !UNIV_HOTBACKUP */
|
||||||
|
#ifdef UNIV_MEM_DEBUG
|
||||||
|
/* In the debug version we set the memory to a random
|
||||||
|
combination of hex 0xDE and 0xAD. */
|
||||||
|
|
||||||
|
mem_erase_buf((byte*)block, len);
|
||||||
|
#else /* UNIV_MEM_DEBUG */
|
||||||
|
UNIV_MEM_ASSERT_AND_FREE(block, len);
|
||||||
|
#endif /* UNIV_MEM_DEBUG */
|
||||||
ut_free(block);
|
ut_free(block);
|
||||||
#endif /* !UNIV_HOTBACKUP */
|
#endif /* !UNIV_HOTBACKUP */
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ Created 2/2/1994 Heikki Tuuri
|
|||||||
==============
|
==============
|
||||||
|
|
||||||
The index page consists of a page header which contains the page's
|
The index page consists of a page header which contains the page's
|
||||||
id and other information. On top of it are the the index records
|
id and other information. On top of it are the index records
|
||||||
in a heap linked into a one way linear list according to alphabetic order.
|
in a heap linked into a one way linear list according to alphabetic order.
|
||||||
|
|
||||||
Just below page end is an array of pointers which we call page directory,
|
Just below page end is an array of pointers which we call page directory,
|
||||||
|
@ -36,7 +36,7 @@ Created 7/1/1994 Heikki Tuuri
|
|||||||
|
|
||||||
The records are put into alphabetical order in the following
|
The records are put into alphabetical order in the following
|
||||||
way: let F be the first field where two records disagree.
|
way: let F be the first field where two records disagree.
|
||||||
If there is a character in some position n where the the
|
If there is a character in some position n where the
|
||||||
records disagree, the order is determined by comparison of
|
records disagree, the order is determined by comparison of
|
||||||
the characters at position n, possibly after
|
the characters at position n, possibly after
|
||||||
collating transformation. If there is no such character,
|
collating transformation. If there is no such character,
|
||||||
@ -76,7 +76,7 @@ cmp_debug_dtuple_rec_with_match(
|
|||||||
/*************************************************************//**
|
/*************************************************************//**
|
||||||
This function is used to compare two data fields for which the data type
|
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
|
is such that we must use MySQL code to compare them. The prototype here
|
||||||
must be a copy of the the one in ha_innobase.cc!
|
must be a copy of the one in ha_innobase.cc!
|
||||||
@return 1, 0, -1, if a is greater, equal, less than b, respectively */
|
@return 1, 0, -1, if a is greater, equal, less than b, respectively */
|
||||||
extern
|
extern
|
||||||
int
|
int
|
||||||
@ -399,7 +399,7 @@ next_byte:
|
|||||||
/*************************************************************//**
|
/*************************************************************//**
|
||||||
This function is used to compare a data tuple to a physical record.
|
This function is used to compare a data tuple to a physical record.
|
||||||
Only dtuple->n_fields_cmp first fields are taken into account for
|
Only dtuple->n_fields_cmp first fields are taken into account for
|
||||||
the the data tuple! If we denote by n = n_fields_cmp, then rec must
|
the data tuple! If we denote by n = n_fields_cmp, then rec must
|
||||||
have either m >= n fields, or it must differ from dtuple in some of
|
have either m >= n fields, or it must differ from dtuple in some of
|
||||||
the m fields rec has. If rec has an externally stored field we do not
|
the m fields rec has. If rec has an externally stored field we do not
|
||||||
compare it but return with value 0 if such a comparison should be
|
compare it but return with value 0 if such a comparison should be
|
||||||
|
@ -2129,7 +2129,7 @@ row_merge_rename_tables(
|
|||||||
if (err != DB_SUCCESS) {
|
if (err != DB_SUCCESS) {
|
||||||
err_exit:
|
err_exit:
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ handle_new_error:
|
|||||||
switch (err) {
|
switch (err) {
|
||||||
case DB_LOCK_WAIT_TIMEOUT:
|
case DB_LOCK_WAIT_TIMEOUT:
|
||||||
if (row_rollback_on_timeout) {
|
if (row_rollback_on_timeout) {
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
@ -526,7 +526,7 @@ handle_new_error:
|
|||||||
/* Roll back the latest, possibly incomplete
|
/* Roll back the latest, possibly incomplete
|
||||||
insertion or update */
|
insertion or update */
|
||||||
|
|
||||||
trx_general_rollback_for_mysql(trx, TRUE, savept);
|
trx_general_rollback_for_mysql(trx, savept);
|
||||||
}
|
}
|
||||||
/* MySQL will roll back the latest SQL statement */
|
/* MySQL will roll back the latest SQL statement */
|
||||||
break;
|
break;
|
||||||
@ -548,7 +548,7 @@ handle_new_error:
|
|||||||
/* Roll back the whole transaction; this resolution was added
|
/* Roll back the whole transaction; this resolution was added
|
||||||
to version 3.23.43 */
|
to version 3.23.43 */
|
||||||
|
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DB_MUST_GET_MORE_FILE_SPACE:
|
case DB_MUST_GET_MORE_FILE_SPACE:
|
||||||
@ -1885,7 +1885,7 @@ err_exit:
|
|||||||
|
|
||||||
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
|
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (err) {
|
switch (err) {
|
||||||
@ -2053,7 +2053,7 @@ error_handling:
|
|||||||
|
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
|
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
|
|
||||||
row_drop_table_for_mysql(table_name, trx, FALSE);
|
row_drop_table_for_mysql(table_name, trx, FALSE);
|
||||||
|
|
||||||
@ -2121,7 +2121,7 @@ row_table_add_foreign_constraints(
|
|||||||
|
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
|
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
|
|
||||||
row_drop_table_for_mysql(name, trx, FALSE);
|
row_drop_table_for_mysql(name, trx, FALSE);
|
||||||
|
|
||||||
@ -2488,7 +2488,7 @@ row_discard_tablespace_for_mysql(
|
|||||||
|
|
||||||
if (err != DB_SUCCESS) {
|
if (err != DB_SUCCESS) {
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
dict_table_change_id_in_cache(table, new_id);
|
dict_table_change_id_in_cache(table, new_id);
|
||||||
@ -2497,7 +2497,7 @@ row_discard_tablespace_for_mysql(
|
|||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
|
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
@ -2949,7 +2949,7 @@ next_rec:
|
|||||||
|
|
||||||
if (err != DB_SUCCESS) {
|
if (err != DB_SUCCESS) {
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
ut_print_timestamp(stderr);
|
ut_print_timestamp(stderr);
|
||||||
fputs(" InnoDB: Unable to assign a new identifier to table ",
|
fputs(" InnoDB: Unable to assign a new identifier to table ",
|
||||||
@ -3854,7 +3854,7 @@ end:
|
|||||||
"InnoDB: succeed.\n", stderr);
|
"InnoDB: succeed.\n", stderr);
|
||||||
}
|
}
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
/* The following call will also rename the .ibd data file if
|
/* The following call will also rename the .ibd data file if
|
||||||
@ -3863,7 +3863,7 @@ end:
|
|||||||
if (!dict_table_rename_in_cache(table, new_name,
|
if (!dict_table_rename_in_cache(table, new_name,
|
||||||
!new_is_tmp)) {
|
!new_is_tmp)) {
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
goto funct_exit;
|
goto funct_exit;
|
||||||
}
|
}
|
||||||
@ -3903,7 +3903,7 @@ end:
|
|||||||
ut_a(dict_table_rename_in_cache(table,
|
ut_a(dict_table_rename_in_cache(table,
|
||||||
old_name, FALSE));
|
old_name, FALSE));
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
trx_general_rollback_for_mysql(trx, NULL);
|
||||||
trx->error_state = DB_SUCCESS;
|
trx->error_state = DB_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -614,7 +614,7 @@ future, but at the moment we plan to implement a more coarse solution,
|
|||||||
which could be called a global priority inheritance. If a thread
|
which could be called a global priority inheritance. If a thread
|
||||||
has to wait for a long time, say 300 milliseconds, for a resource,
|
has to wait for a long time, say 300 milliseconds, for a resource,
|
||||||
we just guess that it may be waiting for a resource owned by a background
|
we just guess that it may be waiting for a resource owned by a background
|
||||||
thread, and boost the the priority of all runnable background threads
|
thread, and boost the priority of all runnable background threads
|
||||||
to the normal level. The background threads then themselves adjust
|
to the normal level. The background threads then themselves adjust
|
||||||
their fixed priority back to background after releasing all resources
|
their fixed priority back to background after releasing all resources
|
||||||
they had (or, at some fixed points in their program code).
|
they had (or, at some fixed points in their program code).
|
||||||
|
@ -1829,7 +1829,7 @@ innobase_start_or_create_for_mysql(void)
|
|||||||
/* Actually, we did not change the undo log format between
|
/* Actually, we did not change the undo log format between
|
||||||
4.0 and 4.1.1, and we would not need to run purge to
|
4.0 and 4.1.1, and we would not need to run purge to
|
||||||
completion. Note also that the purge algorithm in 4.1.1
|
completion. Note also that the purge algorithm in 4.1.1
|
||||||
can process the the history list again even after a full
|
can process the history list again even after a full
|
||||||
purge, because our algorithm does not cut the end of the
|
purge, because our algorithm does not cut the end of the
|
||||||
history list in all cases so that it would become empty
|
history list in all cases so that it would become empty
|
||||||
after a full purge. That mean that we may purge 4.0 type
|
after a full purge. That mean that we may purge 4.0 type
|
||||||
|
@ -62,7 +62,7 @@ struct thr_local_struct{
|
|||||||
os_thread_t handle; /*!< operating system handle to the thread */
|
os_thread_t handle; /*!< operating system handle to the thread */
|
||||||
ulint slot_no;/*!< the index of the slot in the thread table
|
ulint slot_no;/*!< the index of the slot in the thread table
|
||||||
for this thread */
|
for this thread */
|
||||||
ibool in_ibuf;/*!< TRUE if the the thread is doing an ibuf
|
ibool in_ibuf;/*!< TRUE if the thread is doing an ibuf
|
||||||
operation */
|
operation */
|
||||||
hash_node_t hash; /*!< hash chain node */
|
hash_node_t hash; /*!< hash chain node */
|
||||||
ulint magic_n;/*!< magic number (THR_LOCAL_MAGIC_N) */
|
ulint magic_n;/*!< magic number (THR_LOCAL_MAGIC_N) */
|
||||||
|
@ -1333,7 +1333,7 @@ trx_undo_get_undo_rec_low(
|
|||||||
ulint rseg_id;
|
ulint rseg_id;
|
||||||
ulint page_no;
|
ulint page_no;
|
||||||
ulint offset;
|
ulint offset;
|
||||||
page_t* undo_page;
|
const page_t* undo_page;
|
||||||
trx_rseg_t* rseg;
|
trx_rseg_t* rseg;
|
||||||
ibool is_insert;
|
ibool is_insert;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
@ -1572,7 +1572,7 @@ trx_undo_prev_version_build(
|
|||||||
|
|
||||||
/* We have to set the appropriate extern storage bits in the
|
/* We have to set the appropriate extern storage bits in the
|
||||||
old version of the record: the extern bits in rec for those
|
old version of the record: the extern bits in rec for those
|
||||||
fields that update does NOT update, as well as the the bits for
|
fields that update does NOT update, as well as the bits for
|
||||||
those fields that update updates to become externally stored
|
those fields that update updates to become externally stored
|
||||||
fields. Store the info: */
|
fields. Store the info: */
|
||||||
|
|
||||||
|
@ -66,9 +66,9 @@ int
|
|||||||
trx_general_rollback_for_mysql(
|
trx_general_rollback_for_mysql(
|
||||||
/*===========================*/
|
/*===========================*/
|
||||||
trx_t* trx, /*!< in: transaction handle */
|
trx_t* trx, /*!< in: transaction handle */
|
||||||
ibool partial,/*!< in: TRUE if partial rollback requested */
|
|
||||||
trx_savept_t* savept) /*!< in: pointer to savepoint undo number, if
|
trx_savept_t* savept) /*!< in: pointer to savepoint undo number, if
|
||||||
partial rollback requested */
|
partial rollback requested, or NULL for
|
||||||
|
complete rollback */
|
||||||
{
|
{
|
||||||
mem_heap_t* heap;
|
mem_heap_t* heap;
|
||||||
que_thr_t* thr;
|
que_thr_t* thr;
|
||||||
@ -85,9 +85,8 @@ trx_general_rollback_for_mysql(
|
|||||||
|
|
||||||
roll_node = roll_node_create(heap);
|
roll_node = roll_node_create(heap);
|
||||||
|
|
||||||
roll_node->partial = partial;
|
if (savept) {
|
||||||
|
roll_node->partial = TRUE;
|
||||||
if (partial) {
|
|
||||||
roll_node->savept = *savept;
|
roll_node->savept = *savept;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +144,7 @@ trx_rollback_for_mysql(
|
|||||||
the transaction object does not have an InnoDB session object, and we
|
the transaction object does not have an InnoDB session object, and we
|
||||||
set a dummy session that we use for all MySQL transactions. */
|
set a dummy session that we use for all MySQL transactions. */
|
||||||
|
|
||||||
err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
err = trx_general_rollback_for_mysql(trx, NULL);
|
||||||
|
|
||||||
trx->op_info = "";
|
trx->op_info = "";
|
||||||
|
|
||||||
@ -170,8 +169,7 @@ trx_rollback_last_sql_stat_for_mysql(
|
|||||||
|
|
||||||
trx->op_info = "rollback of SQL statement";
|
trx->op_info = "rollback of SQL statement";
|
||||||
|
|
||||||
err = trx_general_rollback_for_mysql(trx, TRUE,
|
err = trx_general_rollback_for_mysql(trx, &trx->last_sql_stat_start);
|
||||||
&(trx->last_sql_stat_start));
|
|
||||||
/* The following call should not be needed, but we play safe: */
|
/* The following call should not be needed, but we play safe: */
|
||||||
trx_mark_sql_stat_end(trx);
|
trx_mark_sql_stat_end(trx);
|
||||||
|
|
||||||
@ -282,7 +280,7 @@ trx_rollback_to_savepoint_for_mysql(
|
|||||||
|
|
||||||
trx->op_info = "rollback to a savepoint";
|
trx->op_info = "rollback to a savepoint";
|
||||||
|
|
||||||
err = trx_general_rollback_for_mysql(trx, TRUE, &(savep->savept));
|
err = trx_general_rollback_for_mysql(trx, &savep->savept);
|
||||||
|
|
||||||
/* Store the current undo_no of the transaction so that we know where
|
/* Store the current undo_no of the transaction so that we know where
|
||||||
to roll back if we have to roll back the next SQL statement: */
|
to roll back if we have to roll back the next SQL statement: */
|
||||||
|
Reference in New Issue
Block a user