Commit 16b2b1ea authored by Marko Mäkelä's avatar Marko Mäkelä

Use page_is_leaf() where applicable

parent ea414622
......@@ -3241,7 +3241,7 @@ btr_page_split_and_insert(
btr_page_create(new_block, new_page_zip, cursor->index,
btr_page_get_level(page, mtr), mtr);
/* Only record the leaf level page splits. */
if (btr_page_get_level(page, mtr) == 0) {
if (page_is_leaf(page)) {
cursor->index->stat_defrag_n_page_split ++;
cursor->index->stat_defrag_modified_counter ++;
btr_defragment_save_defrag_stats_if_needed(cursor->index);
......
......@@ -233,7 +233,7 @@ btr_defragment_add_index(
return NULL;
}
if (btr_page_get_level(page, &mtr) == 0) {
if (page_is_leaf(page)) {
// Index root is a leaf page, no need to defragment.
mtr_commit(&mtr);
return NULL;
......
......@@ -1576,7 +1576,7 @@ dict_stats_analyze_index_below_cur(
page = buf_block_get_frame(block);
if (btr_page_get_level(page, mtr) == 0) {
if (page_is_leaf(page)) {
/* leaf level */
break;
}
......@@ -1620,7 +1620,7 @@ dict_stats_analyze_index_below_cur(
}
/* make sure we got a leaf page as a result from the above loop */
ut_ad(btr_page_get_level(page, &mtr) == 0);
ut_ad(page_is_leaf(page));
/* scan the leaf page and find the number of distinct keys,
when looking only at the first n_prefix columns; also estimate
......
......@@ -3277,7 +3277,7 @@ btr_page_split_and_insert(
btr_page_create(new_block, new_page_zip, cursor->index,
btr_page_get_level(page, mtr), mtr);
/* Only record the leaf level page splits. */
if (btr_page_get_level(page, mtr) == 0) {
if (page_is_leaf(page)) {
cursor->index->stat_defrag_n_page_split ++;
cursor->index->stat_defrag_modified_counter ++;
btr_defragment_save_defrag_stats_if_needed(cursor->index);
......
......@@ -233,7 +233,7 @@ btr_defragment_add_index(
return NULL;
}
if (btr_page_get_level(page, &mtr) == 0) {
if (page_is_leaf(page)) {
// Index root is a leaf page, no need to defragment.
mtr_commit(&mtr);
return NULL;
......
......@@ -1576,7 +1576,7 @@ dict_stats_analyze_index_below_cur(
page = buf_block_get_frame(block);
if (btr_page_get_level(page, mtr) == 0) {
if (page_is_leaf(page)) {
/* leaf level */
break;
}
......@@ -1620,7 +1620,7 @@ dict_stats_analyze_index_below_cur(
}
/* make sure we got a leaf page as a result from the above loop */
ut_ad(btr_page_get_level(page, &mtr) == 0);
ut_ad(page_is_leaf(page));
/* scan the leaf page and find the number of distinct keys,
when looking only at the first n_prefix columns; also estimate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment