diff options
Diffstat (limited to 'storage/innobase/dict/dict0load.cc')
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 60ae683d3ab..27583f87cfd 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -199,89 +199,6 @@ name_of_col_is( #endif /* UNIV_DEBUG */ /********************************************************************//** -Finds the first table name in the given database. -@return own: table name, NULL if does not exist; the caller must free -the memory in the string! */ -char* -dict_get_first_table_name_in_db( -/*============================*/ - const char* name) /*!< in: database name which ends in '/' */ -{ - dict_table_t* sys_tables; - btr_pcur_t pcur; - dict_index_t* sys_index; - dtuple_t* tuple; - mem_heap_t* heap; - dfield_t* dfield; - const rec_t* rec; - const byte* field; - ulint len; - mtr_t mtr; - - dict_sys.assert_locked(); - - heap = mem_heap_create(1000); - - mtr_start(&mtr); - - sys_tables = dict_table_get_low("SYS_TABLES"); - sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); - ut_ad(!dict_table_is_comp(sys_tables)); - - tuple = dtuple_create(heap, 1); - dfield = dtuple_get_nth_field(tuple, 0); - - dfield_set_data(dfield, name, strlen(name)); - dict_index_copy_types(tuple, sys_index, 1); - - btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, - BTR_SEARCH_LEAF, &pcur, &mtr); -loop: - rec = btr_pcur_get_rec(&pcur); - - if (!btr_pcur_is_on_user_rec(&pcur)) { - /* Not found */ - - btr_pcur_close(&pcur); - mtr_commit(&mtr); - mem_heap_free(heap); - - return(NULL); - } - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLES__NAME, &len); - - if (len < strlen(name) - || memcmp(name, field, strlen(name))) { - /* Not found */ - - btr_pcur_close(&pcur); - mtr_commit(&mtr); - mem_heap_free(heap); - - return(NULL); - } - - if (!rec_get_deleted_flag(rec, 0)) { - - /* We found one */ - - char* table_name = mem_strdupl((char*) field, len); - - btr_pcur_close(&pcur); - mtr_commit(&mtr); - mem_heap_free(heap); - - return(table_name); - } - - btr_pcur_move_to_next_user_rec(&pcur, &mtr); - - goto loop; -} - -/********************************************************************//** This function gets the next system table record as it scans the table. @return the next record if found, NULL if end of scan */ static |