row_ins_index_entry_low函数的注释

397阅读 0评论2012-12-17 gladness
分类:Mysql/postgreSQL

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

Tries to insert an index entry to an index. If the index is clustered

and a record with the same unique key is found, the other record is

necessarily marked deleted by a committed transaction, or a unique key

violation error occurs. The delete marked record is then updated to an

existing record, and we must write an undo log record on the delete

marked record. If the index is secondary, and a record with exactly the

same fields is found, the other record is necessarily marked deleted.

It is then unmarked. Otherwise, the entry is just inserted to the index.

@return DB_SUCCESS, DB_LOCK_WAIT, DB_FAIL if pessimistic retry needed,

or error code */

static

ulint

row_ins_index_entry_low(

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

ulint mode, /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE,

depending on whether we wish optimistic or

pessimistic descent down the index tree */

dict_index_t* index, /*!< in: index */

dtuple_t* entry, /*!< in/out: index entry to insert */

ulint n_ext, /*!< in: number of externally stored columns */

que_thr_t* thr) /*!< in: query thread */

{


插入索引项时,如果有已经标记为删除并且提交的同值索引项,则把该索引项更新为存在的索引项(非删除的)。


> mysqld.exe!row_ins_index_entry_low(unsigned long mode=2, dict_index_struct * index=0x1faad780, dtuple_struct * entry=0x1fb2ffa8, unsigned long n_ext=0, que_thr_struct * thr=0x1fb2f760)  Line 1984 C
  mysqld.exe!row_ins_index_entry(dict_index_struct * index=0x1faad780, dtuple_struct * entry=0x1fb2ffa8, unsigned long n_ext=0, unsigned long foreign=1, que_thr_struct * thr=0x1fb2f760)  Line 2255 + 0x17 bytes C
  mysqld.exe!row_ins_index_entry_step(ins_node_struct * node=0x1fb2f578, que_thr_struct * thr=0x1fb2f760)  Line 2339 + 0x1b bytes C
  mysqld.exe!row_ins(ins_node_struct * node=0x1fb2f578, que_thr_struct * thr=0x1fb2f760)  Line 2471 + 0xd bytes C
  mysqld.exe!row_ins_step(que_thr_struct * thr=0x1fb2f760)  Line 2588 + 0xd bytes C
  mysqld.exe!row_insert_for_mysql(unsigned char * mysql_rec=0x1fb2ece8, row_prebuilt_struct * prebuilt=0x1fb2f138)  Line 1245 + 0x9 bytes C
  mysqld.exe!ha_innobase::write_row(unsigned char * record=0x1fb2ece8)  Line 5231 + 0x13 bytes C++
  mysqld.exe!handler::ha_write_row(unsigned char * buf=0x1fb2ece8)  Line 5153 + 0x16 bytes C++
  mysqld.exe!write_record(THD * thd=0x1faa4d30, TABLE * table=0x1fb2cc18, st_copy_info * info=0x22d2dad4)  Line 1734 + 0x12 bytes C++
  mysqld.exe!mysql_insert(THD * thd=0x1faa4d30, TABLE_LIST * table_list=0x1fb27ea0, List & fields={...}, List > & values_list={...}, List & update_fields={...}, List & update_values={...}, enum_duplicates duplic=DUP_ERROR, bool ignore=false)  Line 931 + 0x11 bytes C++
  mysqld.exe!mysql_execute_command(THD * thd=0x1faa4d30)  Line 2915 + 0x48 bytes C++
  mysqld.exe!mysql_parse(THD * thd=0x1faa4d30, char * rawbuf=0x1fb27db0, unsigned int length=42, Parser_state * parser_state=0x22d2f61c)  Line 5627 + 0x9 bytes C++
  mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x1faa4d30, char * packet=0x1fb1fac1, unsigned int packet_length=42)  Line 1037 + 0x22 bytes C++
  mysqld.exe!do_command(THD * thd=0x1faa4d30)  Line 773 + 0x1b bytes C++
  mysqld.exe!do_handle_one_connection(THD * thd_arg=0x1faa4d30)  Line 840 + 0x9 bytes C++
  mysqld.exe!handle_one_connection(void * arg=0x1faa4d30)  Line 759 + 0x9 bytes C++
  mysqld.exe!pfs_spawn_thread(void * arg=0x1faf4d90)  Line 1015 + 0x9 bytes C++
  mysqld.exe!pthread_start(void * p=0x1fb11058)  Line 61 + 0x9 bytes C
  mysqld.exe!_callthreadstartex()  Line 348 + 0xf bytes C
  mysqld.exe!_threadstartex(void * ptd=0x1fb23b08)  Line 331 C
  kernel32.dll!749c33aa()
  [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
  ntdll.dll!77359ef2()
  ntdll.dll!77359ec5()

上一篇:mysql保存锁的两个双向链表
下一篇:innodb buffer pool中的page hash表