Commit 3262afc6 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

5.6.42-84.2

parent bbcb1734
......@@ -2322,6 +2322,11 @@ innobase_get_lower_case_table_names(void)
{
return(lower_case_table_names);
}
/** return one of the tmpdir path
@return tmpdir path*/
UNIV_INTERN
char*
innobase_mysql_tmpdir(void) { return (mysql_tmpdir); }
/** Create a temporary file in the location specified by the parameter
path. If the path is null, then it will be created in tmpdir.
......
......@@ -4056,11 +4056,23 @@ ha_innobase::inplace_alter_table(
table. Either way, we should be seeing and
reporting a bogus duplicate key error. */
dup_key = NULL;
} else {
DBUG_ASSERT(prebuilt->trx->error_key_num
< ha_alter_info->key_count);
} else if (prebuilt->trx->error_key_num == 0) {
dup_key = &ha_alter_info->key_info_buffer[
prebuilt->trx->error_key_num];
} else {
/* Check if there is generated cluster index column */
if (ctx->num_to_add_index > ha_alter_info->key_count) {
DBUG_ASSERT(prebuilt->trx->error_key_num
<= ha_alter_info->key_count);
dup_key = &ha_alter_info->key_info_buffer[
prebuilt->trx->error_key_num - 1];
}
else {
DBUG_ASSERT(prebuilt->trx->error_key_num
< ha_alter_info->key_count);
dup_key = &ha_alter_info->key_info_buffer[
prebuilt->trx->error_key_num];
}
}
print_keydup_error(altered_table, dup_key, MYF(0));
break;
......@@ -4981,11 +4993,20 @@ commit_try_rebuild(
FTS_DOC_ID. */
dup_key = NULL;
} else {
DBUG_ASSERT(err_key <
ha_alter_info->key_count);
dup_key = &ha_alter_info
->key_info_buffer[err_key];
if (ctx->num_to_add_index > ha_alter_info->key_count) {
DBUG_ASSERT(err_key <=
ha_alter_info->key_count);
dup_key = &ha_alter_info
->key_info_buffer[err_key - 1];
}
else {
DBUG_ASSERT(err_key <
ha_alter_info->key_count);
dup_key = &ha_alter_info
->key_info_buffer[err_key];
}
}
print_keydup_error(altered_table, dup_key, MYF(0));
DBUG_RETURN(true);
case DB_ONLINE_LOG_TOO_BIG:
......
/***********************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
Portions of this file contain modifications contributed and copyrighted
......@@ -1531,6 +1531,10 @@ os_file_get_status(
file can be opened in RW mode */
#if !defined(UNIV_HOTBACKUP)
/** return one of the tmpdir path
@return tmpdir path*/
char *innobase_mysql_tmpdir(void);
/** Create a temporary file in the location specified by the parameter
path. If the path is null, then it will be created in tmpdir.
@param[in] path location for creating temporary file
......
......@@ -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 84.1
#define PERCONA_INNODB_VERSION 84.2
#endif
/* Enable UNIV_LOG_ARCHIVE in XtraDB */
......
......@@ -1880,6 +1880,8 @@ log_online_purge_changed_page_bitmaps(
for (i = 0; i < bitmap_files.count; i++) {
char full_bmp_file_name[2 * FN_REFLEN + 2];
/* We consider the end LSN of the current bitmap, derived from
the start LSN of the subsequent bitmap file, to determine
whether to remove the current bitmap. Note that bitmap_files
......@@ -1895,8 +1897,45 @@ log_online_purge_changed_page_bitmaps(
break;
}
/* In some non-trivial cases the sequence of .xdb files may
have gaps. For instance:
ib_modified_log_1_0.xdb
ib_modified_log_2_<mmm>.xdb
ib_modified_log_4_<nnn>.xdb
Adding this check as a safety precaution. */
if (bitmap_files.files[i].name[0] == '\0')
continue;
/* If redo log tracking is enabled, reuse 'bmp_file_home'
from 'log_bmp_sys'. Otherwise, compose the full '.xdb' file
path from 'srv_data_home', adding a path separator if
necessary. */
if (log_bmp_sys != NULL) {
ut_snprintf(full_bmp_file_name,
sizeof(full_bmp_file_name),
"%s%s", log_bmp_sys->bmp_file_home,
bitmap_files.files[i].name);
}
else {
char separator[2] = {0, 0};
const size_t srv_data_home_len =
strlen(srv_data_home);
ut_a(srv_data_home_len < FN_REFLEN);
if (srv_data_home_len != 0 &&
srv_data_home[srv_data_home_len - 1] !=
SRV_PATH_SEPARATOR) {
separator[0] = SRV_PATH_SEPARATOR;
}
ut_snprintf(full_bmp_file_name,
sizeof(full_bmp_file_name), "%s%s%s",
srv_data_home, separator,
bitmap_files.files[i].name);
}
if (!os_file_delete_if_exists(innodb_file_bmp_key,
bitmap_files.files[i].name)) {
full_bmp_file_name)) {
os_file_get_last_error(TRUE);
result = TRUE;
......
/*****************************************************************************
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2005, 2018, 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
......@@ -3129,15 +3129,27 @@ row_merge_file_create_low(
const char* path)
{
int fd;
char filename[] = "Innodb Merge Temp File\0";
char* filepath = NULL;
int path_len;
if (path == NULL) {
path = innobase_mysql_tmpdir();
}
#ifdef UNIV_PFS_IO
/* This temp file open does not go through normal
file APIs, add instrumentation to register with
performance schema */
path_len = strlen(path) + sizeof "/" + strlen(filename)+1;
filepath = static_cast<char*>(mem_alloc(path_len));
memcpy(filepath,path,strlen(path));
ut_snprintf(filepath + strlen(path),path_len - strlen(path),
"%c%s",'/',filename);
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
locker = PSI_FILE_CALL(get_thread_file_name_locker)(
&state, innodb_file_temp_key, PSI_FILE_OPEN,
"Innodb Merge Temp File", &locker);
filepath, &locker);
if (locker != NULL) {
PSI_FILE_CALL(start_file_open_wait)(locker,
__FILE__,
......@@ -3150,6 +3162,7 @@ row_merge_file_create_low(
PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(
locker, fd);
}
mem_free(filepath);
#endif
if (fd < 0) {
......
......@@ -5500,18 +5500,6 @@ row_rename_table_for_mysql(
goto funct_exit;
}
/* Wait for background fts sync to finish */
for (retry = 1; dict_fts_index_syncing(table); ++retry) {
DICT_BG_YIELD(trx);
if (retry % 100 == 0) {
ib_logf(IB_LOG_LEVEL_INFO,
"Unable to rename table %s to new name"
" %s because FTS sync is running on table."
" Retrying\n",
old_name, new_name);
}
}
/* We use the private SQL parser of Innobase to generate the query
graphs needed in updating the dictionary data from system tables. */
......@@ -5669,6 +5657,9 @@ row_rename_table_for_mysql(
" = TO_BINARY(:old_table_name);\n"
"END;\n"
, FALSE, trx);
if (err != DB_SUCCESS) {
goto end;
}
} else if (n_constraints_to_drop > 0) {
/* Drop some constraints of tmp tables. */
......
/*****************************************************************************
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1997, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
......@@ -4416,7 +4416,7 @@ row_search_for_mysql(
passed to InnoDB when there is no ICP and number of loops
in row_search_for_mysql for rows found but not
reporting due to search views etc. */
if (prev_rec != NULL
if (prev_rec != NULL && !prebuilt->innodb_api
&& prebuilt->mysql_handler->end_range != NULL
&& prebuilt->idx_cond == NULL
&& end_loop >= 100) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment