Skip to content

Commit db55b39

Browse files
committed
Revert some InnoDB/XtraDB changes
The relevant InnoDB/XtraDB fixes up to 5.6.42 had already been applied to MariaDB in commit 30c3d6d. Revert some changes that appeared in the merge commit 87d852f.
1 parent 03977e8 commit db55b39

File tree

16 files changed

+104
-154
lines changed

16 files changed

+104
-154
lines changed

storage/innobase/dict/dict0dict.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2012, Facebook Inc.
55
Copyright (c) 2014, 2017, MariaDB Corporation.
66
@@ -3370,10 +3370,7 @@ dict_foreign_find_index(
33703370
table, col_names, columns, n_cols,
33713371
index, types_idx,
33723372
check_charsets, check_null,
3373-
error, err_col_no,err_index)
3374-
&& (!(index->online_status ==
3375-
ONLINE_INDEX_ABORTED_DROPPED
3376-
||index->online_status == ONLINE_INDEX_ABORTED))) {
3373+
error, err_col_no,err_index)) {
33773374
if (error) {
33783375
*error = DB_SUCCESS;
33793376
}

storage/innobase/fts/fts0fts.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -870,19 +870,19 @@ fts_drop_index(
870870
err = fts_drop_index_tables(trx, index);
871871

872872
while (index->index_fts_syncing
873-
&& !trx_is_interrupted(trx)) {
874-
DICT_BG_YIELD(trx);
875-
}
873+
&& !trx_is_interrupted(trx)) {
874+
DICT_BG_YIELD(trx);
875+
}
876876

877-
fts_free(table);
877+
fts_free(table);
878878

879879
return(err);
880880
}
881881

882882
while (index->index_fts_syncing
883-
&& !trx_is_interrupted(trx)) {
884-
DICT_BG_YIELD(trx);
885-
}
883+
&& !trx_is_interrupted(trx)) {
884+
DICT_BG_YIELD(trx);
885+
}
886886

887887
current_doc_id = table->fts->cache->next_doc_id;
888888
first_doc_id = table->fts->cache->first_doc_id;
@@ -901,9 +901,9 @@ fts_drop_index(
901901

902902
if (index_cache != NULL) {
903903
while (index->index_fts_syncing
904-
&& !trx_is_interrupted(trx)) {
905-
DICT_BG_YIELD(trx);
906-
}
904+
&& !trx_is_interrupted(trx)) {
905+
DICT_BG_YIELD(trx);
906+
}
907907
if (index_cache->words) {
908908
fts_words_free(index_cache->words);
909909
rbt_free(index_cache->words);

storage/innobase/handler/ha_innodb.cc

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,11 +2015,6 @@ innobase_get_lower_case_table_names(void)
20152015
{
20162016
return(lower_case_table_names);
20172017
}
2018-
/** return one of the tmpdir path
2019-
@return tmpdir path*/
2020-
UNIV_INTERN
2021-
char*
2022-
innobase_mysql_tmpdir(void) { return (mysql_tmpdir); }
20232018

20242019
/** Create a temporary file in the location specified by the parameter
20252020
path. If the path is null, then it will be created in tmpdir.
@@ -10908,36 +10903,35 @@ innobase_rename_table(
1090810903

1090910904
row_mysql_lock_data_dictionary(trx);
1091010905

10911-
dict_table_t* table = NULL;
10912-
table = dict_table_open_on_name(norm_from, TRUE, FALSE,
10913-
DICT_ERR_IGNORE_NONE);
10906+
dict_table_t* table = dict_table_open_on_name(norm_from, TRUE, FALSE,
10907+
DICT_ERR_IGNORE_NONE);
1091410908

10915-
/* Since DICT_BG_YIELD has sleep for 250 milliseconds,
10909+
/* Since DICT_BG_YIELD has sleep for 250 milliseconds,
1091610910
Convert lock_wait_timeout unit from second to 250 milliseconds */
10917-
long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4;
10918-
if (table != NULL) {
10919-
for (dict_index_t* index = dict_table_get_first_index(table);
10920-
index != NULL;
10921-
index = dict_table_get_next_index(index)) {
10922-
10923-
if (index->type & DICT_FTS) {
10924-
/* Found */
10925-
while (index->index_fts_syncing
10926-
&& !trx_is_interrupted(trx)
10927-
&& (lock_wait_timeout--) > 0) {
10928-
DICT_BG_YIELD(trx);
10929-
}
10930-
}
10931-
}
10932-
dict_table_close(table, TRUE, FALSE);
10933-
}
10911+
long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4;
10912+
if (table != NULL) {
10913+
for (dict_index_t* index = dict_table_get_first_index(table);
10914+
index != NULL;
10915+
index = dict_table_get_next_index(index)) {
10916+
10917+
if (index->type & DICT_FTS) {
10918+
/* Found */
10919+
while (index->index_fts_syncing
10920+
&& !trx_is_interrupted(trx)
10921+
&& (lock_wait_timeout--) > 0) {
10922+
DICT_BG_YIELD(trx);
10923+
}
10924+
}
10925+
}
10926+
dict_table_close(table, TRUE, FALSE);
10927+
}
1093410928

10935-
/* FTS sync is in progress. We shall timeout this operation */
10936-
if (lock_wait_timeout < 0) {
10937-
error = DB_LOCK_WAIT_TIMEOUT;
10938-
row_mysql_unlock_data_dictionary(trx);
10939-
DBUG_RETURN(error);
10940-
}
10929+
/* FTS sync is in progress. We shall timeout this operation */
10930+
if (lock_wait_timeout < 0) {
10931+
error = DB_LOCK_WAIT_TIMEOUT;
10932+
row_mysql_unlock_data_dictionary(trx);
10933+
DBUG_RETURN(error);
10934+
}
1094110935

1094210936
/* Transaction must be flagged as a locking transaction or it hasn't
1094310937
been started yet. */
@@ -11092,13 +11086,11 @@ ha_innobase::rename_table(
1109211086
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), to);
1109311087

1109411088
error = DB_ERROR;
11095-
}
11089+
} else if (error == DB_LOCK_WAIT_TIMEOUT) {
11090+
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to);
1109611091

11097-
else if (error == DB_LOCK_WAIT_TIMEOUT) {
11098-
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to);
11099-
11100-
error = DB_LOCK_WAIT;
11101-
}
11092+
error = DB_LOCK_WAIT;
11093+
}
1110211094

1110311095
DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
1110411096
}

storage/innobase/handler/handler0alter.cc

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4173,23 +4173,11 @@ ha_innobase::inplace_alter_table(
41734173
table. Either way, we should be seeing and
41744174
reporting a bogus duplicate key error. */
41754175
dup_key = NULL;
4176-
} else if (prebuilt->trx->error_key_num == 0) {
4176+
} else {
4177+
DBUG_ASSERT(prebuilt->trx->error_key_num
4178+
< ha_alter_info->key_count);
41774179
dup_key = &ha_alter_info->key_info_buffer[
41784180
prebuilt->trx->error_key_num];
4179-
} else {
4180-
/* Check if there is generated cluster index column */
4181-
if (ctx->num_to_add_index > ha_alter_info->key_count) {
4182-
DBUG_ASSERT(prebuilt->trx->error_key_num
4183-
<= ha_alter_info->key_count);
4184-
dup_key = &ha_alter_info->key_info_buffer[
4185-
prebuilt->trx->error_key_num - 1];
4186-
}
4187-
else {
4188-
DBUG_ASSERT(prebuilt->trx->error_key_num
4189-
< ha_alter_info->key_count);
4190-
dup_key = &ha_alter_info->key_info_buffer[
4191-
prebuilt->trx->error_key_num];
4192-
}
41934181
}
41944182
print_keydup_error(altered_table, dup_key, MYF(0));
41954183
break;
@@ -5117,18 +5105,9 @@ commit_try_rebuild(
51175105
FTS_DOC_ID. */
51185106
dup_key = NULL;
51195107
} else {
5120-
if (ctx->num_to_add_index > ha_alter_info->key_count) {
5121-
DBUG_ASSERT(err_key <=
5122-
ha_alter_info->key_count);
5123-
dup_key = &ha_alter_info
5124-
->key_info_buffer[err_key - 1];
5125-
}
5126-
else {
5127-
DBUG_ASSERT(err_key <
5128-
ha_alter_info->key_count);
5129-
dup_key = &ha_alter_info
5130-
->key_info_buffer[err_key];
5131-
}
5108+
DBUG_ASSERT(err_key < ha_alter_info->key_count);
5109+
dup_key = &ha_alter_info
5110+
->key_info_buffer[err_key];
51325111
}
51335112

51345113
print_keydup_error(altered_table, dup_key, MYF(0));

storage/innobase/include/os0file.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************************
22
3-
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2009, Percona Inc.
55
Copyright (c) 2013, 2017, MariaDB Corporation.
66
@@ -1314,10 +1314,6 @@ os_file_get_status(
13141314
file can be opened in RW mode */
13151315

13161316
#if !defined(UNIV_HOTBACKUP)
1317-
1318-
/** return one of the tmpdir path
1319-
@return tmpdir path*/
1320-
char *innobase_mysql_tmpdir(void);
13211317
/** Create a temporary file in the location specified by the parameter
13221318
path. If the path is null, then it will be created in tmpdir.
13231319
@param[in] path location for creating temporary file

storage/innobase/row/row0merge.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2014, 2018, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
@@ -3138,10 +3138,9 @@ row_merge_file_create_low(
31383138
file APIs, add instrumentation to register with
31393139
performance schema */
31403140
struct PSI_file_locker* locker = NULL;
3141-
31423141
PSI_file_locker_state state;
31433142
if (!path) {
3144-
path = innobase_mysql_tmpdir();
3143+
path = mysql_tmpdir;
31453144
}
31463145
static const char label[] = "/Innodb Merge Temp File";
31473146
char* name = static_cast<char*>(

storage/innobase/row/row0sel.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1997, 2018, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2008, Google Inc.
55
Copyright (c) 2015, 2018, MariaDB Corporation.
66
@@ -4550,7 +4550,7 @@ row_search_for_mysql(
45504550
prebuilt->new_rec_locks = 1;
45514551
}
45524552
err = DB_SUCCESS;
4553-
break;
4553+
/* fall through */
45544554
case DB_SUCCESS:
45554555
break;
45564556
case DB_LOCK_WAIT:

storage/xtradb/dict/dict0dict.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2012, Facebook Inc.
55
Copyright (c) 2014, 2017, MariaDB Corporation.
66
@@ -3387,10 +3387,7 @@ dict_foreign_find_index(
33873387
table, col_names, columns, n_cols,
33883388
index, types_idx,
33893389
check_charsets, check_null,
3390-
error, err_col_no,err_index)
3391-
&& (!(index->online_status ==
3392-
ONLINE_INDEX_ABORTED_DROPPED
3393-
||index->online_status == ONLINE_INDEX_ABORTED))) {
3390+
error, err_col_no,err_index)) {
33943391
if (error) {
33953392
*error = DB_SUCCESS;
33963393
}

storage/xtradb/fts/fts0fts.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -870,19 +870,19 @@ fts_drop_index(
870870
err = fts_drop_index_tables(trx, index);
871871

872872
while (index->index_fts_syncing
873-
&& !trx_is_interrupted(trx)) {
874-
DICT_BG_YIELD(trx);
875-
}
873+
&& !trx_is_interrupted(trx)) {
874+
DICT_BG_YIELD(trx);
875+
}
876876

877-
fts_free(table);
877+
fts_free(table);
878878

879879
return(err);
880880
}
881881

882882
while (index->index_fts_syncing
883-
&& !trx_is_interrupted(trx)) {
884-
DICT_BG_YIELD(trx);
885-
}
883+
&& !trx_is_interrupted(trx)) {
884+
DICT_BG_YIELD(trx);
885+
}
886886

887887
current_doc_id = table->fts->cache->next_doc_id;
888888
first_doc_id = table->fts->cache->first_doc_id;
@@ -901,9 +901,9 @@ fts_drop_index(
901901

902902
if (index_cache != NULL) {
903903
while (index->index_fts_syncing
904-
&& !trx_is_interrupted(trx)) {
905-
DICT_BG_YIELD(trx);
906-
}
904+
&& !trx_is_interrupted(trx)) {
905+
DICT_BG_YIELD(trx);
906+
}
907907
if (index_cache->words) {
908908
fts_words_free(index_cache->words);
909909
rbt_free(index_cache->words);

storage/xtradb/fts/fts0pars.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ extern int ftserror(const char* p);
106106
typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner);
107107

108108
struct fts_lexer_t {
109-
fts_scanner scanner;
110-
void* yyscanner;
109+
fts_scanner scanner;
110+
void* yyscanner;
111111
};
112112

113113

0 commit comments

Comments
 (0)