summaryrefslogtreecommitdiff
path: root/storage/innobase/dict
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-28 22:01:55 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-28 22:01:55 +0200
commit3361aee591b1eb8c676f60887ffc535cd509890a (patch)
tree54a65f83ba7d9293e6f8e8281ad920fbae6eb823 /storage/innobase/dict
parent6ce20fb2b9fe57330c797694b9dbea4028f40d7c (diff)
parent0fdb17e6c3f50ae22eb97b6363bcbd8b0cd9e040 (diff)
downloadmariadb-git-3361aee591b1eb8c676f60887ffc535cd509890a.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'storage/innobase/dict')
-rw-r--r--storage/innobase/dict/dict0crea.cc26
-rw-r--r--storage/innobase/dict/dict0dict.cc14
-rw-r--r--storage/innobase/dict/dict0load.cc26
-rw-r--r--storage/innobase/dict/dict0mem.cc4
-rw-r--r--storage/innobase/dict/dict0stats_bg.cc4
5 files changed, 36 insertions, 38 deletions
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc
index a5af8208135..d423f16f61c 100644
--- a/storage/innobase/dict/dict0crea.cc
+++ b/storage/innobase/dict/dict0crea.cc
@@ -246,7 +246,7 @@ dict_create_sys_columns_tuple(
/***************************************************************//**
Builds a table definition to insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_build_table_def_step(
/*======================*/
@@ -574,7 +574,7 @@ dict_create_search_tuple(
/***************************************************************//**
Builds an index definition row to insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_build_index_def_step(
/*======================*/
@@ -649,7 +649,7 @@ dict_build_field_def_step(
/***************************************************************//**
Creates an index tree for the index if it is not a member of a cluster.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_create_index_tree_step(
/*========================*/
@@ -1369,7 +1369,7 @@ dict_create_or_check_foreign_constraint_tables(void)
ib_logf(IB_LOG_LEVEL_WARN,
"Dropping incompletely created "
"SYS_FOREIGN table.");
- row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
+ row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE, TRUE);
}
if (sys_foreign_cols_err == DB_CORRUPTION) {
@@ -1377,7 +1377,7 @@ dict_create_or_check_foreign_constraint_tables(void)
"Dropping incompletely created "
"SYS_FOREIGN_COLS table.");
- row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
+ row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE, TRUE);
}
ib_logf(IB_LOG_LEVEL_WARN,
@@ -1431,8 +1431,8 @@ dict_create_or_check_foreign_constraint_tables(void)
ut_ad(err == DB_OUT_OF_FILE_SPACE
|| err == DB_TOO_MANY_CONCURRENT_TRXS);
- row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE);
- row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE);
+ row_drop_table_for_mysql("SYS_FOREIGN", trx, TRUE, TRUE);
+ row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, TRUE, TRUE);
if (err == DB_OUT_OF_FILE_SPACE) {
err = DB_MUST_GET_MORE_FILE_SPACE;
@@ -1468,7 +1468,7 @@ dict_create_or_check_foreign_constraint_tables(void)
/****************************************************************//**
Evaluate the given foreign key SQL statement.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_foreign_eval_sql(
/*==================*/
@@ -1534,7 +1534,7 @@ dict_foreign_eval_sql(
Add a single foreign key field definition to the data dictionary tables in
the database.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_create_add_foreign_field_to_dictionary(
/*========================================*/
@@ -1857,7 +1857,7 @@ dict_create_or_check_sys_tablespace(void)
ib_logf(IB_LOG_LEVEL_WARN,
"Dropping incompletely created "
"SYS_TABLESPACES table.");
- row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE);
+ row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE, TRUE);
}
if (sys_datafiles_err == DB_CORRUPTION) {
@@ -1865,7 +1865,7 @@ dict_create_or_check_sys_tablespace(void)
"Dropping incompletely created "
"SYS_DATAFILES table.");
- row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE);
+ row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE, TRUE);
}
ib_logf(IB_LOG_LEVEL_INFO,
@@ -1901,8 +1901,8 @@ dict_create_or_check_sys_tablespace(void)
ut_a(err == DB_OUT_OF_FILE_SPACE
|| err == DB_TOO_MANY_CONCURRENT_TRXS);
- row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE);
- row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE);
+ row_drop_table_for_mysql("SYS_TABLESPACES", trx, TRUE, TRUE);
+ row_drop_table_for_mysql("SYS_DATAFILES", trx, TRUE, TRUE);
if (err == DB_OUT_OF_FILE_SPACE) {
err = DB_MUST_GET_MORE_FILE_SPACE;
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index c51deb0a048..0310e5e1d66 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2015, 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, 2015, MariaDB Corporation.
@@ -6309,7 +6309,7 @@ dict_set_corrupted_index_cache_only(
dict_index_t* index, /*!< in/out: index */
dict_table_t* table) /*!< in/out: table */
{
- ut_ad(index);
+ ut_ad(index != NULL);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
@@ -6319,8 +6319,9 @@ dict_set_corrupted_index_cache_only(
if (dict_index_is_clust(index)) {
dict_table_t* corrupt_table;
- corrupt_table = table ? table : index->table;
- ut_ad(!index->table || !table || index->table == table);
+ corrupt_table = (table != NULL) ? table : index->table;
+ ut_ad((index->table != NULL) || (table != NULL)
+ || index->table == table);
if (corrupt_table) {
corrupt_table->corrupted = TRUE;
@@ -6400,11 +6401,6 @@ dict_table_get_index_on_name(
{
dict_index_t* index;
- /* If name is NULL, just return */
- if (!name) {
- return(NULL);
- }
-
index = dict_table_get_first_index(table);
while (index != NULL) {
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index ce5b10a623c..3c72efdb6f3 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
@@ -1751,7 +1751,7 @@ err_len:
goto err_len;
}
type = mach_read_from_4(field);
- if (type & (~0 << DICT_IT_BITS)) {
+ if (type & (~0U << DICT_IT_BITS)) {
return("unknown SYS_INDEXES.TYPE bits");
}
@@ -1790,7 +1790,7 @@ Loads definitions for table indexes. Adds them to the data dictionary
cache.
@return DB_SUCCESS if ok, DB_CORRUPTION if corruption of dictionary
table or DB_UNSUPPORTED if table has unknown index type */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
dict_load_indexes(
/*==============*/
@@ -2538,6 +2538,7 @@ func_exit:
/* the table->fts could be created in dict_load_column
when a user defined FTS_DOC_ID is present, but no
FTS */
+ fts_optimize_remove_table(table);
fts_free(table);
} else {
fts_optimize_add_table(table);
@@ -2603,14 +2604,13 @@ dict_load_table_on_id(
btr_pcur_open_on_user_rec(sys_table_ids, tuple, PAGE_CUR_GE,
BTR_SEARCH_LEAF, &pcur, &mtr);
-check_rec:
rec = btr_pcur_get_rec(&pcur);
if (page_rec_is_user_rec(rec)) {
/*---------------------------------------------------*/
/* Now we have the record in the secondary index
containing the table ID and NAME */
-
+check_rec:
field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLE_IDS__ID, &len);
ut_ad(len == 8);
@@ -2620,12 +2620,14 @@ check_rec:
if (rec_get_deleted_flag(rec, 0)) {
/* Until purge has completed, there
may be delete-marked duplicate records
- for the same SYS_TABLES.ID.
- Due to Bug #60049, some delete-marked
- records may survive the purge forever. */
- if (btr_pcur_move_to_next(&pcur, &mtr)) {
-
- goto check_rec;
+ for the same SYS_TABLES.ID, but different
+ SYS_TABLES.NAME. */
+ while (btr_pcur_move_to_next(&pcur, &mtr)) {
+ rec = btr_pcur_get_rec(&pcur);
+
+ if (page_rec_is_user_rec(rec)) {
+ goto check_rec;
+ }
}
} else {
/* Now we get the table name from the record */
@@ -2887,7 +2889,7 @@ dict_load_foreign_cols(
/***********************************************************************//**
Loads a foreign key constraint to the dictionary cache.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
dberr_t
dict_load_foreign(
/*==============*/
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index 1724ac024fa..f8ea0005665 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2015, 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.
This program is free software; you can redistribute it and/or modify it under
@@ -303,7 +303,7 @@ dict_mem_table_add_col(
/**********************************************************************//**
Renames a column of a table in the data dictionary cache. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
dict_mem_table_col_rename_low(
/*==========================*/
diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc
index 076ceb79613..7aefa6a1d4d 100644
--- a/storage/innobase/dict/dict0stats_bg.cc
+++ b/storage/innobase/dict/dict0stats_bg.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 2016, 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
@@ -527,7 +527,7 @@ extern "C" UNIV_INTERN
os_thread_ret_t
DECLARE_THREAD(dict_stats_thread)(
/*==============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
ut_a(!srv_read_only_mode);