Skip to content

Commit

Permalink
5.6.26-74.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Oct 9, 2015
1 parent 0b3eb45 commit 6a821d7
Show file tree
Hide file tree
Showing 23 changed files with 416 additions and 307 deletions.
12 changes: 8 additions & 4 deletions storage/xtradb/api/api0api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ ib_open_table_by_id(
dict_mutex_enter_for_mysql();
}

table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
table = dict_table_open_on_id(table_id, TRUE, DICT_TABLE_OP_NORMAL);

if (table != NULL && table->ibd_file_missing) {
table = NULL;
Expand Down Expand Up @@ -2104,6 +2104,10 @@ ib_cursor_moveto(

n_fields = dict_index_get_n_ordering_defined_by_user(prebuilt->index);

if (n_fields > dtuple_get_n_fields(tuple->ptr)) {
n_fields = dtuple_get_n_fields(tuple->ptr);
}

dtuple_set_n_fields(search_tuple, n_fields);
dtuple_set_n_fields_cmp(search_tuple, n_fields);

Expand Down Expand Up @@ -3741,14 +3745,14 @@ ib_table_truncate(
if (trunc_err == DB_SUCCESS) {
ut_a(ib_trx_state(ib_trx) == static_cast<ib_trx_state_t>(
TRX_STATE_NOT_STARTED));

err = ib_trx_release(ib_trx);
ut_a(err == DB_SUCCESS);
} else {
err = ib_trx_rollback(ib_trx);
ut_a(err == DB_SUCCESS);
}

err = ib_trx_release(ib_trx);
ut_a(err == DB_SUCCESS);

/* Set the memcached_sync_count back. */
if (table != NULL && memcached_sync != 0) {
dict_mutex_enter_for_mysql();
Expand Down
8 changes: 8 additions & 0 deletions storage/xtradb/btr/btr0cur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4129,6 +4129,14 @@ btr_estimate_number_of_different_key_vals(
page = btr_cur_get_page(&cursor);

SRV_CORRUPT_TABLE_CHECK(page, goto exit_loop;);
DBUG_EXECUTE_IF("ib_corrupt_page_while_stats_calc",
page = NULL;);

SRV_CORRUPT_TABLE_CHECK(page,
{
mtr_commit(&mtr);
goto exit_loop;
});

rec = page_rec_get_next(page_get_infimum_rec(page));

Expand Down
29 changes: 8 additions & 21 deletions storage/xtradb/buf/buf0flu.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -936,12 +936,12 @@ buf_flush_write_block_low(
break;
case BUF_BLOCK_ZIP_DIRTY:
frame = bpage->zip.data;

mach_write_to_8(frame + FIL_PAGE_LSN,
bpage->newest_modification);
memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);

ut_a(page_zip_verify_checksum(frame, zip_size));

memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
break;
case BUF_BLOCK_FILE_PAGE:
frame = bpage->zip.data;
Expand Down Expand Up @@ -2209,10 +2209,9 @@ Clears up tail of the LRU lists:
* Put replaceable pages at the tail of LRU to the free list
* Flush dirty pages at the tail of LRU to the disk
The depth to which we scan each buffer pool is controlled by dynamic
config parameter innodb_LRU_scan_depth.
@return total pages flushed */
config parameter innodb_LRU_scan_depth. */
UNIV_INTERN
ulint
void
buf_flush_LRU_tail(void)
/*====================*/
{
Expand Down Expand Up @@ -2314,8 +2313,6 @@ buf_flush_LRU_tail(void)
MONITOR_LRU_BATCH_PAGES,
total_flushed);
}

return(total_flushed);
}

/*********************************************************************//**
Expand Down Expand Up @@ -2725,7 +2722,8 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
}

/* Flush pages from flush_list if required */
n_flushed += page_cleaner_flush_pages_if_needed();
n_flushed = page_cleaner_flush_pages_if_needed();

} else {
n_flushed = page_cleaner_do_flush_batch(
PCT_IO(100),
Expand Down Expand Up @@ -2850,8 +2848,6 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
while (srv_shutdown_state == SRV_SHUTDOWN_NONE
|| srv_shutdown_state == SRV_SHUTDOWN_CLEANUP) {

ulint n_flushed_lru;

srv_current_thread_priority = srv_cleaner_thread_priority;

page_cleaner_sleep_if_needed(next_loop_time);
Expand All @@ -2860,16 +2856,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(

next_loop_time = ut_time_ms() + lru_sleep_time;

n_flushed_lru = buf_flush_LRU_tail();

if (n_flushed_lru) {

MONITOR_INC_VALUE_CUMULATIVE(
MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE,
MONITOR_FLUSH_BACKGROUND_COUNT,
MONITOR_FLUSH_BACKGROUND_PAGES,
n_flushed_lru);
}
buf_flush_LRU_tail();
}

buf_lru_manager_is_active = false;
Expand Down
65 changes: 0 additions & 65 deletions storage/xtradb/dict/dict0dict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3237,71 +3237,6 @@ dict_table_is_referenced_by_foreign_key(
return(!table->referenced_set.empty());
}

/*********************************************************************//**
Check if the index is referenced by a foreign key, if TRUE return foreign
else return NULL
@return pointer to foreign key struct if index is defined for foreign
key, otherwise NULL */
UNIV_INTERN
dict_foreign_t*
dict_table_get_referenced_constraint(
/*=================================*/
dict_table_t* table, /*!< in: InnoDB table */
dict_index_t* index) /*!< in: InnoDB index */
{
dict_foreign_t* foreign;

ut_ad(index != NULL);
ut_ad(table != NULL);

for (dict_foreign_set::iterator it = table->referenced_set.begin();
it != table->referenced_set.end();
++it) {

foreign = *it;

if (foreign->referenced_index == index) {

return(foreign);
}
}

return(NULL);
}

/*********************************************************************//**
Checks if a index is defined for a foreign key constraint. Index is a part
of a foreign key constraint if the index is referenced by foreign key
or index is a foreign key index.
@return pointer to foreign key struct if index is defined for foreign
key, otherwise NULL */
UNIV_INTERN
dict_foreign_t*
dict_table_get_foreign_constraint(
/*==============================*/
dict_table_t* table, /*!< in: InnoDB table */
dict_index_t* index) /*!< in: InnoDB index */
{
dict_foreign_t* foreign;

ut_ad(index != NULL);
ut_ad(table != NULL);

for (dict_foreign_set::iterator it = table->foreign_set.begin();
it != table->foreign_set.end();
++it) {

foreign = *it;

if (foreign->foreign_index == index) {

return(foreign);
}
}

return(NULL);
}

/**********************************************************************//**
Removes a foreign constraint struct from the dictionary cache. */
UNIV_INTERN
Expand Down
8 changes: 8 additions & 0 deletions storage/xtradb/dict/dict0stats_bg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,14 @@ DECLARE_THREAD(dict_stats_thread)(
break;
}

#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
if (srv_ibuf_disable_background_merge) {
usleep(100000);
os_event_reset(dict_stats_event);
continue;
}
#endif

dict_stats_process_entry_from_recalc_pool();

os_event_reset(dict_stats_event);
Expand Down
9 changes: 5 additions & 4 deletions storage/xtradb/fil/fil0fil.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -5630,9 +5630,10 @@ _fil_io(

space = fil_space_get_by_id(space_id);

/* If we are deleting a tablespace we don't allow any read
operations on that. However, we do allow write operations. */
if (space == 0 || (type == OS_FILE_READ && space->stop_new_ops)) {
/* If we are deleting a tablespace we don't allow async read operations
on that. However, we do allow write and sync read operations */
if (space == 0
|| (type == OS_FILE_READ && !sync && space->stop_new_ops)) {
mutex_exit(&fil_system->mutex);

ib_logf(IB_LOG_LEVEL_ERROR,
Expand Down
64 changes: 61 additions & 3 deletions storage/xtradb/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,15 @@ innobase_end(
handlerton* hton, /* in: Innodb handlerton */
ha_panic_function type);

/*****************************************************************//**
Stores the current binlog coordinates in the trx system header. */
static
int
innobase_store_binlog_info(
/*=======================*/
handlerton* hton, /*!< in: InnoDB handlerton */
THD* thd); /*!< in: MySQL thread handle */

/*****************************************************************//**
Creates an InnoDB transaction struct for the thd if it does not yet have one.
Starts a new InnoDB transaction if a transaction is not yet started. And
Expand Down Expand Up @@ -3197,6 +3206,9 @@ innobase_init(
innobase_hton->clone_consistent_snapshot =
innobase_start_trx_and_clone_read_view;

innobase_hton->store_binlog_info =
innobase_store_binlog_info;

innobase_hton->flush_logs = innobase_flush_logs;
innobase_hton->show_status = innobase_show_status;
innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS |
Expand Down Expand Up @@ -3897,6 +3909,35 @@ innobase_commit_low(
}
}

/*****************************************************************//**
Stores the current binlog coordinates in the trx system header. */
static
int
innobase_store_binlog_info(
/*=======================*/
handlerton* hton, /*!< in: InnoDB handlerton */
THD* thd) /*!< in: MySQL thread handle */
{
const char* file_name;
unsigned long long pos;
mtr_t mtr;

DBUG_ENTER("innobase_store_binlog_info");

thd_binlog_pos(thd, &file_name, &pos);

mtr_start(&mtr);

trx_sys_update_mysql_binlog_offset(file_name, pos,
TRX_SYS_MYSQL_LOG_INFO, &mtr);

mtr_commit(&mtr);

innobase_flush_logs(hton);

DBUG_RETURN(0);
}

/*****************************************************************//**
Creates an InnoDB transaction struct for the thd if it does not yet have one.
Starts a new InnoDB transaction if a transaction is not yet started. And
Expand Down Expand Up @@ -9240,7 +9281,8 @@ create_table_def(

/* MySQL does the name length check. But we do additional check
on the name length here */
if (strlen(table_name) > MAX_FULL_NAME_LEN) {
const size_t table_name_len = strlen(table_name);
if (table_name_len > MAX_FULL_NAME_LEN) {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
Expand All @@ -9249,6 +9291,15 @@ create_table_def(
DBUG_RETURN(ER_TABLE_NAME);
}

if (table_name[table_name_len - 1] == '/') {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
"InnoDB: Table name is empty");

DBUG_RETURN(ER_WRONG_TABLE_NAME);
}

n_cols = form->s->fields;

/* Check whether there already exists a FTS_DOC_ID column */
Expand Down Expand Up @@ -10566,6 +10617,10 @@ ha_innobase::discard_or_import_tablespace(
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}

if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) {
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}

dict_table = prebuilt->table;

if (dict_table->space == TRX_SYS_SPACE) {
Expand Down Expand Up @@ -12239,8 +12294,8 @@ ha_innobase::check(
thd_set_kill_status(user_thd);
}

if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
return(HA_ADMIN_CORRUPT);
if (UNIV_UNLIKELY(prebuilt->table && prebuilt->table->corrupted)) {
DBUG_RETURN(HA_ADMIN_CORRUPT);
}

DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
Expand Down Expand Up @@ -14720,6 +14775,9 @@ innodb_log_archive_update(
void* var_ptr,
const void* save)
{
if (srv_read_only_mode)
return;

my_bool in_val = *static_cast<const my_bool*>(save);

if (in_val) {
Expand Down
Loading

0 comments on commit 6a821d7

Please sign in to comment.