dict_create_index_tree_step建表时cluster index创建并登记

2060阅读 0评论2013-05-03 gladness
分类:Mysql/postgreSQL

跟踪建表语句,找在数据字典中登记cluster index的page no的地方

mysql> create table seeindex ( id int auto_increment not null primary key )engine=innodb;


/***************************************************************//**

Creates an index tree for the index if it is not a member of a cluster.

@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */

static

ulint

dict_create_index_tree_step(

/*========================*/

ind_node_t* node) /*!< in: index create node */

{

dict_index_t* index;

dict_table_t* sys_indexes;

dtuple_t* search_tuple;

ulint zip_size;

btr_pcur_t pcur;

mtr_t mtr;


ut_ad(mutex_own(&(dict_sys->mutex)));


index = node->index;


sys_indexes = dict_sys->sys_indexes;


/* Run a mini-transaction in which the index tree is allocated for

the index and its root address is written to the index entry in

sys_indexes */


mtr_start(&mtr);


search_tuple = dict_create_search_tuple(node->ind_row, node->heap);


btr_pcur_open(UT_LIST_GET_FIRST(sys_indexes->indexes),

      search_tuple, PAGE_CUR_L, BTR_MODIFY_LEAF,

      &pcur, &mtr);


btr_pcur_move_to_next_user_rec(&pcur, &mtr);


zip_size = dict_table_zip_size(index->table);


node->page_no = btr_create(index->type, index->space, zip_size,

  index->id, index, &mtr);

/* printf("Created a new index tree in space %lu root page %lu\n",

index->space, index->page_no); */


page_rec_write_field(btr_pcur_get_rec(&pcur),

    DICT_SYS_INDEXES_PAGE_NO_FIELD,

    node->page_no, &mtr);

btr_pcur_close(&pcur);

mtr_commit(&mtr);


if (node->page_no == FIL_NULL) {


return(DB_OUT_OF_FILE_SPACE);

}


return(DB_SUCCESS);

}


> mysqld.exe!dict_create_index_tree_step(ind_node_struct * node=0x1fafa118)  Line 664 C
  mysqld.exe!dict_create_index_step(que_thr_struct * thr=0x1faa3460)  Line 1139 + 0x9 bytes C
  mysqld.exe!que_thr_step(que_thr_struct * thr=0x1faa3460)  Line 1257 + 0x9 bytes C
  mysqld.exe!que_run_threads_low(que_thr_struct * thr=0x1faa3460)  Line 1305 + 0x9 bytes C
  mysqld.exe!que_run_threads(que_thr_struct * thr=0x1faa3460)  Line 1342 + 0x9 bytes C
  mysqld.exe!row_create_index_for_mysql(dict_index_struct * index=0x1fa90448, trx_struct * trx=0x1fa99e20, const unsigned long * field_lengths=0x1faf8d80)  Line 2107 + 0x9 bytes C
  mysqld.exe!create_index(trx_struct * trx=0x1fa99e20, TABLE * form=0x2284cf84, unsigned long flags=1, const char * table_name=0x2284c6dc, unsigned int key_num=0)  Line 6776 + 0x11 bytes C++
  mysqld.exe!ha_innobase::create(const char * name=0x2284dbc4, TABLE * form=0x2284cf84, st_ha_create_information * create_info=0x2284ec30)  Line 7267 + 0x1f bytes C++
  mysqld.exe!handler::ha_create(const char * name=0x2284dbc4, TABLE * form=0x2284cf84, st_ha_create_information * info=0x2284ec30)  Line 3577 + 0x1e bytes C++
  mysqld.exe!ha_create_table(THD * thd=0x1fa85ce8, const char * path=0x2284dbc4, const char * db=0x1fb082e0, const char * table_name=0x1fb07ef0, st_ha_create_information * create_info=0x2284ec30, bool update_create_info=false)  Line 3784 + 0x1d bytes C++
  mysqld.exe!rea_create_table(THD * thd=0x1fa85ce8, const char * path=0x2284dbc4, const char * db=0x1fb082e0, const char * table_name=0x1fb07ef0, st_ha_create_information * create_info=0x2284ec30, List & create_fields={...}, unsigned int keys=1, st_key * key_info=0x1fb08670, handler * file=0x1fa97dd0)  Line 531 + 0x41 bytes C++
  mysqld.exe!mysql_create_table_no_lock(THD * thd=0x1fa85ce8, const char * db=0x1fb082e0, const char * table_name=0x1fb07ef0, st_ha_create_information * create_info=0x2284ec30, Alter_info * alter_info=0x2284ebd0, bool internal_tmp_table=false, unsigned int select_field_count=0, bool * is_trans=0x2284de1b)  Line 4294 + 0x38 bytes C++
  mysqld.exe!mysql_create_table(THD * thd=0x1fa85ce8, TABLE_LIST * create_table=0x1fb07f38, st_ha_create_information * create_info=0x2284ec30, Alter_info * alter_info=0x2284ebd0)  Line 4388 + 0x27 bytes C++
  mysqld.exe!mysql_execute_command(THD * thd=0x1fa85ce8)  Line 2559 + 0x1e bytes C++
  mysqld.exe!mysql_parse(THD * thd=0x1fa85ce8, char * rawbuf=0x1fb07de0, unsigned int length=81, Parser_state * parser_state=0x2284f8e8)  Line 5627 + 0x9 bytes C++
  mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x1fa85ce8, char * packet=0x1faffaf1, unsigned int packet_length=81)  Line 1037 + 0x22 bytes C++
  mysqld.exe!do_command(THD * thd=0x1fa85ce8)  Line 773 + 0x1b bytes C++
  mysqld.exe!do_handle_one_connection(THD * thd_arg=0x1fa85ce8)  Line 840 + 0x9 bytes C++
  mysqld.exe!handle_one_connection(void * arg=0x1fa85ce8)  Line 759 + 0x9 bytes C++
  mysqld.exe!pfs_spawn_thread(void * arg=0x1faf4080)  Line 1015 + 0x9 bytes C++
  mysqld.exe!pthread_start(void * p=0x1fad95e0)  Line 61 + 0x9 bytes C
  mysqld.exe!_callthreadstartex()  Line 348 + 0xf bytes C
  mysqld.exe!_threadstartex(void * ptd=0x1fb03b38)  Line 331 C
  kernel32.dll!760833aa()
  [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
  ntdll.dll!772f9ef2()
  ntdll.dll!772f9ec5()



上一篇:dict_load_index_low获得cluster index入口
下一篇:innodb转为infinidb