diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc index 871cc7508c0..ca0619db371 100644 --- a/extra/mariabackup/fil_cur.cc +++ b/extra/mariabackup/fil_cur.cc @@ -186,6 +186,7 @@ xb_fil_cur_open( } #else err = fstat(cursor->file.m_file, &cursor->statinfo); + MSAN_STAT_WORKAROUND(&cursor->statinfo); #endif if (max_file_size < (ulonglong)cursor->statinfo.st_size) { cursor->statinfo.st_size = (ulonglong)max_file_size; diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 8aeeb7d7e9f..3342ec47760 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -3756,6 +3756,7 @@ next_file: return(-1); } + MSAN_STAT_WORKAROUND(&statinfo); info->size = statinfo.st_size; if (S_ISDIR(statinfo.st_mode)) { diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 308dbb77a3e..ff239d676a9 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -454,9 +454,8 @@ sub mtr_report_stats ($$$$) { # Print info about reporting the error print "The log files in var/log may give you some hint of what went wrong.\n\n", - "If you want to report this error, please read first ", - "the documentation\n", - "at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n\n"; + "If you want to report this error, MariaDB's bug tracker is found at\n", + "https://jira.mariadb.org\n\n"; } else diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl index 8964b0f8077..6f8677110ba 100644 --- a/mysql-test/lib/v1/mtr_report.pl +++ b/mysql-test/lib/v1/mtr_report.pl @@ -198,9 +198,8 @@ sub mtr_report_stats ($) { print "The log files in var/log may give you some hint\n", "of what went wrong.\n", - "If you want to report this error, please read first ", - "the documentation at\n", - "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n"; + "If you want to report this error, MariaDB's bug tracker is found at\n", + "https://jira.mariadb.org\n" } if (!$::opt_extern) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index b30cd56125f..77ea79a277f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7968,11 +7968,15 @@ bool setup_tables(THD *thd, Name_resolution_context *context, DBUG_RETURN(1); } tablenr++; - } - if (tablenr > MAX_TABLES) - { - my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast(MAX_TABLES)); - DBUG_RETURN(1); + /* + Test MAX_TABLES overflow here inside the loop as setup_table_map() + called in each iteration is sensitive for this + */ + if (tablenr > MAX_TABLES) + { + my_error(ER_TOO_MANY_TABLES, MYF(0), static_cast(MAX_TABLES)); + DBUG_RETURN(1); + } } if (select_insert && !is_insert_tables_num_set) { diff --git a/sql/sql_base.h b/sql/sql_base.h index e86c883d80e..2cf64fc65d4 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -358,6 +358,7 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) table->maybe_null= embedding->outer_join; embedding= embedding->embedding; } + DBUG_ASSERT(tablenr <= MAX_TABLES); table->tablenr= tablenr; table->map= (table_map) 1 << tablenr; table->force_index= table_list->force_index; diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index f7b0f2c1052..609aaf951ca 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1225,6 +1225,14 @@ public: | DICT_FTS | DICT_CORRUPT))); } + /** @return whether this is a normal, non-virtual B-tree index + (not the change buffer, not SPATIAL or FULLTEXT) */ + bool is_normal_btree() const noexcept { + return UNIV_LIKELY(!(type & (DICT_IBUF | DICT_SPATIAL + | DICT_FTS | DICT_CORRUPT + | DICT_VIRTUAL))); + } + /** @return whether the index includes virtual columns */ bool has_virtual() const { return type & DICT_VIRTUAL; } diff --git a/storage/innobase/pars/pars0opt.cc b/storage/innobase/pars/pars0opt.cc index f3b71132998..bbbba384890 100644 --- a/storage/innobase/pars/pars0opt.cc +++ b/storage/innobase/pars/pars0opt.cc @@ -340,9 +340,7 @@ opt_calc_index_goodness( ulint op; ulint j; - /* At least for now we don't support using FTS indexes for queries - done through InnoDB's own SQL parser. */ - if (dict_index_is_online_ddl(index) || (index->type & DICT_FTS)) { + if (!index->is_normal_btree() || !index->is_committed()) { return(0); } @@ -553,7 +551,8 @@ opt_search_plan_for_table( plan_t* plan; dict_index_t* index; ulint n_fields; - ulint best_last_op; + ulint best_goodness = 0; + ulint best_last_op = 0; que_node_t* index_plan[256]; que_node_t* best_index_plan[256]; @@ -567,14 +566,9 @@ opt_search_plan_for_table( /* Calculate goodness for each index of the table */ plan->index = index = dict_table_get_first_index(table); - ulint best_goodness = opt_calc_index_goodness( - index, sel_node, i, best_index_plan, &best_last_op); - while ((index = dict_table_get_next_index(index))) { - if (!index->is_btree()) { - continue; - } - ulint last_op; + do { + ulint last_op = 0; ulint goodness = opt_calc_index_goodness(index, sel_node, i, index_plan, &last_op); if (goodness > best_goodness) { @@ -586,7 +580,9 @@ opt_search_plan_for_table( n_fields * sizeof *index_plan); best_last_op = last_op; } - } + + index = dict_table_get_next_index(index); + } while (index); n_fields = opt_calc_n_fields_from_goodness(best_goodness);