Skip to content

Commit

Permalink
Merge branch 'merge-xtradb-5.5' into 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Jul 18, 2017
2 parents 58aaae6 + 46977e0 commit 59fca58
Show file tree
Hide file tree
Showing 30 changed files with 244 additions and 203 deletions.
2 changes: 1 addition & 1 deletion storage/xtradb/btr/btr0btr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,7 @@ Removes a page from the level list of pages.

/*************************************************************//**
Removes a page from the level list of pages. */
static __attribute__((nonnull))
static
void
btr_level_list_remove_func(
/*=======================*/
Expand Down
4 changes: 2 additions & 2 deletions storage/xtradb/dict/dict0crea.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ dict_create_sys_tables_tuple(
if (table->flags & (~DICT_TF_COMPACT & ~(~0U << DICT_TF_BITS))) {
ut_a(table->flags & DICT_TF_COMPACT);
ut_a(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
ut_a(((ulonglong) table->flags & DICT_TF_ZSSIZE_MASK)
<= (ulonglong) (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT));
ut_a((table->flags & DICT_TF_ZSSIZE_MASK)
<= (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT));
ut_a(!(table->flags & (~0U << DICT_TF2_BITS)));
mach_write_to_4(ptr, table->flags & ~(~0U << DICT_TF_BITS));
} else {
Expand Down
7 changes: 3 additions & 4 deletions storage/xtradb/fsp/fsp0fsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ fsp_fill_free_list(
then we do not allocate more extents */
ulint space, /*!< in: space */
fsp_header_t* header, /*!< in/out: space header */
mtr_t* mtr) /*!< in/out: mini-transaction */
__attribute__((nonnull));
mtr_t* mtr); /*!< in/out: mini-transaction */
/**********************************************************************//**
Allocates a single free page from a segment. This function implements
the intelligent allocation strategy which tries to minimize file space
Expand Down Expand Up @@ -279,7 +278,7 @@ fseg_alloc_free_page_low(
in which the page should be initialized.
If init_mtr!=mtr, but the page is already
latched in mtr, do not initialize the page. */
__attribute__((warn_unused_result, nonnull));
__attribute__((warn_unused_result));
#endif /* !UNIV_HOTBACKUP */

/**********************************************************************//**
Expand Down Expand Up @@ -1568,7 +1567,7 @@ Allocates a single free page from a space. The page is marked as used.
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
static __attribute__((nonnull, warn_unused_result))
static __attribute__((warn_unused_result))
buf_block_t*
fsp_alloc_free_page(
/*================*/
Expand Down
24 changes: 1 addition & 23 deletions storage/xtradb/handler/i_s.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7423,29 +7423,7 @@ i_s_innodb_changed_pages_fill(

while(log_online_bitmap_iterator_next(&i) &&
(!srv_max_changed_pages ||
output_rows_num < srv_max_changed_pages) &&
/*
There is no need to compare both start LSN and end LSN fields
with maximum value. It's enough to compare only start LSN.
Example:
max_lsn = 100
\\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1
I------I I-------I I-------------I I----I
////////////////// | - Query 2
1 2 3 4
Query 1:
SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100
will select 1,2,3 bitmaps
Query 2:
SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100
will select 1,2 bitmaps
The condition start_lsn <= 100 will be false after reading
1,2,3 bitmaps which suits for both cases.
*/
LOG_BITMAP_ITERATOR_START_LSN(i) <= max_lsn)
output_rows_num < srv_max_changed_pages))
{
if (!LOG_BITMAP_ITERATOR_PAGE_CHANGED(i))
continue;
Expand Down
13 changes: 5 additions & 8 deletions storage/xtradb/include/btr0cur.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ btr_cur_update_alloc_zip(
FALSE=update-in-place */
mtr_t* mtr, /*!< in: mini-transaction */
trx_t* trx) /*!< in: NULL or transaction */
__attribute__((nonnull (1, 2, 3, 6), warn_unused_result));
__attribute__((warn_unused_result));
/*************************************************************//**
Updates a record when the update causes no size changes in its fields.
@return DB_SUCCESS or error number */
Expand Down Expand Up @@ -345,8 +345,7 @@ btr_cur_del_mark_set_clust_rec(
const ulint* offsets,/*!< in: rec_get_offsets(rec) */
ibool val, /*!< in: value to set */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */
__attribute__((nonnull));
mtr_t* mtr); /*!< in: mtr */
/***********************************************************//**
Sets a secondary index record delete mark to TRUE or FALSE.
@return DB_SUCCESS, DB_LOCK_WAIT, or error number */
Expand Down Expand Up @@ -499,8 +498,7 @@ btr_cur_disown_inherited_fields(
dict_index_t* index, /*!< in: index of the page */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */
__attribute__((nonnull(2,3,4,5,6)));
mtr_t* mtr); /*!< in/out: mini-transaction */

/** Operation code for btr_store_big_rec_extern_fields(). */
enum blob_op {
Expand Down Expand Up @@ -545,7 +543,7 @@ btr_store_big_rec_extern_fields(
mtr_t* btr_mtr, /*!< in: mtr containing the
latches to the clustered index */
enum blob_op op) /*! in: operation code */
__attribute__((nonnull, warn_unused_result));
__attribute__((warn_unused_result));

/*******************************************************************//**
Frees the space in an externally stored field to the file space
Expand Down Expand Up @@ -621,8 +619,7 @@ btr_push_update_extern_fields(
/*==========================*/
dtuple_t* tuple, /*!< in/out: data tuple */
const upd_t* update, /*!< in: update vector */
mem_heap_t* heap) /*!< in: memory heap */
__attribute__((nonnull));
mem_heap_t* heap); /*!< in: memory heap */
/***********************************************************//**
Sets a secondary index record's delete mark to the given value. This
function is only used by the insert buffer merge mechanism. */
Expand Down
7 changes: 3 additions & 4 deletions storage/xtradb/include/btr0sea.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ hash_table_t*
btr_search_get_hash_table(
/*======================*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull,pure,warn_unused_result));
__attribute__((warn_unused_result));

UNIV_INLINE
rw_lock_t*
btr_search_get_latch(
/*=================*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull,pure,warn_unused_result));
__attribute__((warn_unused_result));

/*********************************************************************//**
Returns the AHI partition number corresponding to a given index ID. */
Expand All @@ -229,8 +229,7 @@ UNIV_INLINE
void
btr_search_index_init(
/*===============*/
dict_index_t* index) /*!< in: index */
__attribute__((nonnull));
dict_index_t* index); /*!< in: index */

UNIV_INLINE
void
Expand Down
2 changes: 1 addition & 1 deletion storage/xtradb/include/buf0buddy.ic
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ buf_buddy_alloc_low(
buf_pool->mutex was temporarily
released */
ibool have_page_hash_mutex)
__attribute__((malloc, nonnull));
__attribute__((malloc));

/**********************************************************************//**
Deallocate a block. */
Expand Down
3 changes: 1 addition & 2 deletions storage/xtradb/include/buf0buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ buf_relocate(
buf_page_t* bpage, /*!< in/out: control block being relocated;
buf_page_get_state(bpage) must be
BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_ZIP_PAGE */
buf_page_t* dpage) /*!< in/out: destination control block */
__attribute__((nonnull));
buf_page_t* dpage); /*!< in/out: destination control block */
/*********************************************************************//**
Gets the current size of buffer buf_pool in bytes.
@return size in bytes */
Expand Down
16 changes: 8 additions & 8 deletions storage/xtradb/include/dict0dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ ulint
dict_index_is_clust(
/*================*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));
/********************************************************************//**
Check whether the index is unique.
@return nonzero for unique index, zero for other indexes */
Expand All @@ -614,7 +614,7 @@ ulint
dict_index_is_unique(
/*=================*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));
/********************************************************************//**
Check whether the index is the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
Expand All @@ -623,7 +623,7 @@ ulint
dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));
/********************************************************************//**
Check whether the index is a secondary index or the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
Expand All @@ -632,7 +632,7 @@ ulint
dict_index_is_sec_or_ibuf(
/*======================*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));

/********************************************************************//**
Gets the number of user-defined columns in a table in the dictionary
Expand All @@ -643,7 +643,7 @@ ulint
dict_table_get_n_user_cols(
/*=======================*/
const dict_table_t* table) /*!< in: table */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));
/********************************************************************//**
Gets the number of system columns in a table in the dictionary cache.
@return number of system (e.g., ROW_ID) columns of a table */
Expand All @@ -662,7 +662,7 @@ ulint
dict_table_get_n_cols(
/*==================*/
const dict_table_t* table) /*!< in: table */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the nth column of a table.
Expand Down Expand Up @@ -1321,7 +1321,7 @@ ulint
dict_index_is_corrupted(
/*====================*/
const dict_index_t* index) /*!< in: index */
__attribute__((nonnull, pure, warn_unused_result));
__attribute__((warn_unused_result));

#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
Expand All @@ -1332,7 +1332,7 @@ void
dict_set_corrupted(
/*===============*/
dict_index_t* index) /*!< in/out: index */
UNIV_COLD __attribute__((nonnull));
UNIV_COLD;

/**********************************************************************//**
Flags an index corrupted in the data dictionary cache only. This
Expand Down
18 changes: 8 additions & 10 deletions storage/xtradb/include/dyn0dyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ UNIV_INLINE
dyn_array_t*
dyn_array_create(
/*=============*/
dyn_array_t* arr) /*!< in/out memory buffer of
dyn_array_t* arr); /*!< in/out memory buffer of
size sizeof(dyn_array_t) */
__attribute__((nonnull));
/************************************************************//**
Frees a dynamic array. */
UNIV_INLINE
Expand All @@ -70,16 +69,15 @@ dyn_array_open(
dyn_array_t* arr, /*!< in: dynamic array */
ulint size) /*!< in: size in bytes of the buffer; MUST be
smaller than DYN_ARRAY_DATA_SIZE! */
__attribute__((nonnull, warn_unused_result));
__attribute__((warn_unused_result));
/*********************************************************************//**
Closes the buffer returned by dyn_array_open. */
UNIV_INLINE
void
dyn_array_close(
/*============*/
dyn_array_t* arr, /*!< in: dynamic array */
const byte* ptr) /*!< in: end of used space */
__attribute__((nonnull));
const byte* ptr); /*!< in: end of used space */
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to
the added element. The caller must copy the element to
Expand All @@ -91,7 +89,7 @@ dyn_array_push(
/*===========*/
dyn_array_t* arr, /*!< in/out: dynamic array */
ulint size) /*!< in: size in bytes of the element */
__attribute__((nonnull, warn_unused_result));
__attribute__((warn_unused_result));
/************************************************************//**
Returns pointer to an element in dyn array.
@return pointer to element */
Expand All @@ -102,7 +100,7 @@ dyn_array_get_element(
const dyn_array_t* arr, /*!< in: dyn array */
ulint pos) /*!< in: position of element
in bytes from array start */
__attribute__((nonnull, warn_unused_result));
__attribute__((warn_unused_result));
/************************************************************//**
Returns the size of stored data in a dyn array.
@return data size in bytes */
Expand All @@ -111,7 +109,7 @@ ulint
dyn_array_get_data_size(
/*====================*/
const dyn_array_t* arr) /*!< in: dyn array */
__attribute__((nonnull, warn_unused_result, pure));
__attribute__((warn_unused_result));
/************************************************************//**
Gets the first block in a dyn array.
@param arr dyn array
Expand Down Expand Up @@ -145,7 +143,7 @@ ulint
dyn_block_get_used(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
__attribute__((nonnull, warn_unused_result, pure));
__attribute__((warn_unused_result));
/********************************************************************//**
Gets pointer to the start of data in a dyn array block.
@return pointer to data */
Expand All @@ -154,7 +152,7 @@ byte*
dyn_block_get_data(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
__attribute__((nonnull, warn_unused_result, pure));
__attribute__((warn_unused_result));
/********************************************************//**
Pushes n bytes to a dyn array. */
UNIV_INLINE
Expand Down
2 changes: 1 addition & 1 deletion storage/xtradb/include/dyn0dyn.ic
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dyn_block_t*
dyn_array_add_block(
/*================*/
dyn_array_t* arr) /*!< in/out: dyn array */
__attribute__((nonnull, warn_unused_result));
__attribute__((warn_unused_result));

/********************************************************************//**
Gets the number of used bytes in a dyn array block.
Expand Down
20 changes: 14 additions & 6 deletions storage/xtradb/include/log0online.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ log_online_bitmap_file_range_t;
/** An iterator over changed page info */
typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t;

/*********************************************************************//**
Initializes the online log following subsytem. */
/** Initialize the constant part of the log tracking subsystem */
UNIV_INTERN
void
log_online_init(void);

/** Initialize the dynamic part of the log tracking subsystem */
UNIV_INTERN
void
log_online_read_init(void);
/*=======================*/

/*********************************************************************//**
Shuts down the online log following subsystem. */
/** Shut down the dynamic part of the log tracking subsystem */
UNIV_INTERN
void
log_online_read_shutdown(void);
/*===========================*/

/** Shut down the constant part of the log tracking subsystem */
UNIV_INTERN
void
log_online_shutdown(void);

/*********************************************************************//**
Reads and parses the redo log up to last checkpoint LSN to build the changed
Expand Down Expand Up @@ -159,6 +165,8 @@ struct log_online_bitmap_file_range_struct {
/** Struct for an iterator through all bits of changed pages bitmap blocks */
struct log_bitmap_iterator_struct
{
ib_uint64_t max_lsn; /*!< End LSN of the
range */
ibool failed; /*!< Has the iteration
stopped prematurely */
log_online_bitmap_file_range_t in_files; /*!< The bitmap files
Expand Down
Loading

0 comments on commit 59fca58

Please sign in to comment.