Skip to content

Commit d893a97

Browse files
authored
added comments about the function flow
1 parent 41fdbc0 commit d893a97

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

mysql-5.6.26/storage/innobase/btr/btr0btr.cc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,6 +2994,15 @@ btr_insert_into_right_sibling(
29942994
return(rec);
29952995
}
29962996
/* lbh */
2997+
/* function flow
2998+
0. get cur, left, right page info
2999+
1. choose the merge page(left/right) and check the position of the inserted record
3000+
2. choose how many records to move
3001+
3. move record list to the merge page
3002+
4. insert one record
3003+
5. update father node pointer
3004+
6. update bitmap
3005+
*/
29973006

29983007
/*@return inserted record */
29993008
static
@@ -3488,7 +3497,7 @@ btr_page_redistribute_before_split(
34883497
}
34893498

34903499

3491-
//6. readjust father cursor of merge block and cur block
3500+
//6. readjust father cursor of merge block and cur block since the first record changed
34923501
ibool compressed;
34933502
dberr_t err;
34943503
level = btr_page_get_level(page, mtr);
@@ -3537,17 +3546,13 @@ btr_page_redistribute_before_split(
35373546
flags, cursor->index, level + 1, node_ptr, mtr);
35383547

35393548
}
3540-
//logging
3549+
//for debug mode: logging
35413550
ut_ad(btr_check_node_ptr(index, left_page_block, mtr));
35423551
ut_ad(btr_check_node_ptr(index, right_page_block, mtr));
35433552
ut_ad(btr_check_node_ptr(index, block, mtr));
35443553

35453554

3546-
3547-
3548-
35493555
//7. update insert buffer bitmap
3550-
35513556
if (!dict_index_is_clust(cursor->index) && page_is_leaf(merge_page)) {
35523557
/* Update the free bits of the B-tree page in the
35533558
insert buffer bitmap. This has to be done in a

0 commit comments

Comments
 (0)