=== modified file 'storage/innobase/dict/dict0boot.cc' --- storage/innobase/dict/dict0boot.cc 2013-06-10 20:44:22 +0000 +++ storage/innobase/dict/dict0boot.cc 2014-03-04 11:04:19 +0000 @@ -301,7 +301,8 @@ /* Insert into the dictionary cache the descriptions of the basic system tables */ /*-------------------------*/ - table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0, 0); + table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0, 0, + false); dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0); @@ -353,7 +354,8 @@ ut_a(error == DB_SUCCESS); /*-------------------------*/ - table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0, 0); + table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0, 0, + false); dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4); @@ -385,7 +387,8 @@ ut_a(error == DB_SUCCESS); /*-------------------------*/ - table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0, 0); + table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0, 0, + false); dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0); @@ -417,7 +420,8 @@ ut_a(error == DB_SUCCESS); /*-------------------------*/ - table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0, 0); + table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0, 0, + false); dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4); === modified file 'storage/innobase/dict/dict0dict.cc' --- storage/innobase/dict/dict0dict.cc 2013-12-11 14:13:33 +0000 +++ storage/innobase/dict/dict0dict.cc 2014-03-04 11:04:19 +0000 @@ -5676,7 +5676,8 @@ dict_table_t* table; /* create dummy table and index for REDUNDANT infimum and supremum */ - table = dict_mem_table_create("SYS_DUMMY1", DICT_HDR_SPACE, 1, 0, 0); + table = dict_mem_table_create("SYS_DUMMY1", DICT_HDR_SPACE, 1, 0, 0, + true); dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8); @@ -5689,7 +5690,7 @@ /* create dummy table and index for COMPACT infimum and supremum */ table = dict_mem_table_create("SYS_DUMMY2", DICT_HDR_SPACE, 1, - DICT_TF_COMPACT, 0); + DICT_TF_COMPACT, 0, true); dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8); dict_ind_compact = dict_mem_index_create("SYS_DUMMY2", "SYS_DUMMY2", === modified file 'storage/innobase/dict/dict0load.cc' --- storage/innobase/dict/dict0load.cc 2013-12-19 10:36:45 +0000 +++ storage/innobase/dict/dict0load.cc 2014-03-04 11:04:19 +0000 @@ -2174,7 +2174,8 @@ /* See if the tablespace is available. */ *table = dict_mem_table_create( - name, space, n_cols & ~DICT_N_COLS_COMPACT, flags, flags2); + name, space, n_cols & ~DICT_N_COLS_COMPACT, flags, flags2, + false); field = rec_get_nth_field_old(rec, DICT_FLD__SYS_TABLES__ID, &len); ut_ad(len == 8); /* this was checked earlier */ === modified file 'storage/innobase/dict/dict0mem.cc' --- storage/innobase/dict/dict0mem.cc 2013-12-11 14:13:33 +0000 +++ storage/innobase/dict/dict0mem.cc 2014-03-04 11:04:19 +0000 @@ -65,7 +65,10 @@ the table is placed */ ulint n_cols, /*!< in: number of columns */ ulint flags, /*!< in: table flags */ - ulint flags2) /*!< in: table flags2 */ + ulint flags2, /*!< in: table flags2 */ + bool nonshared)/*!< in: whether the table object is a dummy + one that does not need the initialization of + locking-related fields. */ { dict_table_t* table; mem_heap_t* heap; @@ -95,16 +98,27 @@ ut_d(table->magic_n = DICT_TABLE_MAGIC_N); - table->stats_latch = new rw_lock_t; - rw_lock_create(dict_table_stats_latch_key, table->stats_latch, - SYNC_INDEX_TREE); + if (!nonshared) { + table->stats_latch = new rw_lock_t; + rw_lock_create(dict_table_stats_latch_key, table->stats_latch, + SYNC_INDEX_TREE); + } else { + table->stats_latch = NULL; + } #ifndef UNIV_HOTBACKUP - table->autoinc_lock = static_cast( - mem_heap_alloc(heap, lock_get_size())); - - mutex_create(autoinc_mutex_key, - &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX); + + if (!nonshared) { + + table->autoinc_lock = static_cast( + mem_heap_alloc(heap, lock_get_size())); + + mutex_create(autoinc_mutex_key, + &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX); + } else { + + table->autoinc_lock = NULL; + } table->autoinc = 0; @@ -151,11 +165,17 @@ } } #ifndef UNIV_HOTBACKUP - mutex_free(&(table->autoinc_mutex)); + if (table->stats_latch) { + + mutex_free(&(table->autoinc_mutex)); + } #endif /* UNIV_HOTBACKUP */ - rw_lock_free(table->stats_latch); - delete table->stats_latch; + if (table->stats_latch) { + + rw_lock_free(table->stats_latch); + delete table->stats_latch; + } ut_free(table->name); mem_heap_free(table->heap); === modified file 'storage/innobase/fts/fts0fts.cc' --- storage/innobase/fts/fts0fts.cc 2013-11-14 02:16:21 +0000 +++ storage/innobase/fts/fts0fts.cc 2014-03-04 11:04:19 +0000 @@ -1950,7 +1950,7 @@ ut_ad(index->type & DICT_FTS); - new_table = dict_mem_table_create(table_name, 0, 5, 1, 0); + new_table = dict_mem_table_create(table_name, 0, 5, 1, 0, false); field = dict_index_get_nth_field(index, 0); charset = innobase_get_fts_charset( === modified file 'storage/innobase/handler/ha_innodb.cc' --- storage/innobase/handler/ha_innodb.cc 2013-12-29 11:40:21 +0000 +++ storage/innobase/handler/ha_innodb.cc 2014-03-04 11:04:19 +0000 @@ -8523,18 +8523,18 @@ /* Adjust for the FTS hidden field */ if (!has_doc_id_col) { table = dict_mem_table_create(table_name, 0, n_cols + 1, - flags, flags2); + flags, flags2, false); /* Set the hidden doc_id column. */ table->fts->doc_col = n_cols; } else { table = dict_mem_table_create(table_name, 0, n_cols, - flags, flags2); + flags, flags2, false); table->fts->doc_col = doc_id_col; } } else { table = dict_mem_table_create(table_name, 0, n_cols, - flags, flags2); + flags, flags2, false); } if (flags2 & DICT_TF2_TEMPORARY) { === modified file 'storage/innobase/handler/handler0alter.cc' --- storage/innobase/handler/handler0alter.cc 2013-12-20 05:52:30 +0000 +++ storage/innobase/handler/handler0alter.cc 2014-03-04 11:04:19 +0000 @@ -2726,7 +2726,7 @@ /* The initial space id 0 may be overridden later. */ ctx->new_table = dict_mem_table_create( - new_table_name, 0, n_cols, flags, flags2); + new_table_name, 0, n_cols, flags, flags2, false); /* The rebuilt indexed_table will use the renamed column names. */ ctx->col_names = NULL; === modified file 'storage/innobase/ibuf/ibuf0ibuf.cc' --- storage/innobase/ibuf/ibuf0ibuf.cc 2013-10-11 18:55:53 +0000 +++ storage/innobase/ibuf/ibuf0ibuf.cc 2014-03-04 11:04:19 +0000 @@ -571,7 +571,8 @@ heap = mem_heap_create(450); /* Use old-style record format for the insert buffer. */ - table = dict_mem_table_create(IBUF_TABLE_NAME, IBUF_SPACE_ID, 1, 0, 0); + table = dict_mem_table_create(IBUF_TABLE_NAME, IBUF_SPACE_ID, 1, 0, 0, + false); dict_mem_table_add_col(table, heap, "DUMMY_COLUMN", DATA_BINARY, 0, 0); @@ -1531,7 +1532,7 @@ table = dict_mem_table_create("IBUF_DUMMY", DICT_HDR_SPACE, n, - comp ? DICT_TF_COMPACT : 0, 0); + comp ? DICT_TF_COMPACT : 0, 0, true); index = dict_mem_index_create("IBUF_DUMMY", "IBUF_DUMMY", DICT_HDR_SPACE, 0, n); === modified file 'storage/innobase/include/dict0mem.h' --- storage/innobase/include/dict0mem.h 2013-12-11 14:13:33 +0000 +++ storage/innobase/include/dict0mem.h 2014-03-04 11:04:19 +0000 @@ -252,7 +252,10 @@ of the table is placed */ ulint n_cols, /*!< in: number of columns */ ulint flags, /*!< in: table flags */ - ulint flags2); /*!< in: table flags2 */ + ulint flags2, /*!< in: table flags2 */ + bool nonshared);/*!< in: whether the table object is a dummy + one that does not need the initialization of + locking-related fields. */ /****************************************************************//** Free a table memory object. */ UNIV_INTERN @@ -849,7 +852,8 @@ dict_table_t::indexes*::stat_index_size dict_table_t::indexes*::stat_n_leaf_pages (*) those are not always protected for - performance reasons */ + performance reasons. NULL for dumy table + objects. */ unsigned stat_initialized:1; /*!< TRUE if statistics have been calculated the first time after database startup or table creation */ @@ -971,10 +975,12 @@ and release it without a need to allocate space from the lock heap of the trx: otherwise the lock heap would grow rapidly - if we do a large insert from a select */ + if we do a large insert from a select. NULL + for dummy table objects. */ ib_mutex_t autoinc_mutex; /*!< mutex protecting the autoincrement - counter */ + counter. Not initialized for dummy table + objects */ ib_uint64_t autoinc;/*!< autoinc counter value to give to the next inserted row */ ulong n_waiting_or_granted_auto_inc_locks; === modified file 'storage/innobase/mtr/mtr0log.cc' --- storage/innobase/mtr/mtr0log.cc 2013-06-10 20:44:22 +0000 +++ storage/innobase/mtr/mtr0log.cc 2014-03-04 11:04:19 +0000 @@ -560,7 +560,7 @@ n = n_uniq = 1; } table = dict_mem_table_create("LOG_DUMMY", DICT_HDR_SPACE, n, - comp ? DICT_TF_COMPACT : 0, 0); + comp ? DICT_TF_COMPACT : 0, 0, true); ind = dict_mem_index_create("LOG_DUMMY", "LOG_DUMMY", DICT_HDR_SPACE, 0, n); ind->table = table; === modified file 'storage/innobase/page/page0zip.cc' --- storage/innobase/page/page0zip.cc 2014-01-08 13:55:14 +0000 +++ storage/innobase/page/page0zip.cc 2014-03-04 11:04:19 +0000 @@ -1619,7 +1619,7 @@ } table = dict_mem_table_create("ZIP_DUMMY", DICT_HDR_SPACE, n, - DICT_TF_COMPACT, 0); + DICT_TF_COMPACT, 0, true); index = dict_mem_index_create("ZIP_DUMMY", "ZIP_DUMMY", DICT_HDR_SPACE, 0, n); index->table = table; === modified file 'storage/innobase/pars/pars0pars.cc' --- storage/innobase/pars/pars0pars.cc 2013-11-11 02:55:47 +0000 +++ storage/innobase/pars/pars0pars.cc 2014-03-04 11:04:19 +0000 @@ -1997,7 +1997,7 @@ n_cols = que_node_list_get_len(column_defs); table = dict_mem_table_create( - table_sym->name, 0, n_cols, flags, flags2); + table_sym->name, 0, n_cols, flags, flags2, false); #ifdef UNIV_DEBUG if (not_fit_in_memory != NULL) {