diff options
author | unknown <aivanov@mysql.com> | 2005-12-06 22:02:40 +0300 |
---|---|---|
committer | unknown <aivanov@mysql.com> | 2005-12-06 22:02:40 +0300 |
commit | b83c29766c916c67194c56d12f0b4542402e1e85 (patch) | |
tree | 12215ce7c080a1a2ab6d1de62d6cb0dd7957a223 /innobase/include | |
parent | c9bf8e28a86c6eec53bb20d657e667c5fe1dbe88 (diff) | |
download | mariadb-git-b83c29766c916c67194c56d12f0b4542402e1e85.tar.gz |
Fix BUG#14747: "Race condition can cause btr_search_drop_page_hash_index()
to crash".
Changes from snapshot innodb-5.0-ss52.
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
Also fix 13778. When FOREIGN_KEY_CHECKS=0 we still need to check that
datatypes between foreign key references are compatible.
Also added test cases to 9802.
innobase/btr/btr0sea.c:
Changes from innodb-5.0-ss52
innobase/dict/dict0dict.c:
Changes from innodb-5.0-ss52
innobase/dict/dict0load.c:
Changes from innodb-5.0-ss52
innobase/include/buf0buf.h:
Changes from innodb-5.0-ss52
innobase/include/dict0dict.h:
Changes from innodb-5.0-ss52
innobase/include/dict0load.h:
Changes from innodb-5.0-ss52
innobase/include/rem0cmp.h:
Changes from innodb-5.0-ss52
innobase/rem/rem0cmp.c:
Changes from innodb-5.0-ss52
innobase/row/row0mysql.c:
Changes from innodb-5.0-ss52
mysql-test/r/innodb.result:
Changes from innodb-5.0-ss52
mysql-test/t/innodb.test:
Changes from innodb-5.0-ss52
sql/ha_innodb.cc:
Changes from innodb-5.0-ss52
sql/ha_innodb.h:
Changes from innodb-5.0-ss52
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/buf0buf.h | 10 | ||||
-rw-r--r-- | innobase/include/dict0dict.h | 3 | ||||
-rw-r--r-- | innobase/include/dict0load.h | 3 | ||||
-rw-r--r-- | innobase/include/rem0cmp.h | 3 |
4 files changed, 13 insertions, 6 deletions
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index ae8d0411c12..24e7a71c02d 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -745,8 +745,6 @@ struct buf_block_struct{ buffer pool which are index pages, but this flag is not set because we do not keep track of all pages */ - dict_index_t* index; /* index for which the adaptive - hash index has been created */ /* 2. Page flushing fields */ UT_LIST_NODE_T(buf_block_t) flush_list; @@ -833,7 +831,7 @@ struct buf_block_struct{ records with the same prefix should be indexed in the hash index */ - /* The following 4 fields are protected by btr_search_latch: */ + /* The following 6 fields are protected by btr_search_latch: */ ibool is_hashed; /* TRUE if hash index has already been built on this page; note that it does @@ -850,6 +848,12 @@ struct buf_block_struct{ ulint curr_side; /* BTR_SEARCH_LEFT_SIDE or BTR_SEARCH_RIGHT_SIDE in hash indexing */ + dict_index_t* index; /* Index for which the adaptive + hash index has been created. + This field may only be modified + while holding an s-latch or x-latch + on block->lock and an x-latch on + btr_search_latch. */ /* 6. Debug fields */ #ifdef UNIV_SYNC_DEBUG rw_lock_t debug_latch; /* in the debug version, each thread diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 5215d51cabe..4396611e529 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -197,7 +197,8 @@ dict_foreign_add_to_cache( /*======================*/ /* out: DB_SUCCESS or error code */ dict_foreign_t* foreign, /* in, own: foreign key constraint */ - ibool check_types); /* in: TRUE=check type compatibility */ + ibool check_charsets);/* in: TRUE=check charset + compatibility */ /************************************************************************* Checks if a table is referenced by foreign keys. */ diff --git a/innobase/include/dict0load.h b/innobase/include/dict0load.h index f13620bc6e8..741123614ab 100644 --- a/innobase/include/dict0load.h +++ b/innobase/include/dict0load.h @@ -82,7 +82,8 @@ dict_load_foreigns( /*===============*/ /* out: DB_SUCCESS or error code */ const char* table_name, /* in: table name */ - ibool check_types); /* in: TRUE=check type compatibility */ + ibool check_charsets);/* in: TRUE=check charsets + compatibility */ /************************************************************************ Prints to the standard output information on all tables found in the data dictionary system table. */ diff --git a/innobase/include/rem0cmp.h b/innobase/include/rem0cmp.h index 1b1ee26b809..f6762078cbc 100644 --- a/innobase/include/rem0cmp.h +++ b/innobase/include/rem0cmp.h @@ -24,7 +24,8 @@ cmp_types_are_equal( /* out: TRUE if the types are considered equal in comparisons */ dtype_t* type1, /* in: type 1 */ - dtype_t* type2); /* in: type 2 */ + dtype_t* type2, /* in: type 2 */ + ibool check_charsets); /* in: whether to check charsets */ /***************************************************************** This function is used to compare two data fields for which we know the data type. */ |