Merge branch 'merge/merge-innodb-5.6' into 10.0

5.6.32
This commit is contained in:
Sergei Golubchik 2016-08-10 19:43:37 +02:00
commit 57fbc603bf
8 changed files with 108 additions and 22 deletions

View file

@ -6966,6 +6966,7 @@ dberr_t
ha_innobase::innobase_lock_autoinc(void)
/*====================================*/
{
DBUG_ENTER("ha_innobase::innobase_lock_autoinc");
dberr_t error = DB_SUCCESS;
ut_ad(!srv_read_only_mode);
@ -7005,6 +7006,8 @@ ha_innobase::innobase_lock_autoinc(void)
/* Fall through to old style locking. */
case AUTOINC_OLD_STYLE_LOCKING:
DBUG_EXECUTE_IF("die_if_autoinc_old_lock_style_used",
ut_ad(0););
error = row_lock_table_autoinc_for_mysql(prebuilt);
if (error == DB_SUCCESS) {
@ -7018,7 +7021,7 @@ ha_innobase::innobase_lock_autoinc(void)
ut_error;
}
return(error);
DBUG_RETURN(error);
}
/********************************************************************//**
@ -11895,7 +11898,7 @@ ha_innobase::optimize(
if (innodb_optimize_fulltext_only) {
if (prebuilt->table->fts && prebuilt->table->fts->cache
&& !dict_table_is_discarded(prebuilt->table)) {
fts_sync_table(prebuilt->table, false, true);
fts_sync_table(prebuilt->table, false, true, false);
fts_optimize_table(prebuilt->table);
}
return(HA_ADMIN_OK);

View file

@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2007, 2016, 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
@ -2963,15 +2963,26 @@ i_s_fts_deleted_generic_fill(
DBUG_RETURN(0);
}
deleted = fts_doc_ids_create();
/* Prevent DDL to drop fts aux tables. */
rw_lock_s_lock(&dict_operation_lock);
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
} else if (!dict_table_has_fts_index(user_table)) {
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
}
deleted = fts_doc_ids_create();
trx = trx_allocate_for_background();
trx->op_info = "Select for FTS DELETE TABLE";
@ -2999,6 +3010,8 @@ i_s_fts_deleted_generic_fill(
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
}
@ -3372,6 +3385,12 @@ i_s_fts_index_cache_fill(
DBUG_RETURN(0);
}
if (user_table->fts == NULL || user_table->fts->cache == NULL) {
dict_table_close(user_table, FALSE, FALSE);
DBUG_RETURN(0);
}
cache = user_table->fts->cache;
ut_a(cache);
@ -3806,10 +3825,15 @@ i_s_fts_index_table_fill(
DBUG_RETURN(0);
}
/* Prevent DDL to drop fts aux tables. */
rw_lock_s_lock(&dict_operation_lock);
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
}
@ -3822,6 +3846,8 @@ i_s_fts_index_table_fill(
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
}
@ -3957,14 +3983,21 @@ i_s_fts_config_fill(
fields = table->field;
/* Prevent DDL to drop fts aux tables. */
rw_lock_s_lock(&dict_operation_lock);
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
} else if (!dict_table_has_fts_index(user_table)) {
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
}
@ -4020,6 +4053,8 @@ i_s_fts_config_fill(
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
}