diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-05 17:08:21 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-05 17:50:41 +0200 |
commit | bae21bfb5de17328c33c3da8d191c6d3af14ae02 (patch) | |
tree | a7dfd9267b98eb490564df94ca253d953b128f5a | |
parent | d63e19806108efc1ca8d533841ad2471f2e0c4fe (diff) | |
parent | db55b39fb29979acd3c58581e34f8e51507a1792 (diff) | |
download | mariadb-git-bae21bfb5de17328c33c3da8d191c6d3af14ae02.tar.gz |
Merge 10.0 into 10.1
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 7 | ||||
-rw-r--r-- | storage/innobase/fts/fts0fts.cc | 20 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 68 | ||||
-rw-r--r-- | storage/innobase/handler/handler0alter.cc | 33 | ||||
-rw-r--r-- | storage/innobase/include/os0file.h | 6 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 5 | ||||
-rw-r--r-- | storage/innobase/row/row0sel.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/dict/dict0dict.cc | 7 | ||||
-rw-r--r-- | storage/xtradb/fts/fts0fts.cc | 20 | ||||
-rw-r--r-- | storage/xtradb/fts/fts0pars.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/fts/fts0pars.y | 4 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 59 | ||||
-rw-r--r-- | storage/xtradb/include/data0type.ic | 4 | ||||
-rw-r--r-- | storage/xtradb/include/dict0mem.h | 3 | ||||
-rw-r--r-- | storage/xtradb/row/row0import.cc | 9 | ||||
-rw-r--r-- | storage/xtradb/row/row0sel.cc | 5 |
16 files changed, 104 insertions, 154 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index bbb07e8835f..b48d51c15a7 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2013, 2018, MariaDB Corporation. @@ -3381,10 +3381,7 @@ dict_foreign_find_index( table, col_names, columns, n_cols, index, types_idx, check_charsets, check_null, - error, err_col_no,err_index) - && (!(index->online_status == - ONLINE_INDEX_ABORTED_DROPPED - ||index->online_status == ONLINE_INDEX_ABORTED))) { + error, err_col_no,err_index)) { if (error) { *error = DB_SUCCESS; } diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 5cbb7d9f77e..75258bb8610 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -870,19 +870,19 @@ fts_drop_index( err = fts_drop_index_tables(trx, index); while (index->index_fts_syncing - && !trx_is_interrupted(trx)) { - DICT_BG_YIELD(trx); - } + && !trx_is_interrupted(trx)) { + DICT_BG_YIELD(trx); + } - fts_free(table); + fts_free(table); return(err); } while (index->index_fts_syncing - && !trx_is_interrupted(trx)) { - DICT_BG_YIELD(trx); - } + && !trx_is_interrupted(trx)) { + DICT_BG_YIELD(trx); + } current_doc_id = table->fts->cache->next_doc_id; first_doc_id = table->fts->cache->first_doc_id; @@ -901,9 +901,9 @@ fts_drop_index( if (index_cache != NULL) { while (index->index_fts_syncing - && !trx_is_interrupted(trx)) { - DICT_BG_YIELD(trx); - } + && !trx_is_interrupted(trx)) { + DICT_BG_YIELD(trx); + } if (index_cache->words) { fts_words_free(index_cache->words); rbt_free(index_cache->words); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d35c6466240..8baee1d30fc 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2357,11 +2357,6 @@ 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. @@ -12872,36 +12867,35 @@ innobase_rename_table( row_mysql_lock_data_dictionary(trx); - dict_table_t* table = NULL; - table = dict_table_open_on_name(norm_from, TRUE, FALSE, - DICT_ERR_IGNORE_NONE); + dict_table_t* table = dict_table_open_on_name(norm_from, TRUE, FALSE, + DICT_ERR_IGNORE_NONE); - /* Since DICT_BG_YIELD has sleep for 250 milliseconds, + /* Since DICT_BG_YIELD has sleep for 250 milliseconds, Convert lock_wait_timeout unit from second to 250 milliseconds */ - long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4; - if (table != NULL) { - for (dict_index_t* index = dict_table_get_first_index(table); - index != NULL; - index = dict_table_get_next_index(index)) { - - if (index->type & DICT_FTS) { - /* Found */ - while (index->index_fts_syncing - && !trx_is_interrupted(trx) - && (lock_wait_timeout--) > 0) { - DICT_BG_YIELD(trx); - } - } - } - dict_table_close(table, TRUE, FALSE); - } + long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4; + if (table != NULL) { + for (dict_index_t* index = dict_table_get_first_index(table); + index != NULL; + index = dict_table_get_next_index(index)) { + + if (index->type & DICT_FTS) { + /* Found */ + while (index->index_fts_syncing + && !trx_is_interrupted(trx) + && (lock_wait_timeout--) > 0) { + DICT_BG_YIELD(trx); + } + } + } + dict_table_close(table, TRUE, FALSE); + } - /* FTS sync is in progress. We shall timeout this operation */ - if (lock_wait_timeout < 0) { - error = DB_LOCK_WAIT_TIMEOUT; - row_mysql_unlock_data_dictionary(trx); - DBUG_RETURN(error); - } + /* FTS sync is in progress. We shall timeout this operation */ + if (lock_wait_timeout < 0) { + error = DB_LOCK_WAIT_TIMEOUT; + row_mysql_unlock_data_dictionary(trx); + DBUG_RETURN(error); + } /* Transaction must be flagged as a locking transaction or it hasn't been started yet. */ @@ -13056,13 +13050,11 @@ ha_innobase::rename_table( my_error(ER_TABLE_EXISTS_ERROR, MYF(0), to); error = DB_ERROR; - } - - else if (error == DB_LOCK_WAIT_TIMEOUT) { - my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to); + } else if (error == DB_LOCK_WAIT_TIMEOUT) { + my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to); - error = DB_LOCK_WAIT; - } + error = DB_LOCK_WAIT; + } DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL)); } diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 37cc6a27b54..c32d8a34038 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -4283,23 +4283,11 @@ oom: table. Either way, we should be seeing and reporting a bogus duplicate key error. */ dup_key = NULL; - } else if (prebuilt->trx->error_key_num == 0) { + } 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]; - } 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; @@ -5234,18 +5222,9 @@ commit_try_rebuild( FTS_DOC_ID. */ dup_key = NULL; } else { - 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]; - } + 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)); diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 73becb38ef0..55e41f6ebb5 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Copyright (c) 2013, 2017, MariaDB Corporation. @@ -1323,10 +1323,6 @@ 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 diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 34f83f2fa22..356eec8e7ee 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2014, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -3339,10 +3339,9 @@ row_merge_file_create_low( file APIs, add instrumentation to register with performance schema */ struct PSI_file_locker* locker = NULL; - PSI_file_locker_state state; if (!path) { - path = innobase_mysql_tmpdir(); + path = mysql_tmpdir; } static const char label[] = "/Innodb Merge Temp File"; char* name = static_cast<char*>( diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 2fc7b68922b..06bf4cc30c0 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2015, 2018, MariaDB Corporation. @@ -4721,7 +4721,7 @@ no_gap_lock: prebuilt->new_rec_locks = 1; } err = DB_SUCCESS; - break; + /* fall through */ case DB_SUCCESS: break; case DB_LOCK_WAIT: diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index 15174b66632..23082e53ec7 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2013, 2018, MariaDB Corporation. @@ -3394,10 +3394,7 @@ dict_foreign_find_index( table, col_names, columns, n_cols, index, types_idx, check_charsets, check_null, - error, err_col_no,err_index) - && (!(index->online_status == - ONLINE_INDEX_ABORTED_DROPPED - ||index->online_status == ONLINE_INDEX_ABORTED))) { + error, err_col_no,err_index)) { if (error) { *error = DB_SUCCESS; } diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc index ac7d5e4ecac..02d81551e75 100644 --- a/storage/xtradb/fts/fts0fts.cc +++ b/storage/xtradb/fts/fts0fts.cc @@ -870,19 +870,19 @@ fts_drop_index( err = fts_drop_index_tables(trx, index); while (index->index_fts_syncing - && !trx_is_interrupted(trx)) { - DICT_BG_YIELD(trx); - } + && !trx_is_interrupted(trx)) { + DICT_BG_YIELD(trx); + } - fts_free(table); + fts_free(table); return(err); } while (index->index_fts_syncing - && !trx_is_interrupted(trx)) { - DICT_BG_YIELD(trx); - } + && !trx_is_interrupted(trx)) { + DICT_BG_YIELD(trx); + } current_doc_id = table->fts->cache->next_doc_id; first_doc_id = table->fts->cache->first_doc_id; @@ -901,9 +901,9 @@ fts_drop_index( if (index_cache != NULL) { while (index->index_fts_syncing - && !trx_is_interrupted(trx)) { - DICT_BG_YIELD(trx); - } + && !trx_is_interrupted(trx)) { + DICT_BG_YIELD(trx); + } if (index_cache->words) { fts_words_free(index_cache->words); rbt_free(index_cache->words); diff --git a/storage/xtradb/fts/fts0pars.cc b/storage/xtradb/fts/fts0pars.cc index b7fef4ea8ce..19917ccd26a 100644 --- a/storage/xtradb/fts/fts0pars.cc +++ b/storage/xtradb/fts/fts0pars.cc @@ -106,8 +106,8 @@ extern int ftserror(const char* p); typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner); struct fts_lexer_t { - fts_scanner scanner; - void* yyscanner; + fts_scanner scanner; + void* yyscanner; }; diff --git a/storage/xtradb/fts/fts0pars.y b/storage/xtradb/fts/fts0pars.y index 36dae9f7ceb..65c4189eece 100644 --- a/storage/xtradb/fts/fts0pars.y +++ b/storage/xtradb/fts/fts0pars.y @@ -52,8 +52,8 @@ extern int ftserror(const char* p); typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner); struct fts_lexer_struct { - fts_scanner scanner; - void* yyscanner; + fts_scanner scanner; + void* yyscanner; }; %} diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index fe413b300c0..a4434cd0d77 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -13464,36 +13464,35 @@ innobase_rename_table( row_mysql_lock_data_dictionary(trx); - dict_table_t* table = NULL; - table = dict_table_open_on_name(norm_from, TRUE, FALSE, - DICT_ERR_IGNORE_NONE); + dict_table_t* table = dict_table_open_on_name(norm_from, TRUE, FALSE, + DICT_ERR_IGNORE_NONE); - /* Since DICT_BG_YIELD has sleep for 250 milliseconds, + /* Since DICT_BG_YIELD has sleep for 250 milliseconds, Convert lock_wait_timeout unit from second to 250 milliseconds */ - long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4; - if (table != NULL) { - for (dict_index_t* index = dict_table_get_first_index(table); - index != NULL; - index = dict_table_get_next_index(index)) { - - if (index->type & DICT_FTS) { - /* Found */ - while (index->index_fts_syncing - && !trx_is_interrupted(trx) - && (lock_wait_timeout--) > 0) { - DICT_BG_YIELD(trx); - } - } - } - dict_table_close(table, TRUE, FALSE); - } + long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4; + if (table != NULL) { + for (dict_index_t* index = dict_table_get_first_index(table); + index != NULL; + index = dict_table_get_next_index(index)) { + + if (index->type & DICT_FTS) { + /* Found */ + while (index->index_fts_syncing + && !trx_is_interrupted(trx) + && (lock_wait_timeout--) > 0) { + DICT_BG_YIELD(trx); + } + } + } + dict_table_close(table, TRUE, FALSE); + } - /* FTS sync is in progress. We shall timeout this operation */ - if (lock_wait_timeout < 0) { - error = DB_LOCK_WAIT_TIMEOUT; - row_mysql_unlock_data_dictionary(trx); - DBUG_RETURN(error); - } + /* FTS sync is in progress. We shall timeout this operation */ + if (lock_wait_timeout < 0) { + error = DB_LOCK_WAIT_TIMEOUT; + row_mysql_unlock_data_dictionary(trx); + DBUG_RETURN(error); + } /* Transaction must be flagged as a locking transaction or it hasn't been started yet. */ @@ -13659,12 +13658,6 @@ ha_innobase::rename_table( error = DB_LOCK_WAIT; } - else if (error == DB_LOCK_WAIT_TIMEOUT) { - my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to); - - error = DB_LOCK_WAIT; - } - DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL)); } diff --git a/storage/xtradb/include/data0type.ic b/storage/xtradb/include/data0type.ic index 63a0785744d..a7e2eb0682c 100644 --- a/storage/xtradb/include/data0type.ic +++ b/storage/xtradb/include/data0type.ic @@ -525,7 +525,7 @@ dtype_get_fixed_size_low( return(0); } #endif /* UNIV_DEBUG */ - // fallthrough + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: @@ -603,7 +603,7 @@ dtype_get_min_size_low( return(0); } #endif /* UNIV_DEBUG */ - // fallthrough + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: diff --git a/storage/xtradb/include/dict0mem.h b/storage/xtradb/include/dict0mem.h index 4fdff9ba801..16aaab3e621 100644 --- a/storage/xtradb/include/dict0mem.h +++ b/storage/xtradb/include/dict0mem.h @@ -378,7 +378,8 @@ dict_mem_table_add_col( const char* name, /*!< in: column name, or NULL */ ulint mtype, /*!< in: main datatype */ ulint prtype, /*!< in: precise type */ - ulint len); /*!< in: precision */ + ulint len) /*!< in: precision */ + MY_ATTRIBUTE((nonnull(1))); /**********************************************************************//** Renames a column of a table in the data dictionary cache. */ UNIV_INTERN diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc index 2343e1bbfc9..36605c15a4b 100644 --- a/storage/xtradb/row/row0import.cc +++ b/storage/xtradb/row/row0import.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2015, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -1949,11 +1949,7 @@ PageConverter::update_index_page( return(DB_SUCCESS); } - if (!page_is_leaf(block->frame)) { - return (DB_SUCCESS); - } - - return(update_records(block)); + return page_is_leaf(block->frame) ? update_records(block) : DB_SUCCESS; } /** @@ -4239,4 +4235,3 @@ row_import_for_mysql( return(row_import_cleanup(prebuilt, trx, err)); } - diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index 264abed7c03..b6b5d107885 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -2738,7 +2738,8 @@ row_sel_field_store_in_mysql_format_func( case DATA_SYS: /* These column types should never be shipped to MySQL. */ ut_ad(0); - break; + /* fall through */ + case DATA_CHAR: case DATA_FIXBINARY: case DATA_FLOAT: @@ -4729,7 +4730,7 @@ no_gap_lock: prebuilt->new_rec_locks = 1; } err = DB_SUCCESS; - break; + /* fall through */ case DB_SUCCESS: break; case DB_LOCK_WAIT: |