diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-06 13:01:34 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-06 13:01:34 +0200 |
commit | 90451a59811b415a443aab97230e694856392cb5 (patch) | |
tree | 8ea9fc387bf0241e6a3ecce79ae2d49871ce7634 /storage/innobase/row | |
parent | 8688ef22c21b810e7d5d4732a3f73035eb171879 (diff) | |
download | mariadb-git-90451a59811b415a443aab97230e694856392cb5.tar.gz |
Follow-up to 792c9f9a4977ea428537ca34435d39bd17cec5ffmariadb-10.2.29
dict_index_add_to_cache(): Make the 'index' a reference to a pointer,
so that the caller will avoid the expensive call to
dict_index_get_if_in_cache_low().
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index fe2a012c323..a5795ff90e8 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2450,20 +2450,14 @@ row_create_index_for_mysql( } else { dict_build_index_def(table, index, trx); - index_id_t index_id = index->id; - - /* add index to dictionary cache and also free index object. */ err = dict_index_add_to_cache( table, index, FIL_NULL, trx_is_strict(trx)); + ut_ad((index == NULL) == (err != DB_SUCCESS)); if (err != DB_SUCCESS) { goto error_handling; } - /* as above function has freed index object re-load it - now from dictionary cache using index_id */ - index = dict_index_get_if_in_cache_low(index_id); - ut_a(index != NULL); index->table = table; err = dict_create_index_tree_in_mem(index, trx); |