From 90451a59811b415a443aab97230e694856392cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 6 Nov 2019 13:01:34 +0200 Subject: Follow-up to 792c9f9a4977ea428537ca34435d39bd17cec5ff 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(). --- storage/innobase/row/row0mysql.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'storage/innobase/row') 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); -- cgit v1.2.1