MDEV-24188: Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä 2020-11-13 20:41:48 +02:00
commit f9f2f37495
6 changed files with 96 additions and 57 deletions

View file

@ -330,6 +330,24 @@ public:
return(true);
}
/**
Iterate over each block and call the functor.
@return false if iteration was terminated. */
template <typename Functor>
bool for_each_block(const Functor& functor) const
{
for (typename list_t::iterator it = m_list.begin(),
end = m_list.end();
it != end; ++it) {
if (!functor(&*it)) {
return false;
}
}
return(true);
}
/**
Iterate over all the blocks in reverse and call the iterator
@return false if iteration was terminated. */

View file

@ -437,10 +437,9 @@ struct mtr_t {
static inline bool is_block_dirtied(const buf_block_t* block)
MY_ATTRIBUTE((warn_unused_result));
/** Get the buffer fix count for the block added by this mtr.
@param[in] block block to be checked
@return number of buffer count added by this mtr */
int32_t get_fix_count(const buf_block_t *block);
/** Check if we are holding a block latch in exclusive mode
@param block buffer pool block to search for */
bool have_x_latch(const buf_block_t& block) const;
private:
/** Prepare to write the mini-transaction log to the redo log buffer.
@return number of bytes to write in finish_write() */

View file

@ -508,7 +508,7 @@ the pass value == 0. */
bool
rw_lock_own(
/*========*/
rw_lock_t* lock, /*!< in: rw-lock */
const rw_lock_t*lock, /*!< in: rw-lock */
ulint lock_type) /*!< in: lock type: RW_LOCK_S,
RW_LOCK_X */
MY_ATTRIBUTE((warn_unused_result));