From 6a821d78a6a33aaf81909ab2858d13f95dbe2708 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 17:20:49 +0200 Subject: [PATCH] 5.6.26-74.0 --- storage/xtradb/api/api0api.cc | 12 +- storage/xtradb/btr/btr0cur.cc | 8 ++ storage/xtradb/buf/buf0flu.cc | 29 ++--- storage/xtradb/dict/dict0dict.cc | 65 ---------- storage/xtradb/dict/dict0stats_bg.cc | 8 ++ storage/xtradb/fil/fil0fil.cc | 9 +- storage/xtradb/handler/ha_innodb.cc | 64 +++++++++- storage/xtradb/handler/handler0alter.cc | 156 ++++++++++++++---------- storage/xtradb/ibuf/ibuf0ibuf.cc | 4 +- storage/xtradb/include/buf0flu.h | 5 +- storage/xtradb/include/dict0dict.h | 27 +--- storage/xtradb/include/dict0dict.ic | 2 +- storage/xtradb/include/fts0fts.h | 2 +- storage/xtradb/include/row0purge.h | 12 +- storage/xtradb/include/univ.i | 2 +- storage/xtradb/log/log0log.cc | 3 + storage/xtradb/os/os0file.cc | 18 +++ storage/xtradb/row/row0import.cc | 107 +++++++--------- storage/xtradb/row/row0ins.cc | 71 ++++++++--- storage/xtradb/row/row0purge.cc | 79 ++++++++++-- storage/xtradb/row/row0sel.cc | 2 +- storage/xtradb/srv/srv0srv.cc | 3 +- storage/xtradb/srv/srv0start.cc | 27 ++-- 23 files changed, 412 insertions(+), 303 deletions(-) diff --git a/storage/xtradb/api/api0api.cc b/storage/xtradb/api/api0api.cc index ad8a29d7439..07eecdc46d0 100644 --- a/storage/xtradb/api/api0api.cc +++ b/storage/xtradb/api/api0api.cc @@ -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; @@ -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); @@ -3741,14 +3745,14 @@ ib_table_truncate( if (trunc_err == DB_SUCCESS) { ut_a(ib_trx_state(ib_trx) == static_cast( 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(); diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index 406eccff4c3..c68d54c818c 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -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)); diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 9bca902c4c7..d9893fc49b8 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -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 @@ -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; @@ -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) /*====================*/ { @@ -2314,8 +2313,6 @@ buf_flush_LRU_tail(void) MONITOR_LRU_BATCH_PAGES, total_flushed); } - - return(total_flushed); } /*********************************************************************//** @@ -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), @@ -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); @@ -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; diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index fbf9bd22e20..65dfd20d6c9 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -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 diff --git a/storage/xtradb/dict/dict0stats_bg.cc b/storage/xtradb/dict/dict0stats_bg.cc index 9e1f75a13a9..a5e0e2cf044 100644 --- a/storage/xtradb/dict/dict0stats_bg.cc +++ b/storage/xtradb/dict/dict0stats_bg.cc @@ -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); diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index 1a23d844522..8c27affc4ac 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -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 @@ -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, diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 7e723e1f8f4..be47416d45f 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -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 @@ -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 | @@ -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 @@ -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, @@ -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 */ @@ -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) { @@ -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); @@ -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(save); if (in_val) { diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index ad81b0ce938..65a01f1cbab 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 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 @@ -28,6 +28,7 @@ Smart ALTER TABLE #include #include #include +#include #include "dict0crea.h" #include "dict0dict.h" @@ -465,12 +466,9 @@ ha_innobase::check_if_supported_inplace_alter( } else if (((ha_alter_info->handler_flags & Alter_inplace_info::ADD_PK_INDEX) || innobase_need_rebuild(ha_alter_info)) - && (innobase_fulltext_exist(altered_table) - || (prebuilt->table->flags2 - & DICT_TF2_FTS_HAS_DOC_ID))) { + && (innobase_fulltext_exist(altered_table))) { /* Refuse to rebuild the table online, if - fulltext indexes are to survive the rebuild, - or if the table contains a hidden FTS_DOC_ID column. */ + fulltext indexes are to survive the rebuild. */ online = false; /* If the table already contains fulltext indexes, refuse to rebuild the table natively altogether. */ @@ -828,10 +826,8 @@ innobase_get_foreign_key_info( char* tbl_namep = NULL; ulint db_name_len = 0; ulint tbl_name_len = 0; -#ifdef __WIN__ char db_name[MAX_DATABASE_NAME_LEN]; char tbl_name[MAX_TABLE_NAME_LEN]; -#endif fk_key = static_cast(key); @@ -884,24 +880,29 @@ innobase_get_foreign_key_info( add_fk[num_fk] = dict_mem_foreign_create(); #ifndef __WIN__ - tbl_namep = fk_key->ref_table.str; - tbl_name_len = fk_key->ref_table.length; - db_namep = fk_key->ref_db.str; - db_name_len = fk_key->ref_db.length; + if(fk_key->ref_db.str) { + tablename_to_filename(fk_key->ref_db.str, db_name, + MAX_DATABASE_NAME_LEN); + db_namep = db_name; + db_name_len = strlen(db_name); + } + if (fk_key->ref_table.str) { + tablename_to_filename(fk_key->ref_table.str, tbl_name, + MAX_TABLE_NAME_LEN); + tbl_namep = tbl_name; + tbl_name_len = strlen(tbl_name); + } #else ut_ad(fk_key->ref_table.str); - - memcpy(tbl_name, fk_key->ref_table.str, - fk_key->ref_table.length); - tbl_name[fk_key->ref_table.length] = 0; + tablename_to_filename(fk_key->ref_table.str, tbl_name, + MAX_TABLE_NAME_LEN); innobase_casedn_str(tbl_name); tbl_name_len = strlen(tbl_name); tbl_namep = &tbl_name[0]; if (fk_key->ref_db.str != NULL) { - memcpy(db_name, fk_key->ref_db.str, - fk_key->ref_db.length); - db_name[fk_key->ref_db.length] = 0; + tablename_to_filename(fk_key->ref_db.str, db_name, + MAX_DATABASE_NAME_LEN); innobase_casedn_str(db_name); db_name_len = strlen(db_name); db_namep = &db_name[0]; @@ -3209,58 +3210,72 @@ innobase_check_foreign_key_index( ulint n_drop_fk) /*!< in: Number of foreign keys to drop */ { - dict_foreign_t* foreign; + ut_ad(index != NULL); + ut_ad(indexed_table != NULL); - /* Check if the index is referenced. */ - foreign = dict_table_get_referenced_constraint(indexed_table, index); + const dict_foreign_set* fks = &indexed_table->referenced_set; - ut_ad(!foreign || indexed_table - == foreign->referenced_table); + /* Check for all FK references from other tables to the index. */ + for (dict_foreign_set::const_iterator it = fks->begin(); + it != fks->end(); ++it) { - if (foreign - && !dict_foreign_find_index( - indexed_table, col_names, - foreign->referenced_col_names, - foreign->n_fields, index, - /*check_charsets=*/TRUE, - /*check_null=*/FALSE) - && !innobase_find_equiv_index( - foreign->referenced_col_names, - foreign->n_fields, - ha_alter_info->key_info_buffer, - ha_alter_info->index_add_buffer, - ha_alter_info->index_add_count) - ) { - trx->error_info = index; - return(true); + dict_foreign_t* foreign = *it; + if (foreign->referenced_index != index) { + continue; + } + ut_ad(indexed_table == foreign->referenced_table); + + if (NULL == dict_foreign_find_index( + indexed_table, col_names, + foreign->referenced_col_names, + foreign->n_fields, index, + /*check_charsets=*/TRUE, + /*check_null=*/FALSE) + && NULL == innobase_find_equiv_index( + foreign->referenced_col_names, + foreign->n_fields, + ha_alter_info->key_info_buffer, + ha_alter_info->index_add_buffer, + ha_alter_info->index_add_count)) { + + /* Index cannot be dropped. */ + trx->error_info = index; + return(true); + } } - /* Check if this index references some - other table */ - foreign = dict_table_get_foreign_constraint( - indexed_table, index); + fks = &indexed_table->foreign_set; - ut_ad(!foreign || indexed_table - == foreign->foreign_table); + /* Check for all FK references in current table using the index. */ + for (dict_foreign_set::const_iterator it = fks->begin(); + it != fks->end(); ++it) { - if (foreign - && !innobase_dropping_foreign( - foreign, drop_fk, n_drop_fk) - && !dict_foreign_find_index( - indexed_table, col_names, - foreign->foreign_col_names, - foreign->n_fields, index, - /*check_charsets=*/TRUE, - /*check_null=*/FALSE) - && !innobase_find_equiv_index( - foreign->foreign_col_names, - foreign->n_fields, - ha_alter_info->key_info_buffer, - ha_alter_info->index_add_buffer, - ha_alter_info->index_add_count) - ) { - trx->error_info = index; - return(true); + dict_foreign_t* foreign = *it; + if (foreign->foreign_index != index) { + continue; + } + + ut_ad(indexed_table == foreign->foreign_table); + + if (!innobase_dropping_foreign( + foreign, drop_fk, n_drop_fk) + && NULL == dict_foreign_find_index( + indexed_table, col_names, + foreign->foreign_col_names, + foreign->n_fields, index, + /*check_charsets=*/TRUE, + /*check_null=*/FALSE) + && NULL == innobase_find_equiv_index( + foreign->foreign_col_names, + foreign->n_fields, + ha_alter_info->key_info_buffer, + ha_alter_info->index_add_buffer, + ha_alter_info->index_add_count)) { + + /* Index cannot be dropped. */ + trx->error_info = index; + return(true); + } } return(false); @@ -3483,6 +3498,19 @@ check_if_ok_to_rename: if (index->type & DICT_FTS) { DBUG_ASSERT(index->type == DICT_FTS || (index->type & DICT_CORRUPT)); + + /* We need to drop any corrupted fts indexes + before we add a new fts index. */ + if (add_fts_idx && index->type & DICT_CORRUPT) { + ib_errf(user_thd, IB_LOG_LEVEL_ERROR, + ER_INNODB_INDEX_CORRUPT, + "Fulltext index '%s' is corrupt. " + "you should drop this index first.", + index->name); + + goto err_exit_no_heap; + } + continue; } diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc index 0695aa69652..17d9854c30d 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.cc +++ b/storage/xtradb/ibuf/ibuf0ibuf.cc @@ -2734,7 +2734,9 @@ ibuf_merge_space( &pages[0], &spaces[0], &versions[0], n_pages, &mtr); - ++sum_sizes; + if (*n_pages > 0) { + ++sum_sizes; + } } ibuf_mtr_commit(&mtr); diff --git a/storage/xtradb/include/buf0flu.h b/storage/xtradb/include/buf0flu.h index 56b0c314b5c..b73037dfab1 100644 --- a/storage/xtradb/include/buf0flu.h +++ b/storage/xtradb/include/buf0flu.h @@ -202,10 +202,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); /*====================*/ /*********************************************************************//** diff --git a/storage/xtradb/include/dict0dict.h b/storage/xtradb/include/dict0dict.h index a52de9de11a..78abbcc5398 100644 --- a/storage/xtradb/include/dict0dict.h +++ b/storage/xtradb/include/dict0dict.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -430,18 +430,6 @@ dict_foreign_add_to_cache( /*!< in: error to be ignored */ __attribute__((nonnull(1), warn_unused_result)); /*********************************************************************//** -Check if the index is referenced by a foreign key, if TRUE return the -matching instance NULL otherwise. -@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 */ - __attribute__((nonnull, warn_unused_result)); -/*********************************************************************//** Checks if a table is referenced by foreign keys. @return TRUE if table is referenced by a foreign key */ UNIV_INTERN @@ -476,19 +464,6 @@ dict_str_starts_with_keyword( const char* keyword) /*!< in: keyword to look for */ __attribute__((nonnull, warn_unused_result)); /*********************************************************************//** -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 */ - __attribute__((nonnull, warn_unused_result)); -/*********************************************************************//** Scans a table create SQL string and adds to the data dictionary the foreign key constraints declared in the string. This function should be called after the indexes for a table have been created. diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic index 6bfd7f6cdae..753f10aba86 100644 --- a/storage/xtradb/include/dict0dict.ic +++ b/storage/xtradb/include/dict0dict.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 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 diff --git a/storage/xtradb/include/fts0fts.h b/storage/xtradb/include/fts0fts.h index a2996ecacc8..d54ed281d9a 100644 --- a/storage/xtradb/include/fts0fts.h +++ b/storage/xtradb/include/fts0fts.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 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 diff --git a/storage/xtradb/include/row0purge.h b/storage/xtradb/include/row0purge.h index 93dcf9cf49b..888289a6c79 100644 --- a/storage/xtradb/include/row0purge.h +++ b/storage/xtradb/include/row0purge.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 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 @@ -119,6 +119,16 @@ struct purge_node_t{ clustered index record */ ibool done; /* Debug flag */ +#ifdef UNIV_DEBUG + /***********************************************************//** + Validate the persisent cursor. The purge node has two references + to the clustered index record - one via the ref member, and the + other via the persistent cursor. These two references must match + each other if the found_clust flag is set. + @return true if the persistent cursor is consistent with + the ref member.*/ + bool validate_pcur(); +#endif }; #ifndef UNIV_NONINL diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 48adc36e9da..96570854a24 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 73.1 +#define PERCONA_INNODB_VERSION 74.0 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc index 3cabc487eb5..8815e0ff9df 100644 --- a/storage/xtradb/log/log0log.cc +++ b/storage/xtradb/log/log0log.cc @@ -3225,6 +3225,7 @@ ulint log_archive_noarchivelog(void) /*==========================*/ { + ut_ad(!srv_read_only_mode); loop: mutex_enter(&(log_sys->mutex)); @@ -3257,6 +3258,8 @@ ulint log_archive_archivelog(void) /*========================*/ { + ut_ad(!srv_read_only_mode); + mutex_enter(&(log_sys->mutex)); if (log_sys->archiving_state == LOG_ARCH_OFF) { diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index dae50b5e00b..5976d79faff 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -1391,6 +1391,7 @@ os_file_create_simple_no_error_handling_func( *success = (file != INVALID_HANDLE_VALUE); #else /* __WIN__ */ int create_flag; + const char* mode_str = NULL; ut_a(name); @@ -1399,6 +1400,8 @@ os_file_create_simple_no_error_handling_func( if (create_mode == OS_FILE_OPEN) { + mode_str = "OPEN"; + if (access_type == OS_FILE_READ_ONLY) { create_flag = O_RDONLY; @@ -1417,10 +1420,14 @@ os_file_create_simple_no_error_handling_func( } else if (srv_read_only_mode) { + mode_str = "OPEN"; + create_flag = O_RDONLY; } else if (create_mode == OS_FILE_CREATE) { + mode_str = "CREATE"; + create_flag = O_RDWR | O_CREAT | O_EXCL; } else { @@ -1435,6 +1442,17 @@ os_file_create_simple_no_error_handling_func( *success = file == -1 ? FALSE : TRUE; + /* This function is always called for data files, we should disable + OS caching (O_DIRECT) here as we do in os_file_create_func(), so + we open the same file in the same mode, see man page of open(2). */ + if (!srv_read_only_mode + && *success + && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT + || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) { + + os_file_set_nocache(file, name, mode_str); + } + #ifdef USE_FILE_LOCK if (!srv_read_only_mode && *success diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc index b753574158a..acf6be7d8d8 100644 --- a/storage/xtradb/row/row0import.cc +++ b/storage/xtradb/row/row0import.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 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 @@ -138,14 +138,6 @@ struct row_import { @return ULINT_UNDEFINED if not found. */ ulint find_col(const char* name) const UNIV_NOTHROW; - /** - Find the index field entry in in the cfg indexes fields. - @name - of the index to look for - @return instance if found else 0. */ - const dict_field_t* find_field( - const row_index_t* cfg_index, - const char* name) const UNIV_NOTHROW; - /** Get the number of rows for which purge failed during the convert phase. @param name - index name @@ -1140,30 +1132,6 @@ row_import::find_col( return(ULINT_UNDEFINED); } -/** -Find the index field entry in in the cfg indexes fields. -@name - of the index to look for -@return instance if found else 0. */ -const dict_field_t* -row_import::find_field( - const row_index_t* cfg_index, - const char* name) const UNIV_NOTHROW -{ - const dict_field_t* field = cfg_index->m_fields; - - for (ulint i = 0; i < cfg_index->m_n_fields; ++i, ++field) { - const char* field_name; - - field_name = reinterpret_cast(field->name); - - if (strcmp(field_name, name) == 0) { - return(field); - } - } - - return(0); -} - /** Check if the index schema that was read from the .cfg file matches the in memory index definition. @@ -1187,51 +1155,60 @@ row_import::match_index_columns( return(DB_ERROR); } + if (cfg_index->m_n_fields != index->n_fields) { + + ib_errf(thd, IB_LOG_LEVEL_ERROR, + ER_TABLE_SCHEMA_MISMATCH, + "Index field count %lu doesn't match" + " tablespace metadata file value %lu", + (ulong) index->n_fields, + (ulong) cfg_index->m_n_fields); + + return(DB_ERROR); + } + cfg_index->m_srv_index = index; const dict_field_t* field = index->fields; + const dict_field_t* cfg_field = cfg_index->m_fields; - for (ulint i = 0; i < index->n_fields; ++i, ++field) { + for (ulint i = 0; i < index->n_fields; ++i, ++field, ++cfg_field) { - const dict_field_t* cfg_field; - - cfg_field = find_field(cfg_index, field->name); - - if (cfg_field == 0) { + if (strcmp(field->name, cfg_field->name) != 0) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s not found in tablespace " - "meta-data file.", - index->name, field->name); + "Index field name %s doesn't match" + " tablespace metadata field name %s" + " for field position %lu", + field->name, cfg_field->name, (ulong) i); err = DB_ERROR; - } else { + } - if (cfg_field->prefix_len != field->prefix_len) { - ib_errf(thd, IB_LOG_LEVEL_ERROR, - ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s prefix len %lu " - "doesn't match meta-data file value " - "%lu", - index->name, field->name, - (ulong) field->prefix_len, - (ulong) cfg_field->prefix_len); + if (cfg_field->prefix_len != field->prefix_len) { + ib_errf(thd, IB_LOG_LEVEL_ERROR, + ER_TABLE_SCHEMA_MISMATCH, + "Index %s field %s prefix len %lu" + " doesn't match metadata file value" + " %lu", + index->name, field->name, + (ulong) field->prefix_len, + (ulong) cfg_field->prefix_len); - err = DB_ERROR; - } + err = DB_ERROR; + } - if (cfg_field->fixed_len != field->fixed_len) { - ib_errf(thd, IB_LOG_LEVEL_ERROR, - ER_TABLE_SCHEMA_MISMATCH, - "Index %s field %s fixed len %lu " - "doesn't match meta-data file value " - "%lu", - index->name, field->name, - (ulong) field->fixed_len, - (ulong) cfg_field->fixed_len); + if (cfg_field->fixed_len != field->fixed_len) { + ib_errf(thd, IB_LOG_LEVEL_ERROR, + ER_TABLE_SCHEMA_MISMATCH, + "Index %s field %s fixed len %lu" + " doesn't match metadata file value" + " %lu", + index->name, field->name, + (ulong) field->fixed_len, + (ulong) cfg_field->fixed_len); - err = DB_ERROR; - } + err = DB_ERROR; } } diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc index f3dd548d044..6f41f0c6d11 100644 --- a/storage/xtradb/row/row0ins.cc +++ b/storage/xtradb/row/row0ins.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 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 @@ -2327,24 +2327,34 @@ row_ins_clust_index_entry_low( big_rec_t* big_rec = NULL; mtr_t mtr; mem_heap_t* offsets_heap = NULL; + ulint search_mode; ut_ad(dict_index_is_clust(index)); ut_ad(!dict_index_is_unique(index) || n_uniq == dict_index_get_n_unique(index)); ut_ad(!n_uniq || n_uniq == dict_index_get_n_unique(index)); + /* If running with fake_changes mode on then switch from modify to + search so that code takes only s-latch and not x-latch. + For dry-run (fake-changes) s-latch is acceptable. Taking x-latch will + make it more restrictive and will block real changes/workflow. */ + if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { + search_mode = (mode & BTR_MODIFY_TREE) + ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; + } else { + search_mode = mode; + } + mtr_start(&mtr); if (mode == BTR_MODIFY_LEAF && dict_index_is_online_ddl(index)) { - if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { - mode = BTR_SEARCH_LEAF | BTR_ALREADY_S_LATCHED; - } else { - mode = BTR_MODIFY_LEAF | BTR_ALREADY_S_LATCHED; - } + + /* We really don't need to OR mode but will leave it for + code consistency. */ + mode |= BTR_ALREADY_S_LATCHED; + search_mode |= BTR_ALREADY_S_LATCHED; + mtr_s_lock(dict_index_get_lock(index), &mtr); - } else if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { - mode = (mode & BTR_MODIFY_TREE) - ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; } cursor.thr = thr; @@ -2353,7 +2363,7 @@ row_ins_clust_index_entry_low( the function will return in both low_match and up_match of the cursor sensible values */ - btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, mode, + btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, search_mode, &cursor, 0, __FILE__, __LINE__, &mtr); #ifdef UNIV_DEBUG @@ -2624,7 +2634,7 @@ row_ins_sec_index_entry_low( que_thr_t* thr) /*!< in: query thread */ { btr_cur_t cursor; - ulint search_mode = mode | BTR_INSERT; + ulint search_mode; dberr_t err = DB_SUCCESS; ulint n_unique; mtr_t mtr; @@ -2637,6 +2647,18 @@ row_ins_sec_index_entry_low( ut_ad(thr_get_trx(thr)->id); mtr_start(&mtr); + /* If running with fake_changes mode on then avoid using insert buffer + and also switch from modify to search so that code takes only s-latch + and not x-latch. For dry-run (fake-changes) s-latch is acceptable. + Taking x-latch will make it more restrictive and will block real + changes/workflow. */ + if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { + search_mode = (mode & BTR_MODIFY_TREE) + ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; + } else { + search_mode = mode | BTR_INSERT; + } + /* Ensure that we acquire index->lock when inserting into an index with index->online_status == ONLINE_INDEX_COMPLETE, but could still be subject to rollback_inplace_alter_table(). @@ -2644,11 +2666,24 @@ row_ins_sec_index_entry_low( The memory object cannot be freed as long as we have an open reference to the table, or index->table->n_ref_count > 0. */ const bool check = *index->name == TEMP_INDEX_PREFIX; + if (check) { + DEBUG_SYNC_C("row_ins_sec_index_enter"); - if (mode == BTR_MODIFY_LEAF) { + + /* mode = MODIFY_LEAF is synonymous to search_mode = SEARCH_LEAF + search_mode = SEARCH_TREE suggest operation in fake_change mode + so continue to s-latch in this mode too. */ + + if (mode == BTR_MODIFY_LEAF || search_mode == BTR_SEARCH_TREE) { + + ut_ad((search_mode == BTR_SEARCH_TREE + && thr_get_trx(thr)->fake_changes) + || mode == BTR_MODIFY_LEAF); + search_mode |= BTR_ALREADY_S_LATCHED; mtr_s_lock(dict_index_get_lock(index), &mtr); + } else { mtr_x_lock(dict_index_get_lock(index), &mtr); } @@ -2659,14 +2694,13 @@ row_ins_sec_index_entry_low( } } - /* Note that we use PAGE_CUR_LE as the search mode, because then - the function will return in both low_match and up_match of the - cursor sensible values */ - if (!thr_get_trx(thr)->check_unique_secondary) { search_mode |= BTR_IGNORE_SEC_UNIQUE; } + /* Note that we use PAGE_CUR_LE as the search mode, because then + the function will return in both low_match and up_match of the + cursor sensible values */ btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, search_mode, &cursor, 0, __FILE__, __LINE__, &mtr); @@ -2746,10 +2780,7 @@ row_ins_sec_index_entry_low( btr_cur_search_to_nth_level( index, 0, entry, PAGE_CUR_LE, - UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes) - ? BTR_SEARCH_LEAF - : (btr_latch_mode) - (search_mode & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE)), + search_mode & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE), &cursor, 0, __FILE__, __LINE__, &mtr); } diff --git a/storage/xtradb/row/row0purge.cc b/storage/xtradb/row/row0purge.cc index 8212a7b43e0..b26ba971a95 100644 --- a/storage/xtradb/row/row0purge.cc +++ b/storage/xtradb/row/row0purge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 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 @@ -84,7 +84,7 @@ row_purge_node_create( /***********************************************************//** Repositions the pcur in the purge node on the clustered index record, -if found. +if found. If the record is not found, close pcur. @return TRUE if the record was found */ static ibool @@ -95,11 +95,10 @@ row_purge_reposition_pcur( mtr_t* mtr) /*!< in: mtr */ { if (node->found_clust) { - ibool found; + ut_ad(node->validate_pcur()); - found = btr_pcur_restore_position(mode, &node->pcur, mtr); + node->found_clust = btr_pcur_restore_position(mode, &node->pcur, mtr); - return(found); } else { node->found_clust = row_search_on_row_ref( &node->pcur, mode, node->table, node->ref, mtr); @@ -109,6 +108,11 @@ row_purge_reposition_pcur( } } + /* Close the current cursor if we fail to position it correctly. */ + if (!node->found_clust) { + btr_pcur_close(&node->pcur); + } + return(node->found_clust); } @@ -182,7 +186,12 @@ func_exit: mem_heap_free(heap); } - btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + /* Persistent cursor is closed if reposition fails. */ + if (node->found_clust) { + btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + } else { + mtr_commit(&mtr); + } return(success); } @@ -251,7 +260,12 @@ row_purge_poss_sec( btr_pcur_get_rec(&node->pcur), &mtr, index, entry); - btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + /* Persistent cursor is closed if reposition fails. */ + if (node->found_clust) { + btr_pcur_commit_specify_mtr(&node->pcur, &mtr); + } else { + mtr_commit(&mtr); + } return(can_delete); } @@ -831,6 +845,8 @@ row_purge_record_func( dict_index_t* clust_index; bool purged = true; + ut_ad(!node->found_clust); + clust_index = dict_table_get_first_index(node->table); node->index = dict_table_get_next_index(clust_index); @@ -986,3 +1002,52 @@ row_purge_step( return(thr); } + +#ifdef UNIV_DEBUG +/***********************************************************//** +Validate the persisent cursor. The purge node has two references +to the clustered index record - one via the ref member, and the +other via the persistent cursor. These two references must match +each other if the found_clust flag is set. +@return true if the stored copy of persistent cursor is consistent +with the ref member.*/ +bool +purge_node_t::validate_pcur() +{ + if (!found_clust) { + return(true); + } + + if (index == NULL) { + return(true); + } + + if (index->type == DICT_FTS) { + return(true); + } + + if (pcur.old_stored != BTR_PCUR_OLD_STORED) { + return(true); + } + + dict_index_t* clust_index = pcur.btr_cur.index; + + ulint* offsets = rec_get_offsets( + pcur.old_rec, clust_index, NULL, pcur.old_n_fields, &heap); + + /* Here we are comparing the purge ref record and the stored initial + part in persistent cursor. Both cases we store n_uniq fields of the + cluster index and so it is fine to do the comparison. We note this + dependency here as pcur and ref belong to different modules. */ + int st = cmp_dtuple_rec(ref, pcur.old_rec, offsets); + + if (st != 0) { + fprintf(stderr, "Purge node pcur validation failed\n"); + dtuple_print(stderr, ref); + rec_print(stderr, pcur.old_rec, clust_index); + return(false); + } + + return(true); +} +#endif /* UNIV_DEBUG */ diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index 7ed45ccd06d..388668afb47 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index 6343c85a59f..d10a566b061 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -2141,8 +2141,7 @@ rescan_idle: mutex_enter(&trx_sys->mutex); trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list); while (trx) { - if (!trx_state_eq(trx, TRX_STATE_NOT_STARTED) - && trx_state_eq(trx, TRX_STATE_ACTIVE) + if (trx->state == TRX_STATE_ACTIVE && trx->mysql_thd && innobase_thd_is_idle(trx->mysql_thd)) { ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd); diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index dd49f4cd651..545034f1dca 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -2650,24 +2650,25 @@ files_checked: } #ifdef UNIV_LOG_ARCHIVE - /* Archiving is always off under MySQL */ - if (!srv_log_archive_on) { - ut_a(DB_SUCCESS == log_archive_noarchivelog()); - } else { - bool start_archive; + if (!srv_read_only_mode) { + if (!srv_log_archive_on) { + ut_a(DB_SUCCESS == log_archive_noarchivelog()); + } else { + bool start_archive; - mutex_enter(&(log_sys->mutex)); + mutex_enter(&(log_sys->mutex)); - start_archive = FALSE; + start_archive = false; - if (log_sys->archiving_state == LOG_ARCH_OFF) { - start_archive = TRUE; - } + if (log_sys->archiving_state == LOG_ARCH_OFF) { + start_archive = true; + } - mutex_exit(&(log_sys->mutex)); + mutex_exit(&(log_sys->mutex)); - if (start_archive) { - ut_a(DB_SUCCESS == log_archive_archivelog()); + if (start_archive) { + ut_a(DB_SUCCESS == log_archive_archivelog()); + } } } #endif /* UNIV_LOG_ARCHIVE */