Commit 288a3b91 authored by Bjorn Munch's avatar Bjorn Munch

merge 5.5 => 5.5-mtr

parents ef97f0ae 0dc19044
...@@ -142,8 +142,11 @@ EOF ...@@ -142,8 +142,11 @@ EOF
--echo # Simulate loading a plugin libary with multiple entry points. --echo # Simulate loading a plugin libary with multiple entry points.
--echo # This will test the DISABLE to ensure all rows are removed. --echo # This will test the DISABLE to ensure all rows are removed.
--echo # --echo #
--replace_regex /\.dll/.so/
eval INSERT INTO mysql.plugin VALUES ('wicky', '$DAEMONEXAMPLE'); eval INSERT INTO mysql.plugin VALUES ('wicky', '$DAEMONEXAMPLE');
--replace_regex /\.dll/.so/
eval INSERT INTO mysql.plugin VALUES ('wacky', '$DAEMONEXAMPLE'); eval INSERT INTO mysql.plugin VALUES ('wacky', '$DAEMONEXAMPLE');
--replace_regex /\.dll/.so/
eval INSERT INTO mysql.plugin VALUES ('wonky', '$DAEMONEXAMPLE'); eval INSERT INTO mysql.plugin VALUES ('wonky', '$DAEMONEXAMPLE');
--echo # --echo #
......
...@@ -247,6 +247,8 @@ btr_pcur_restore_position_func( ...@@ -247,6 +247,8 @@ btr_pcur_restore_position_func(
cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE, cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE,
index, latch_mode, btr_pcur_get_btr_cur(cursor), mtr); index, latch_mode, btr_pcur_get_btr_cur(cursor), mtr);
cursor->latch_mode = latch_mode;
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
cursor->block_when_stored = btr_pcur_get_block(cursor); cursor->block_when_stored = btr_pcur_get_block(cursor);
return(FALSE); return(FALSE);
......
...@@ -839,6 +839,16 @@ pfs_register_buffer_block( ...@@ -839,6 +839,16 @@ pfs_register_buffer_block(
rwlock->pfs_psi = (PSI_server) rwlock->pfs_psi = (PSI_server)
? PSI_server->init_rwlock(buf_block_lock_key, rwlock) ? PSI_server->init_rwlock(buf_block_lock_key, rwlock)
: NULL; : NULL;
# ifdef UNIV_SYNC_DEBUG
rwlock = &block->debug_latch;
ut_a(!rwlock->pfs_psi);
rwlock->pfs_psi = (PSI_server)
? PSI_server->init_rwlock(buf_block_debug_latch_key,
rwlock)
: NULL;
# endif /* UNIV_SYNC_DEBUG */
# endif /* UNIV_PFS_RWLOCK */ # endif /* UNIV_PFS_RWLOCK */
block++; block++;
} }
...@@ -895,17 +905,24 @@ buf_block_init( ...@@ -895,17 +905,24 @@ buf_block_init(
mutex_create(PFS_NOT_INSTRUMENTED, &block->mutex, SYNC_BUF_BLOCK); mutex_create(PFS_NOT_INSTRUMENTED, &block->mutex, SYNC_BUF_BLOCK);
rw_lock_create(PFS_NOT_INSTRUMENTED, &block->lock, SYNC_LEVEL_VARYING); rw_lock_create(PFS_NOT_INSTRUMENTED, &block->lock, SYNC_LEVEL_VARYING);
# ifdef UNIV_SYNC_DEBUG
rw_lock_create(PFS_NOT_INSTRUMENTED,
&block->debug_latch, SYNC_NO_ORDER_CHECK);
# endif /* UNIV_SYNC_DEBUG */
#else /* PFS_SKIP_BUFFER_MUTEX_RWLOCK || PFS_GROUP_BUFFER_SYNC */ #else /* PFS_SKIP_BUFFER_MUTEX_RWLOCK || PFS_GROUP_BUFFER_SYNC */
mutex_create(buffer_block_mutex_key, &block->mutex, SYNC_BUF_BLOCK); mutex_create(buffer_block_mutex_key, &block->mutex, SYNC_BUF_BLOCK);
rw_lock_create(buf_block_lock_key, &block->lock, SYNC_LEVEL_VARYING); rw_lock_create(buf_block_lock_key, &block->lock, SYNC_LEVEL_VARYING);
# ifdef UNIV_SYNC_DEBUG
rw_lock_create(buf_block_debug_latch_key,
&block->debug_latch, SYNC_NO_ORDER_CHECK);
# endif /* UNIV_SYNC_DEBUG */
#endif /* PFS_SKIP_BUFFER_MUTEX_RWLOCK || PFS_GROUP_BUFFER_SYNC */ #endif /* PFS_SKIP_BUFFER_MUTEX_RWLOCK || PFS_GROUP_BUFFER_SYNC */
ut_ad(rw_lock_validate(&(block->lock))); ut_ad(rw_lock_validate(&(block->lock)));
#ifdef UNIV_SYNC_DEBUG
rw_lock_create(buf_block_debug_latch_key,
&block->debug_latch, SYNC_NO_ORDER_CHECK);
#endif /* UNIV_SYNC_DEBUG */
} }
/********************************************************************//** /********************************************************************//**
......
...@@ -5700,6 +5700,7 @@ ha_innobase::index_read( ...@@ -5700,6 +5700,7 @@ ha_innobase::index_read(
(byte*) key_ptr, (byte*) key_ptr,
(ulint) key_len, (ulint) key_len,
prebuilt->trx); prebuilt->trx);
DBUG_ASSERT(prebuilt->search_tuple->n_fields > 0);
} else { } else {
/* We position the cursor to the last or the first entry /* We position the cursor to the last or the first entry
in the index */ in the index */
...@@ -7527,6 +7528,7 @@ ha_innobase::records_in_range( ...@@ -7527,6 +7528,7 @@ ha_innobase::records_in_range(
mem_heap_t* heap; mem_heap_t* heap;
DBUG_ENTER("records_in_range"); DBUG_ENTER("records_in_range");
DBUG_ASSERT(min_key || max_key);
ut_a(prebuilt->trx == thd_to_trx(ha_thd())); ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
...@@ -7576,6 +7578,9 @@ ha_innobase::records_in_range( ...@@ -7576,6 +7578,9 @@ ha_innobase::records_in_range(
(const uchar*) 0), (const uchar*) 0),
(ulint) (min_key ? min_key->length : 0), (ulint) (min_key ? min_key->length : 0),
prebuilt->trx); prebuilt->trx);
DBUG_ASSERT(min_key
? range_start->n_fields > 0
: range_start->n_fields == 0);
row_sel_convert_mysql_key_to_innobase( row_sel_convert_mysql_key_to_innobase(
range_end, (byte*) key_val_buff2, range_end, (byte*) key_val_buff2,
...@@ -7584,6 +7589,9 @@ ha_innobase::records_in_range( ...@@ -7584,6 +7589,9 @@ ha_innobase::records_in_range(
(const uchar*) 0), (const uchar*) 0),
(ulint) (max_key ? max_key->length : 0), (ulint) (max_key ? max_key->length : 0),
prebuilt->trx); prebuilt->trx);
DBUG_ASSERT(max_key
? range_end->n_fields > 0
: range_end->n_fields == 0);
mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag : mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag :
HA_READ_KEY_EXACT); HA_READ_KEY_EXACT);
......
This diff is collapsed.
...@@ -263,14 +263,6 @@ btr_pcur_commit_specify_mtr( ...@@ -263,14 +263,6 @@ btr_pcur_commit_specify_mtr(
/*========================*/ /*========================*/
btr_pcur_t* pcur, /*!< in: persistent cursor */ btr_pcur_t* pcur, /*!< in: persistent cursor */
mtr_t* mtr); /*!< in: mtr to commit */ mtr_t* mtr); /*!< in: mtr to commit */
/**************************************************************//**
Tests if a cursor is detached: that is the latch mode is BTR_NO_LATCHES.
@return TRUE if detached */
UNIV_INLINE
ibool
btr_pcur_is_detached(
/*=================*/
btr_pcur_t* pcur); /*!< in: persistent cursor */
/*********************************************************//** /*********************************************************//**
Moves the persistent cursor to the next record in the tree. If no records are Moves the persistent cursor to the next record in the tree. If no records are
left, the cursor stays 'after last in tree'. left, the cursor stays 'after last in tree'.
......
...@@ -388,38 +388,6 @@ btr_pcur_commit_specify_mtr( ...@@ -388,38 +388,6 @@ btr_pcur_commit_specify_mtr(
pcur->pos_state = BTR_PCUR_WAS_POSITIONED; pcur->pos_state = BTR_PCUR_WAS_POSITIONED;
} }
/**************************************************************//**
Sets the pcur latch mode to BTR_NO_LATCHES. */
UNIV_INLINE
void
btr_pcur_detach(
/*============*/
btr_pcur_t* pcur) /*!< in: persistent cursor */
{
ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED);
pcur->latch_mode = BTR_NO_LATCHES;
pcur->pos_state = BTR_PCUR_WAS_POSITIONED;
}
/**************************************************************//**
Tests if a cursor is detached: that is the latch mode is BTR_NO_LATCHES.
@return TRUE if detached */
UNIV_INLINE
ibool
btr_pcur_is_detached(
/*=================*/
btr_pcur_t* pcur) /*!< in: persistent cursor */
{
if (pcur->latch_mode == BTR_NO_LATCHES) {
return(TRUE);
}
return(FALSE);
}
/**************************************************************//** /**************************************************************//**
Sets the old_rec_buf field to NULL. */ Sets the old_rec_buf field to NULL. */
UNIV_INLINE UNIV_INLINE
......
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