diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-10-30 13:02:59 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-10-30 15:10:01 +0100 |
commit | 44f6f445933e12cbc4cce63e2b7d983b9938d3b9 (patch) | |
tree | f5230fb24510bb201eb33122a62939ce74588b83 /storage/xtradb | |
parent | 8772824ce72a811ea92dd5cfb73602eb93237891 (diff) | |
parent | f4b8b6b9a3ad4ce5e5218e2ec2dfe6dd34112e45 (diff) | |
download | mariadb-git-44f6f445933e12cbc4cce63e2b7d983b9938d3b9.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'storage/xtradb')
31 files changed, 353 insertions, 140 deletions
diff --git a/storage/xtradb/.clang-format b/storage/xtradb/.clang-format new file mode 100644 index 00000000000..d757d0a5a05 --- /dev/null +++ b/storage/xtradb/.clang-format @@ -0,0 +1,111 @@ +# generated with: +# clang-format-5.0 -style=Google --dump-config + +Language: Cpp +# BasedOnStyle: Google +AccessModifierOffset: -1 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: true +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeCategories: + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +SortUsingDeclarations: true +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +TabWidth: 8 + + +# changes for MySQL 5.x (InnoDB) +AlignConsecutiveDeclarations: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: All +ColumnLimit: 78 +DerivePointerAlignment: false +IndentWidth: 8 +MaxEmptyLinesToKeep: 2 +PointerAlignment: Right +ReflowComments: false +SortIncludes: false +SpaceAfterCStyleCast: true +UseTab: Always diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index f5ec6fd746d..96856a92239 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -62,9 +62,6 @@ IF(UNIX) LINK_LIBRARIES(${AIO_LIBRARY}) ENDIF() ADD_DEFINITIONS("-DUNIV_LINUX -D_GNU_SOURCE=1") - IF(HAVE_LIBNUMA) - LINK_LIBRARIES(numa) - ENDIF() ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP*") ADD_DEFINITIONS("-DUNIV_HPUX") ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "AIX") @@ -505,9 +502,15 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") ) ENDIF() +UNSET(NUMA_LIBRARY) +IF(HAVE_LIBNUMA) + SET(NUMA_LIBRARY "numa") +ENDIF() + MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE - DEFAULT RECOMPILE_FOR_EMBEDDED - LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT}) + DEFAULT + RECOMPILE_FOR_EMBEDDED + LINK_LIBRARIES ${ZLIB_LIBRARY} ${NUMA_LIBRARY} ${LINKER_SCRIPT}) IF(TARGET xtradb) IF(NOT XTRADB_OK) diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc index d4a6d669bf9..a5c8da7c5a9 100644 --- a/storage/xtradb/buf/buf0buf.cc +++ b/storage/xtradb/buf/buf0buf.cc @@ -55,6 +55,9 @@ Created 11/5/1995 Heikki Tuuri #include "page0zip.h" #include "srv0mon.h" #include "buf0checksum.h" + +UNIV_INTERN my_bool srv_numa_interleave = FALSE; + #ifdef HAVE_LIBNUMA #include <numa.h> #include <numaif.h> @@ -1405,7 +1408,8 @@ buf_chunk_init( /*===========*/ buf_pool_t* buf_pool, /*!< in: buffer pool instance */ buf_chunk_t* chunk, /*!< out: chunk of buffers */ - ulint mem_size) /*!< in: requested size in bytes */ + ulint mem_size, /*!< in: requested size in bytes */ + bool populate) /*!< in: virtual page preallocation */ { buf_block_t* block; byte* frame; @@ -1421,7 +1425,7 @@ buf_chunk_init( + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE); chunk->mem_size = mem_size; - chunk->mem = os_mem_alloc_large(&chunk->mem_size); + chunk->mem = os_mem_alloc_large(&chunk->mem_size, populate); if (UNIV_UNLIKELY(chunk->mem == NULL)) { @@ -1640,6 +1644,7 @@ buf_pool_init_instance( /*===================*/ buf_pool_t* buf_pool, /*!< in: buffer pool instance */ ulint buf_pool_size, /*!< in: size in bytes */ + bool populate, /*!< in: virtual page preallocation */ ulint instance_no) /*!< in: id of the instance */ { ulint i; @@ -1666,7 +1671,7 @@ buf_pool_init_instance( buf_pool->chunks = chunk = (buf_chunk_t*) mem_zalloc(sizeof *chunk); - if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) { + if (!buf_chunk_init(buf_pool, chunk, buf_pool_size, populate)) { mem_free(chunk); mem_free(buf_pool); @@ -1821,6 +1826,7 @@ dberr_t buf_pool_init( /*==========*/ ulint total_size, /*!< in: size of the total pool in bytes */ + bool populate, /*!< in: virtual page preallocation */ ulint n_instances) /*!< in: number of instances */ { ulint i; @@ -1851,7 +1857,7 @@ buf_pool_init( for (i = 0; i < n_instances; i++) { buf_pool_t* ptr = &buf_pool_ptr[i]; - if (buf_pool_init_instance(ptr, size, i) != DB_SUCCESS) { + if (buf_pool_init_instance(ptr, size, populate, i) != DB_SUCCESS) { /* Free all the instances created so far. */ buf_pool_free(i); diff --git a/storage/xtradb/buf/buf0dump.cc b/storage/xtradb/buf/buf0dump.cc index e9168d9f5d5..f73bf3bdc58 100644 --- a/storage/xtradb/buf/buf0dump.cc +++ b/storage/xtradb/buf/buf0dump.cc @@ -200,8 +200,9 @@ buf_dump( { #define SHOULD_QUIT() (SHUTTING_DOWN() && obey_shutdown) + static const char format_name[]= "%s.incomplete"; char full_filename[OS_FILE_MAX_PATH]; - char tmp_filename[OS_FILE_MAX_PATH + sizeof "incomplete"]; + char tmp_filename[OS_FILE_MAX_PATH + sizeof(format_name)]; char now[32]; FILE* f; ulint i; @@ -212,7 +213,7 @@ buf_dump( srv_buf_dump_filename); ut_snprintf(tmp_filename, sizeof(tmp_filename), - "%s.incomplete", full_filename); + format_name, full_filename); buf_dump_status(STATUS_NOTICE, "Dumping buffer pool(s) to %s", full_filename); diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index 23082e53ec7..15174b66632 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. Copyright (c) 2013, 2018, MariaDB Corporation. @@ -3394,7 +3394,10 @@ dict_foreign_find_index( table, col_names, columns, n_cols, index, types_idx, check_charsets, check_null, - error, err_col_no,err_index)) { + error, err_col_no,err_index) + && (!(index->online_status == + ONLINE_INDEX_ABORTED_DROPPED + ||index->online_status == ONLINE_INDEX_ABORTED))) { if (error) { *error = DB_SUCCESS; } diff --git a/storage/xtradb/fts/fts0blex.cc b/storage/xtradb/fts/fts0blex.cc index 2d71934fa0e..a8f231268ac 100644 --- a/storage/xtradb/fts/fts0blex.cc +++ b/storage/xtradb/fts/fts0blex.cc @@ -701,9 +701,9 @@ extern int fts0blex (yyscan_t yyscanner); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; #line 43 "fts0blex.l" @@ -753,7 +753,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -984,9 +984,9 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1118,15 +1118,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1151,11 +1151,11 @@ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; + int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1912,7 +1912,7 @@ int fts0blex_destroy (yyscan_t yyscanner) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1921,7 +1921,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc index 5981c24c470..ac7d5e4ecac 100644 --- a/storage/xtradb/fts/fts0fts.cc +++ b/storage/xtradb/fts/fts0fts.cc @@ -67,7 +67,7 @@ UNIV_INTERN ulong fts_max_total_cache_size; /** This is FTS result cache limit for each query and would be a configurable variable */ -UNIV_INTERN ulong fts_result_cache_limit; +UNIV_INTERN size_t fts_result_cache_limit; /** Variable specifying the maximum FTS max token size */ UNIV_INTERN ulong fts_max_token_size; @@ -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); @@ -4308,7 +4308,7 @@ fts_sync_begin( if (fts_enable_diag_print) { ib_logf(IB_LOG_LEVEL_INFO, "FTS SYNC for table %s, deleted count: %ld size: " - "%lu bytes", + "%zu bytes", sync->table->name, ib_vector_size(cache->deleted_doc_ids), cache->total_size); diff --git a/storage/xtradb/fts/fts0pars.cc b/storage/xtradb/fts/fts0pars.cc index 19917ccd26a..b7fef4ea8ce 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 65c4189eece..36dae9f7ceb 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/fts/fts0que.cc b/storage/xtradb/fts/fts0que.cc index 9966656e772..b9ad43c626a 100644 --- a/storage/xtradb/fts/fts0que.cc +++ b/storage/xtradb/fts/fts0que.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. 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 @@ -76,7 +76,7 @@ struct fts_query_t { fts_table_t fts_index_table;/*!< FTS auxiliary index table def */ - ulint total_size; /*!< total memory size used by query */ + size_t total_size; /*!< total memory size used by query */ fts_doc_ids_t* deleted; /*!< Deleted doc ids that need to be filtered from the output */ @@ -4058,7 +4058,7 @@ fts_query( /* Log memory consumption & result size */ ib_logf(IB_LOG_LEVEL_INFO, "Full Search Memory: " - "%lu (bytes), Row: %lu .", + "%zu (bytes), Row: %lu .", query.total_size, (*result)->rankings_by_id ? rbt_size((*result)->rankings_by_id) diff --git a/storage/xtradb/fts/fts0tlex.cc b/storage/xtradb/fts/fts0tlex.cc index d4d9b4c48d1..28fac9bf704 100644 --- a/storage/xtradb/fts/fts0tlex.cc +++ b/storage/xtradb/fts/fts0tlex.cc @@ -697,9 +697,9 @@ extern int fts0tlex (yyscan_t yyscanner); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; #line 44 "fts0tlex.l" @@ -749,7 +749,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -976,9 +976,9 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1110,15 +1110,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1143,11 +1143,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; + int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1905,7 +1905,7 @@ int fts0tlex_destroy (yyscan_t yyscanner) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1914,7 +1914,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused))) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index fa63ed58292..ce986079b47 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -3555,13 +3555,13 @@ innobase_convert_identifier( ibool file_id)/*!< in: TRUE=id is a table or database name; FALSE=id is an UTF-8 string */ { - char nz2[MAX_TABLE_NAME_LEN + 1]; const char* s = id; int q; - if (file_id) { + char nz[MAX_TABLE_NAME_LEN + 1]; + char nz2[MAX_TABLE_NAME_LEN + 1]; - char nz[MAX_TABLE_NAME_LEN + 1]; + if (file_id) { /* Decode the table name. The MySQL function expects a NUL-terminated string. The input and output strings @@ -13463,35 +13463,36 @@ innobase_rename_table( row_mysql_lock_data_dictionary(trx); - dict_table_t* table = dict_table_open_on_name(norm_from, TRUE, FALSE, - DICT_ERR_IGNORE_NONE); + dict_table_t* table = NULL; + 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. */ @@ -13657,6 +13658,12 @@ 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)); } @@ -20715,10 +20722,10 @@ static MYSQL_SYSVAR_ULONG(ft_total_cache_size, fts_max_total_cache_size, "Total memory allocated for InnoDB Fulltext Search cache", NULL, NULL, 640000000, 32000000, 1600000000, 0); -static MYSQL_SYSVAR_ULONG(ft_result_cache_limit, fts_result_cache_limit, +static MYSQL_SYSVAR_SIZE_T(ft_result_cache_limit, fts_result_cache_limit, PLUGIN_VAR_RQCMDARG, "InnoDB Fulltext search query result cache limit in bytes", - NULL, NULL, 2000000000L, 1000000L, 4294967295UL, 0); + NULL, NULL, 2000000000L, 1000000L, SIZE_T_MAX, 0); static MYSQL_SYSVAR_ULONG(ft_min_token_size, fts_min_token_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h index 3dbbc53a0e3..2b562c6a394 100644 --- a/storage/xtradb/handler/ha_innodb.h +++ b/storage/xtradb/handler/ha_innodb.h @@ -206,7 +206,7 @@ class ha_innobase: public handler char* remote_path); const char* check_table_options(THD *thd, TABLE* table, HA_CREATE_INFO* create_info, const bool use_tablespace, const ulint file_format); - int create(const char *name, register TABLE *form, + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); int truncate(); int delete_table(const char *name); diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h index 0944b5d4067..b4ea4d56e31 100644 --- a/storage/xtradb/include/buf0buf.h +++ b/storage/xtradb/include/buf0buf.h @@ -217,6 +217,7 @@ dberr_t buf_pool_init( /*=========*/ ulint size, /*!< in: Size of the total pool in bytes */ + bool populate, /*!< in: Force virtual page preallocation */ ulint n_instances); /*!< in: Number of instances */ /********************************************************************//** Frees the buffer pool at shutdown. This must not be invoked before diff --git a/storage/xtradb/include/data0type.ic b/storage/xtradb/include/data0type.ic index a7e2eb0682c..63a0785744d 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 */ - /* fall through */ + // fallthrough case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: @@ -603,7 +603,7 @@ dtype_get_min_size_low( return(0); } #endif /* UNIV_DEBUG */ - /* fall through */ + // fallthrough case DATA_CHAR: case DATA_FIXBINARY: case DATA_INT: diff --git a/storage/xtradb/include/dict0mem.h b/storage/xtradb/include/dict0mem.h index 16aaab3e621..4fdff9ba801 100644 --- a/storage/xtradb/include/dict0mem.h +++ b/storage/xtradb/include/dict0mem.h @@ -378,8 +378,7 @@ 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 */ - MY_ATTRIBUTE((nonnull(1))); + ulint len); /*!< in: precision */ /**********************************************************************//** Renames a column of a table in the data dictionary cache. */ UNIV_INTERN diff --git a/storage/xtradb/include/fts0fts.h b/storage/xtradb/include/fts0fts.h index 4c2d247e0a6..ce30a17c4b4 100644 --- a/storage/xtradb/include/fts0fts.h +++ b/storage/xtradb/include/fts0fts.h @@ -355,7 +355,7 @@ extern ulong fts_max_cache_size; extern ulong fts_max_total_cache_size; /** Variable specifying the FTS result cache limit for each query */ -extern ulong fts_result_cache_limit; +extern size_t fts_result_cache_limit; /** Variable specifying the maximum FTS max token size */ extern ulong fts_max_token_size; diff --git a/storage/xtradb/include/fts0types.h b/storage/xtradb/include/fts0types.h index 0dad75d8f1b..9ecd9080881 100644 --- a/storage/xtradb/include/fts0types.h +++ b/storage/xtradb/include/fts0types.h @@ -161,7 +161,7 @@ struct fts_cache_t { the document from the table. Each element is of type fts_doc_t */ - ulint total_size; /*!< total size consumed by the ilist + size_t total_size; /*!< total size consumed by the ilist field of all nodes. SYNC is run whenever this gets too big */ fts_sync_t* sync; /*!< sync structure to sync data to @@ -243,7 +243,7 @@ struct fts_fetch_t { fts_sql_callback read_record; /*!< Callback for reading index record */ - ulint total_memory; /*!< Total memory used */ + size_t total_memory; /*!< Total memory used */ }; /** For horizontally splitting an FTS auxiliary index */ diff --git a/storage/xtradb/include/os0proc.h b/storage/xtradb/include/os0proc.h index 613e3bd6947..d6aafccf48e 100644 --- a/storage/xtradb/include/os0proc.h +++ b/storage/xtradb/include/os0proc.h @@ -58,7 +58,8 @@ UNIV_INTERN void* os_mem_alloc_large( /*===============*/ - ulint* n); /*!< in/out: number of bytes */ + ulint* n, /*!< in/out: number of bytes */ + bool populate); /*!< in: virtual page preallocation */ /****************************************************************//** Frees large pages memory. */ UNIV_INTERN diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 9aafb88522f..67e4d90d6df 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -45,10 +45,10 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 5 #define INNODB_VERSION_MINOR 6 -#define INNODB_VERSION_BUGFIX 39 +#define INNODB_VERSION_BUGFIX 41 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 83.1 +#define PERCONA_INNODB_VERSION 84.1 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/xtradb/log/log0online.cc b/storage/xtradb/log/log0online.cc index af32237243b..42e92ea6f0e 100644 --- a/storage/xtradb/log/log0online.cc +++ b/storage/xtradb/log/log0online.cc @@ -1522,10 +1522,10 @@ log_online_open_bitmap_file_read_only( if (srv_data_home_len && srv_data_home[srv_data_home_len-1] != SRV_PATH_SEPARATOR) { - ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%c%s", + ut_snprintf(bitmap_file->name, sizeof(bitmap_file->name), "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR, name); } else { - ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%s", + ut_snprintf(bitmap_file->name, sizeof(bitmap_file->name), "%s%s", srv_data_home, name); } bitmap_file->file diff --git a/storage/xtradb/os/os0proc.cc b/storage/xtradb/os/os0proc.cc index ff6d65e4ae6..6c9116e1397 100644 --- a/storage/xtradb/os/os0proc.cc +++ b/storage/xtradb/os/os0proc.cc @@ -32,6 +32,14 @@ Created 9/30/1995 Heikki Tuuri #include "ut0mem.h" #include "ut0byte.h" +/* Linux release version */ +#if defined(UNIV_LINUX) && defined(_GNU_SOURCE) +#include <string.h> /* strverscmp() */ +#include <sys/utsname.h> /* uname() */ +#endif + +#include "ha_prototypes.h" + /* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and MAP_ANON but MAP_ANON is marked as deprecated */ #if defined(MAP_ANONYMOUS) @@ -40,10 +48,36 @@ MAP_ANON but MAP_ANON is marked as deprecated */ #define OS_MAP_ANON MAP_ANON #endif +/* Linux's MAP_POPULATE */ +#if defined(MAP_POPULATE) +#define OS_MAP_POPULATE MAP_POPULATE +#else +#define OS_MAP_POPULATE 0 +#endif + UNIV_INTERN ibool os_use_large_pages; /* Large page size. This may be a boot-time option on some platforms */ UNIV_INTERN ulint os_large_page_size; + +/****************************************************************//** +Retrieve and compare operating system release. +@return TRUE if the OS release is equal to, or later than release. */ +UNIV_INTERN +bool +os_compare_release( +/*===============*/ + const char* release /*!< in: OS release */ + MY_ATTRIBUTE((unused))) +{ +#if defined(UNIV_LINUX) && defined(_GNU_SOURCE) + struct utsname name; + return uname(&name) == 0 && strverscmp(name.release, release) >= 0; +#else + return false; +#endif +} + /****************************************************************//** Converts the current process id to a number. It is not guaranteed that the number is unique. In Linux returns the 'process number' of the current @@ -69,7 +103,8 @@ UNIV_INTERN void* os_mem_alloc_large( /*===============*/ - ulint* n) /*!< in/out: number of bytes */ + ulint* n, /*!< in/out: number of bytes */ + bool populate) /*!< in: virtual page preallocation */ { void* ptr; ulint size; @@ -155,12 +190,13 @@ skip: ut_ad(ut_is_2pow(size)); size = *n = ut_2pow_round(*n + (size - 1), size); ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | OS_MAP_ANON, -1, 0); - if (UNIV_UNLIKELY(ptr == (void*) -1)) { + MAP_PRIVATE | OS_MAP_ANON | + (populate ? OS_MAP_POPULATE : 0), -1, 0); + if (UNIV_UNLIKELY(ptr == MAP_FAILED)) { fprintf(stderr, "InnoDB: mmap(%lu bytes) failed;" " errno %lu\n", (ulong) size, (ulong) errno); - ptr = NULL; + return NULL; } else { os_fast_mutex_lock(&ut_list_mutex); ut_total_allocated_memory += size; @@ -168,6 +204,25 @@ skip: UNIV_MEM_ALLOC(ptr, size); } #endif + +#if OS_MAP_ANON && OS_MAP_POPULATE + /* MAP_POPULATE is only supported for private mappings + since Linux 2.6.23. */ + populate = populate && !os_compare_release("2.6.23"); + + if (populate) { + ib_logf(IB_LOG_LEVEL_WARN, "InnoDB: Warning: mmap(MAP_POPULATE) " + "is not supported for private mappings. " + "Forcing preallocation by faulting in pages.\n"); + } +#endif + + /* Initialize the entire buffer to force the allocation + of physical memory page frames. */ + if (populate) { + memset(ptr, '\0', size); + } + return(ptr); } diff --git a/storage/xtradb/pars/lexyy.cc b/storage/xtradb/pars/lexyy.cc index 62122bb9f6f..bc6544b099d 100644 --- a/storage/xtradb/pars/lexyy.cc +++ b/storage/xtradb/pars/lexyy.cc @@ -1187,9 +1187,9 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; #line 112 "pars0lex.l" @@ -1238,7 +1238,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2380,9 +2380,9 @@ case YY_STATE_EOF(id): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -2515,14 +2515,14 @@ static int yy_get_next_buffer (void) yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2547,10 +2547,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3070,7 +3070,7 @@ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -3079,7 +3079,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc index 7cb4a9a5037..2343e1bbfc9 100644 --- a/storage/xtradb/row/row0import.cc +++ b/storage/xtradb/row/row0import.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2018, 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,7 +1949,11 @@ PageConverter::update_index_page( return(DB_SUCCESS); } - return page_is_leaf(block->frame) ? update_records(block) : DB_SUCCESS; + if (!page_is_leaf(block->frame)) { + return (DB_SUCCESS); + } + + return(update_records(block)); } /** diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc index d86dcb077e5..0fc1af64b74 100644 --- a/storage/xtradb/row/row0log.cc +++ b/storage/xtradb/row/row0log.cc @@ -236,7 +236,7 @@ row_log_block_allocate( DBUG_ENTER("row_log_block_allocate"); if (log_buf.block == NULL) { log_buf.size = srv_sort_buf_size; - log_buf.block = (byte*) os_mem_alloc_large(&log_buf.size); + log_buf.block = (byte*) os_mem_alloc_large(&log_buf.size, false); DBUG_EXECUTE_IF("simulate_row_log_allocation_failure", if (log_buf.block) os_mem_free_large(log_buf.block, log_buf.size); @@ -2916,8 +2916,8 @@ row_log_allocate( if (log_tmp_is_encrypted()) { ulint size = srv_sort_buf_size; - log->crypt_head = static_cast<byte *>(os_mem_alloc_large(&size)); - log->crypt_tail = static_cast<byte *>(os_mem_alloc_large(&size)); + log->crypt_head = static_cast<byte *>(os_mem_alloc_large(&size, false)); + log->crypt_tail = static_cast<byte *>(os_mem_alloc_large(&size, false)); if (!log->crypt_head || !log->crypt_tail) { row_log_free(log); diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 9f8fc39e06b..e4440640431 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -3343,9 +3343,17 @@ row_merge_file_create_low( performance schema */ struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; + if (!path) { + path = mysql_tmpdir; + } + static const char label[] = "/Innodb Merge Temp File"; + char* name = static_cast<char*>( + ut_malloc(strlen(path) + sizeof label)); + strcpy(name, path); + strcat(name, label); locker = PSI_FILE_CALL(get_thread_file_name_locker)( &state, innodb_file_temp_key, PSI_FILE_OPEN, - "Innodb Merge Temp File", &locker); + path ? name : label, &locker); if (locker != NULL) { PSI_FILE_CALL(start_file_open_wait)(locker, __FILE__, @@ -3358,6 +3366,7 @@ row_merge_file_create_low( PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)( locker, fd); } + ut_free(name); #endif if (fd < 0) { @@ -3888,7 +3897,7 @@ row_merge_build_indexes( block_size = 3 * srv_sort_buf_size; block = static_cast<row_merge_block_t*>( - os_mem_alloc_large(&block_size)); + os_mem_alloc_large(&block_size, false)); if (block == NULL) { DBUG_RETURN(DB_OUT_OF_MEMORY); @@ -3898,7 +3907,7 @@ row_merge_build_indexes( encryption/decryption. */ if (log_tmp_is_encrypted()) { crypt_block = static_cast<row_merge_block_t*>( - os_mem_alloc_large(&block_size)); + os_mem_alloc_large(&block_size, false)); if (crypt_block == NULL) { DBUG_RETURN(DB_OUT_OF_MEMORY); diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index 804d55af965..5c458656135 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -5135,6 +5135,18 @@ 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. */ @@ -5311,8 +5323,9 @@ row_rename_table_for_mysql( } } - if ((dict_table_has_fts_index(table) - || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID)) + if (err == DB_SUCCESS + && (dict_table_has_fts_index(table) + || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID)) && !dict_tables_have_same_db(old_name, new_name)) { err = fts_rename_aux_tables(table, new_name, trx); if (err != DB_TABLE_NOT_FOUND) { diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index b6b5d107885..264abed7c03 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -2738,8 +2738,7 @@ row_sel_field_store_in_mysql_format_func( case DATA_SYS: /* These column types should never be shipped to MySQL. */ ut_ad(0); - /* fall through */ - + break; case DATA_CHAR: case DATA_FIXBINARY: case DATA_FLOAT: @@ -4730,7 +4729,7 @@ no_gap_lock: prebuilt->new_rec_locks = 1; } err = DB_SUCCESS; - /* fall through */ + break; case DB_SUCCESS: break; case DB_LOCK_WAIT: diff --git a/storage/xtradb/srv/srv0conc.cc b/storage/xtradb/srv/srv0conc.cc index 1d77da63c24..0f8da9516de 100644 --- a/storage/xtradb/srv/srv0conc.cc +++ b/storage/xtradb/srv/srv0conc.cc @@ -285,6 +285,7 @@ srv_conc_enter_innodb_with_atomics( notified_mysql = TRUE; } + DEBUG_SYNC_C("user_thread_waiting"); trx->op_info = "sleeping before entering InnoDB"; sleep_in_us = srv_thread_sleep_delay; diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index abdd31333f4..0133b17fada 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -175,7 +175,6 @@ use simulated aio we build below with threads. Currently we support native aio on windows and linux */ /* make srv_use_native_aio to be visible for other plugins */ my_bool srv_use_native_aio = TRUE; -UNIV_INTERN my_bool srv_numa_interleave = FALSE; /* Default compression level if page compression is used and no compression level is set for the table*/ diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 4ed310089ac..75b664a0558 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -2184,7 +2184,8 @@ innobase_start_or_create_for_mysql() ib_logf(IB_LOG_LEVEL_INFO, "Initializing buffer pool, size = %.1f%c", size, unit); - err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances); + err = buf_pool_init(srv_buf_pool_size, static_cast<bool>(srv_numa_interleave), + srv_buf_pool_instances); if (err != DB_SUCCESS) { ib_logf(IB_LOG_LEVEL_ERROR, |