From: kevin.lewis Date: December 9 2010 5:08pm Subject: bzr push into mysql-trunk-innodb branch (kevin.lewis:3371 to 3372) List-Archive: http://lists.mysql.com/commits/126464 Message-Id: <20101209170808.EC07E876679@kevin-lewis-macbook.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3372 kevin.lewis@stripped 2010-12-09 [merge] merge from mysql-5.5-innodb to mysql-trunk-innodb modified: storage/innobase/dict/dict0load.c 3371 Sunny Bains 2010-12-09 Fix Bug #58746 - lock_number_of_rows_locked() is not thread safe lock_number_of_rows_locked() was not thread safe. Fix is to tighten up the rules of trx_print() and change the code from where lock_number_of_rows_locked() is called. The main change is in trx0i_s.c and clarifying the access rules for trx_t::lock::trx_locks. rb://534 Approved by Jimmy Yang. modified: storage/innobase/dict/dict0dict.c storage/innobase/include/lock0lock.h storage/innobase/include/trx0trx.h storage/innobase/lock/lock0lock.c storage/innobase/trx/trx0i_s.c storage/innobase/trx/trx0trx.c === modified file 'storage/innobase/dict/dict0load.c' --- a/storage/innobase/dict/dict0load.c revid:sunny.bains@stripped +++ b/storage/innobase/dict/dict0load.c revid:kevin.lewis@stripped @@ -442,7 +442,7 @@ dict_process_sys_fields_rec( /********************************************************************//** This function parses a SYS_FOREIGN record and populate a dict_foreign_t structure with the information from the record. For detail information -about SYS_FOREIGN fields, please refer to dict_load_foreign() function +about SYS_FOREIGN fields, please refer to dict_load_foreign() function. @return error message, or NULL on success */ UNIV_INTERN const char* @@ -470,6 +470,11 @@ dict_process_sys_foreign_rec( err_len: return("incorrect column length in SYS_FOREIGN"); } + + /* This recieves a dict_foreign_t* that points to a stack variable. + So mem_heap_free(foreign->heap) is not used as elsewhere. + Since the heap used here is freed elsewhere, foreign->heap + is not assigned. */ foreign->id = mem_heap_strdupl(heap, (const char*) field, len); rec_get_nth_field_offs_old(rec, 1/*DB_TRX_ID*/, &len); @@ -481,22 +486,22 @@ err_len: goto err_len; } + /* The _lookup versions of the referenced and foreign table names + are not assigned since they are not used in this dict_foreign_t */ + field = rec_get_nth_field_old(rec, 3/*FOR_NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } foreign->foreign_table_name = mem_heap_strdupl( heap, (const char*) field, len); - dict_mem_foreign_table_name_lookup_set(foreign, TRUE); field = rec_get_nth_field_old(rec, 4/*REF_NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } - foreign->referenced_table_name = mem_heap_strdupl( heap, (const char*) field, len); - dict_mem_referenced_table_name_lookup_set(foreign, TRUE); field = rec_get_nth_field_old(rec, 5/*N_COLS*/, &len); if (UNIV_UNLIKELY(len != 4)) { No bundle (reason: useless for push emails).