557
566
/*************************************************************************
558
567
Initializes an ibuf bitmap page. */
561
570
ibuf_bitmap_page_init(
562
571
/*==================*/
563
page_t* page, /* in: bitmap page */
564
mtr_t* mtr) /* in: mtr */
572
buf_block_t* block, /* in: bitmap page */
573
mtr_t* mtr) /* in: mtr */
567
576
ulint byte_offset;
577
ulint zip_size = buf_block_get_zip_size(block);
579
ut_a(ut_is_2pow(zip_size));
581
page = buf_block_get_frame(block);
582
fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP);
569
584
/* Write all zeros to the bitmap */
571
bit_offset = XDES_DESCRIBED_PER_PAGE * IBUF_BITS_PER_PAGE;
573
byte_offset = bit_offset / 8 + 1;
574
/* better: byte_offset = UT_BITS_IN_BYTES(bit_offset); */
576
fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP);
587
byte_offset = UT_BITS_IN_BYTES(UNIV_PAGE_SIZE
588
* IBUF_BITS_PER_PAGE);
590
byte_offset = UT_BITS_IN_BYTES(zip_size * IBUF_BITS_PER_PAGE);
578
593
memset(page + IBUF_BITMAP, 0, byte_offset);
753
794
ibuf_set_free_bits_low(
754
795
/*===================*/
755
ulint type, /* in: index type */
756
page_t* page, /* in: index page; free bit is set if the index is
757
non-clustered and page level is 0 */
758
ulint val, /* in: value to set: < 4 */
759
mtr_t* mtr) /* in: mtr */
796
ulint zip_size,/* in: compressed page size in bytes;
797
0 for uncompressed pages */
798
const buf_block_t* block, /* in: index page; free bits are set if
799
the index is non-clustered and page
801
ulint val, /* in: value to set: < 4 */
802
mtr_t* mtr) /* in/out: mtr */
761
804
page_t* bitmap_page;
763
if (type & DICT_CLUSTERED) {
768
if (btr_page_get_level_low(page) != 0) {
773
bitmap_page = ibuf_bitmap_get_map_page(
774
buf_frame_get_space_id(page),
775
buf_frame_get_page_no(page), mtr);
808
if (!page_is_leaf(buf_block_get_frame(block))) {
813
space = buf_block_get_space(block);
814
page_no = buf_block_get_page_no(block);
815
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
776
816
#ifdef UNIV_IBUF_DEBUG
779
"Setting page no %lu free bits to %lu should be %lu\n",
780
buf_frame_get_page_no(page), val,
781
ibuf_index_page_calc_free(page));
819
"Setting space %lu page %lu free bits to %lu should be %lu\n",
821
ibuf_index_page_calc_free(zip_size, block));
784
ut_a(val <= ibuf_index_page_calc_free(page));
824
ut_a(val <= ibuf_index_page_calc_free(zip_size, block));
785
825
#endif /* UNIV_IBUF_DEBUG */
786
ibuf_bitmap_page_set_bits(bitmap_page, buf_frame_get_page_no(page),
826
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
787
827
IBUF_BITMAP_FREE, val, mtr);
791
830
/****************************************************************************
793
832
mini-transaction, hence this operation does not restrict further work to only
794
833
ibuf bitmap operations, which would result if the latch to the bitmap page
800
ulint type, /* in: index type */
801
page_t* page, /* in: index page; free bit is set if the index is
802
non-clustered and page level is 0 */
803
ulint val, /* in: value to set: < 4 */
804
ulint max_val)/* in: ULINT_UNDEFINED or a maximum value which
805
the bits must have before setting; this is for
837
ibuf_set_free_bits_func(
838
/*====================*/
839
buf_block_t* block, /* in: index page of a non-clustered index;
840
free bit is reset if page level is 0 */
841
#ifdef UNIV_IBUF_DEBUG
842
ulint max_val,/* in: ULINT_UNDEFINED or a maximum
843
value which the bits must have before
844
setting; this is for debugging */
845
#endif /* UNIV_IBUF_DEBUG */
846
ulint val) /* in: value to set: < 4 */
809
850
page_t* bitmap_page;
811
if (type & DICT_CLUSTERED) {
816
if (btr_page_get_level_low(page) != 0) {
855
page = buf_block_get_frame(block);
857
if (!page_is_leaf(page)) {
823
bitmap_page = ibuf_bitmap_get_map_page(
824
buf_frame_get_space_id(page), buf_frame_get_page_no(page),
864
space = buf_block_get_space(block);
865
page_no = buf_block_get_page_no(block);
866
zip_size = buf_block_get_zip_size(block);
867
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr);
869
#ifdef UNIV_IBUF_DEBUG
827
870
if (max_val != ULINT_UNDEFINED) {
828
#ifdef UNIV_IBUF_DEBUG
831
873
old_val = ibuf_bitmap_page_get_bits(
832
bitmap_page, buf_frame_get_page_no(page),
874
bitmap_page, page_no, zip_size,
833
875
IBUF_BITMAP_FREE, &mtr);
835
877
if (old_val != max_val) {
837
879
"Ibuf: page %lu old val %lu max val %lu\n",
838
buf_frame_get_page_no(page),
880
page_get_page_no(page),
839
881
old_val, max_val);
843
885
ut_a(old_val <= max_val);
846
#ifdef UNIV_IBUF_DEBUG
848
888
fprintf(stderr, "Setting page no %lu free bits to %lu should be %lu\n",
849
buf_frame_get_page_no(page), val,
850
ibuf_index_page_calc_free(page));
889
page_get_page_no(page), val,
890
ibuf_index_page_calc_free(zip_size, block));
853
ut_a(val <= ibuf_index_page_calc_free(page));
855
ibuf_bitmap_page_set_bits(bitmap_page, buf_frame_get_page_no(page),
893
ut_a(val <= ibuf_index_page_calc_free(zip_size, block));
894
#endif /* UNIV_IBUF_DEBUG */
895
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
856
896
IBUF_BITMAP_FREE, val, &mtr);
857
897
mtr_commit(&mtr);
862
902
separate mini-transaction, hence this operation does not restrict further
863
903
work to only ibuf bitmap operations, which would result if the latch to the
864
904
bitmap page were kept. */
867
ibuf_reset_free_bits_with_type(
868
/*===========================*/
869
ulint type, /* in: index type */
870
page_t* page) /* in: index page; free bits are set to 0 if the index
871
is non-clustered and non-unique and the page level is
874
ibuf_set_free_bits(type, page, 0, ULINT_UNDEFINED);
877
/****************************************************************************
878
Resets the free bits of the page in the ibuf bitmap. This is done in a
879
separate mini-transaction, hence this operation does not restrict further
880
work to solely ibuf bitmap operations, which would result if the latch to
881
the bitmap page were kept. */
884
907
ibuf_reset_free_bits(
885
908
/*=================*/
886
dict_index_t* index, /* in: index */
887
page_t* page) /* in: index page; free bits are set to 0 if
888
the index is non-clustered and non-unique and
889
the page level is 0 */
909
buf_block_t* block) /* in: index page; free bits are set to 0
910
if the index is a non-clustered
911
non-unique, and page level is 0 */
891
ibuf_set_free_bits(index->type, page, 0, ULINT_UNDEFINED);
913
ibuf_set_free_bits(block, 0, ULINT_UNDEFINED);
894
916
/**************************************************************************
895
Updates the free bits for a page to reflect the present state. Does this
896
in the mtr given, which means that the latching order rules virtually prevent
897
any further operations for this OS thread until mtr is committed. */
917
Updates the free bits for an uncompressed page to reflect the present state.
918
Does this in the mtr given, which means that the latching order rules virtually
919
prevent any further operations for this OS thread until mtr is committed. */
900
922
ibuf_update_free_bits_low(
901
923
/*======================*/
902
dict_index_t* index, /* in: index */
903
page_t* page, /* in: index page */
904
ulint max_ins_size, /* in: value of maximum insert size
905
with reorganize before the latest
906
operation performed to the page */
907
mtr_t* mtr) /* in: mtr */
924
const buf_block_t* block, /* in: index page */
925
ulint max_ins_size, /* in: value of
927
with reorganize before
929
performed to the page */
930
mtr_t* mtr) /* in/out: mtr */
912
before = ibuf_index_page_calc_free_bits(max_ins_size);
914
after = ibuf_index_page_calc_free(page);
935
ut_a(!buf_block_get_page_zip(block));
937
before = ibuf_index_page_calc_free_bits(0, max_ins_size);
939
after = ibuf_index_page_calc_free(0, block);
941
/* This approach cannot be used on compressed pages, since the
942
computed value of "before" often does not match the current
943
state of the bitmap. This is because the free space may
944
increase or decrease when a compressed page is reorganized. */
916
945
if (before != after) {
917
ibuf_set_free_bits_low(index->type, page, after, mtr);
946
ibuf_set_free_bits_low(0, block, after, mtr);
950
/**************************************************************************
951
Updates the free bits for a compressed page to reflect the present state.
952
Does this in the mtr given, which means that the latching order rules virtually
953
prevent any further operations for this OS thread until mtr is committed. */
956
ibuf_update_free_bits_zip(
957
/*======================*/
958
buf_block_t* block, /* in/out: index page */
959
mtr_t* mtr) /* in/out: mtr */
967
space = buf_block_get_space(block);
968
page_no = buf_block_get_page_no(block);
969
zip_size = buf_block_get_zip_size(block);
971
ut_a(page_is_leaf(buf_block_get_frame(block)));
974
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
976
after = ibuf_index_page_calc_free_zip(zip_size, block);
979
/* We move the page to the front of the buffer pool LRU list:
980
the purpose of this is to prevent those pages to which we
981
cannot make inserts using the insert buffer from slipping
982
out of the buffer pool */
984
buf_page_make_young(&block->page);
987
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
988
IBUF_BITMAP_FREE, after, mtr);
921
991
/**************************************************************************
922
992
Updates the free bits for the two pages to reflect the present state. Does
923
993
this in the mtr given, which means that the latching order rules virtually
924
994
prevent any further operations until mtr is committed. */
927
997
ibuf_update_free_bits_for_two_pages_low(
928
998
/*====================================*/
929
dict_index_t* index, /* in: index */
930
page_t* page1, /* in: index page */
931
page_t* page2, /* in: index page */
999
ulint zip_size,/* in: compressed page size in bytes;
1000
0 for uncompressed pages */
1001
buf_block_t* block1, /* in: index page */
1002
buf_block_t* block2, /* in: index page */
932
1003
mtr_t* mtr) /* in: mtr */
1012
1086
/***************************************************************************
1013
1087
Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages. */
1018
1092
/* out: TRUE if level 2 or level 3 page */
1019
1093
ulint space, /* in: space id */
1094
ulint zip_size,/* in: compressed page size in bytes, or 0 */
1020
1095
ulint page_no,/* in: page number */
1021
1096
mtr_t* mtr) /* in: mtr which will contain an x-latch to the
1022
1097
bitmap page if the page is not one of the fixed
1023
1098
address ibuf pages */
1025
1100
page_t* bitmap_page;
1028
if (ibuf_fixed_addr_page(space, page_no)) {
1102
if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
1033
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, mtr);
1107
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
1035
ret = ibuf_bitmap_page_get_bits(bitmap_page, page_no, IBUF_BITMAP_IBUF,
1109
return(ibuf_bitmap_page_get_bits(bitmap_page, page_no, zip_size,
1110
IBUF_BITMAP_IBUF, mtr));
1040
1113
/************************************************************************
2774
2868
Makes an index insert to the insert buffer, instead of directly to the disk
2775
2869
page, if this is possible. Does not do insert if the index is clustered
2781
2875
/* out: TRUE if success */
2782
dtuple_t* entry, /* in: index entry to insert */
2876
const dtuple_t* entry, /* in: index entry to insert */
2783
2877
dict_index_t* index, /* in: index where to insert */
2784
2878
ulint space, /* in: space id where to insert */
2879
ulint zip_size,/* in: compressed page size in bytes, or 0 */
2785
2880
ulint page_no,/* in: page number where to insert */
2786
2881
que_thr_t* thr) /* in: query thread */
2790
2886
ut_a(trx_sys_multiple_tablespace_format);
2791
2887
ut_ad(dtuple_check_typed(entry));
2793
ut_a(!(index->type & DICT_CLUSTERED));
2795
if (rec_get_converted_size(index, entry)
2888
ut_ad(ut_is_2pow(zip_size));
2890
ut_a(!dict_index_is_clust(index));
2892
entry_size = rec_get_converted_size(index, entry, 0);
2796
2895
>= (page_get_free_space_of_empty(dict_table_is_comp(index->table))
2801
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, index, space, page_no,
2900
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, entry_size,
2901
index, space, zip_size, page_no, thr);
2803
2902
if (err == DB_FAIL) {
2804
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, index, space,
2903
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, entry_size,
2904
index, space, zip_size, page_no, thr);
2808
2907
if (err == DB_SUCCESS) {
2877
low_match = page_cur_search(page, index, entry,
2977
low_match = page_cur_search(block, index, entry,
2878
2978
PAGE_CUR_LE, &page_cur);
2880
2980
if (low_match == dtuple_get_n_fields(entry)) {
2982
page_zip_des_t* page_zip;
2881
2984
rec = page_cur_get_rec(&page_cur);
2985
block = page_cur_get_block(&page_cur);
2986
page_zip = buf_block_get_page_zip(block);
2883
btr_cur_del_unmark_for_ibuf(rec, mtr);
2988
btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
2885
rec = page_cur_tuple_insert(&page_cur, entry, index, mtr);
2888
/* If the record did not fit, reorganize */
2890
btr_page_reorganize(page, index, mtr);
2892
page_cur_search(page, index, entry,
2893
PAGE_CUR_LE, &page_cur);
2895
/* This time the record must fit */
2896
if (UNIV_UNLIKELY(!page_cur_tuple_insert(
2897
&page_cur, entry, index,
2900
ut_print_timestamp(stderr);
2903
" InnoDB: Error: Insert buffer insert"
2904
" fails; page free %lu,"
2905
" dtuple size %lu\n",
2906
(ulong) page_get_max_insert_size(
2908
(ulong) rec_get_converted_size(
2910
fputs("InnoDB: Cannot insert index record ",
2912
dtuple_print(stderr, entry);
2913
fputs("\nInnoDB: The table where"
2914
" this index record belongs\n"
2915
"InnoDB: is now probably corrupt."
2916
" Please run CHECK TABLE on\n"
2917
"InnoDB: that table.\n", stderr);
2919
bitmap_page = ibuf_bitmap_get_map_page(
2920
buf_frame_get_space_id(page),
2921
buf_frame_get_page_no(page),
2923
old_bits = ibuf_bitmap_page_get_bits(
2925
buf_frame_get_page_no(page),
2926
IBUF_BITMAP_FREE, mtr);
2928
fprintf(stderr, "InnoDB: Bitmap bits %lu\n",
2931
fputs("InnoDB: Submit a detailed bug report"
2932
" to http://bugs.mysql.com\n", stderr);
2990
rec = page_cur_tuple_insert(&page_cur, entry, index, 0, mtr);
2992
if (UNIV_LIKELY(rec != NULL)) {
2996
/* If the record did not fit, reorganize */
2998
btr_page_reorganize(block, index, mtr);
2999
page_cur_search(block, index, entry, PAGE_CUR_LE, &page_cur);
3001
/* This time the record must fit */
3003
(!page_cur_tuple_insert(&page_cur, entry, index,
3009
ut_print_timestamp(stderr);
3012
" InnoDB: Error: Insert buffer insert"
3013
" fails; page free %lu,"
3014
" dtuple size %lu\n",
3015
(ulong) page_get_max_insert_size(
3017
(ulong) rec_get_converted_size(
3019
fputs("InnoDB: Cannot insert index record ",
3021
dtuple_print(stderr, entry);
3022
fputs("\nInnoDB: The table where"
3023
" this index record belongs\n"
3024
"InnoDB: is now probably corrupt."
3025
" Please run CHECK TABLE on\n"
3026
"InnoDB: that table.\n", stderr);
3028
space = page_get_space_id(page);
3029
zip_size = buf_block_get_zip_size(block);
3030
page_no = page_get_page_no(page);
3032
bitmap_page = ibuf_bitmap_get_map_page(
3033
space, page_no, zip_size, mtr);
3034
old_bits = ibuf_bitmap_page_get_bits(
3035
bitmap_page, page_no, zip_size,
3036
IBUF_BITMAP_FREE, mtr);
3039
"InnoDB: space %lu, page %lu,"
3040
" zip_size %lu, bitmap bits %lu\n",
3041
(ulong) space, (ulong) page_no,
3042
(ulong) zip_size, (ulong) old_bits);
3044
fputs("InnoDB: Submit a detailed bug report"
3045
" to http://bugs.mysql.com\n", stderr);
3056
3168
created in the buffer pool, this function deletes its buffered entries from
3057
3169
the insert buffer; there can exist entries for such a page if the page
3058
3170
belonged to an index which subsequently was dropped. */
3061
3173
ibuf_merge_or_delete_for_page(
3062
3174
/*==========================*/
3063
page_t* page, /* in: if page has been read from disk, pointer to
3064
the page x-latched, else NULL */
3065
ulint space, /* in: space id of the index page */
3066
ulint page_no,/* in: page number of the index page */
3067
ibool update_ibuf_bitmap)/* in: normally this is set to TRUE, but if
3068
we have deleted or are deleting the tablespace, then we
3069
naturally do not want to update a non-existent bitmap
3175
buf_block_t* block, /* in: if page has been read from
3176
disk, pointer to the page x-latched,
3178
ulint space, /* in: space id of the index page */
3179
ulint page_no,/* in: page number of the index page */
3180
ulint zip_size,/* in: compressed page size in bytes,
3182
ibool update_ibuf_bitmap)/* in: normally this is set
3183
to TRUE, but if we have deleted or are
3184
deleting the tablespace, then we
3185
naturally do not want to update a
3186
non-existent bitmap page */
3072
3188
mem_heap_t* heap;
3073
3189
btr_pcur_t pcur;
3074
3190
dtuple_t* entry;
3075
3191
dtuple_t* search_tuple;
3076
3192
rec_t* ibuf_rec;
3078
3193
page_t* bitmap_page;
3079
3194
ibuf_data_t* ibuf_data;
3080
3195
ulint n_inserts;
3081
3196
#ifdef UNIV_IBUF_DEBUG
3199
page_zip_des_t* page_zip = NULL;
3084
3200
ibool tablespace_being_deleted = FALSE;
3085
3201
ibool corruption_noticed = FALSE;
3204
ut_ad(!block || buf_block_get_space(block) == space);
3205
ut_ad(!block || buf_block_get_page_no(block) == page_no);
3206
ut_ad(!block || buf_block_get_zip_size(block) == zip_size);
3088
3208
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
3093
if (ibuf_fixed_addr_page(space, page_no) || fsp_descr_page(page_no)
3094
|| trx_sys_hdr_page(space, page_no)) {
3098
if (update_ibuf_bitmap) {
3213
if (trx_sys_hdr_page(space, page_no)) {
3217
/* The following assumes that the uncompressed page size
3218
is a power-of-2 multiple of zip_size. */
3219
if (ibuf_fixed_addr_page(space, 0, page_no)
3220
|| fsp_descr_page(0, page_no)) {
3224
if (UNIV_LIKELY(update_ibuf_bitmap)) {
3225
ut_a(ut_is_2pow(zip_size));
3227
if (ibuf_fixed_addr_page(space, zip_size, page_no)
3228
|| fsp_descr_page(zip_size, page_no)) {
3099
3232
/* If the following returns FALSE, we get the counter
3100
3233
incremented, and must decrement it when we leave this
3101
3234
function. When the counter is > 0, that prevents tablespace
3104
3237
tablespace_being_deleted = fil_inc_pending_ibuf_merges(space);
3106
if (tablespace_being_deleted) {
3239
if (UNIV_UNLIKELY(tablespace_being_deleted)) {
3107
3240
/* Do not try to read the bitmap page from space;
3108
3241
just delete the ibuf records for the page */
3111
3244
update_ibuf_bitmap = FALSE;
3115
if (update_ibuf_bitmap) {
3117
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, &mtr);
3119
if (!ibuf_bitmap_page_get_bits(bitmap_page, page_no,
3120
IBUF_BITMAP_BUFFERED, &mtr)) {
3121
/* No inserts buffered for this page */
3247
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
3250
if (!ibuf_bitmap_page_get_bits(bitmap_page, page_no,
3252
IBUF_BITMAP_BUFFERED,
3254
/* No inserts buffered for this page */
3257
if (!tablespace_being_deleted) {
3258
fil_decr_pending_ibuf_merges(space);
3122
3263
mtr_commit(&mtr);
3124
if (!tablespace_being_deleted) {
3125
fil_decr_pending_ibuf_merges(space);
3266
if (ibuf_fixed_addr_page(space, zip_size, page_no)
3267
|| fsp_descr_page(zip_size, page_no)) {
3133
3272
/* Currently the insert buffer of space 0 takes care of inserts to all
3220
3361
btr_pcur_open_on_user_rec(ibuf_data->index, search_tuple, PAGE_CUR_GE,
3221
3362
BTR_MODIFY_LEAF, &pcur, &mtr);
3222
if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
3363
if (!btr_pcur_is_on_user_rec(&pcur)) {
3223
3364
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
3225
3366
goto reset_bit;
3229
ut_ad(btr_pcur_is_on_user_rec(&pcur, &mtr));
3370
ut_ad(btr_pcur_is_on_user_rec(&pcur));
3231
3372
ibuf_rec = btr_pcur_get_rec(&pcur);
3233
3374
/* Check if the entry is for this index page */
3234
3375
if (ibuf_rec_get_page_no(ibuf_rec) != page_no
3235
3376
|| ibuf_rec_get_space(ibuf_rec) != space) {
3237
page_header_reset_last_insert(page, &mtr);
3378
page_header_reset_last_insert(
3379
block->frame, page_zip, &mtr);
3239
3381
goto reset_bit;
3242
if (corruption_noticed) {
3384
if (UNIV_UNLIKELY(corruption_noticed)) {
3243
3385
fputs("InnoDB: Discarding record\n ", stderr);
3244
3386
rec_print_old(stderr, ibuf_rec);
3245
fputs("\n from the insert buffer!\n\n", stderr);
3387
fputs("\nInnoDB: from the insert buffer!\n\n", stderr);
3247
3389
/* Now we have at pcur a record which should be
3248
3390
inserted to the index page; NOTE that the call below
3249
3391
copies pointers to fields in ibuf_rec, and we must
3251
3393
insertion is finished! */
3252
3394
dict_index_t* dummy_index;
3253
3395
dulint max_trx_id = page_get_max_trx_id(
3254
buf_frame_align(ibuf_rec));
3255
page_update_max_trx_id(page, max_trx_id);
3396
page_align(ibuf_rec));
3397
page_update_max_trx_id(block, page_zip, max_trx_id);
3257
3399
entry = ibuf_build_entry_from_ibuf_rec(
3258
3400
ibuf_rec, heap, &dummy_index);
3259
3401
#ifdef UNIV_IBUF_DEBUG
3260
volume += rec_get_converted_size(dummy_index, entry)
3402
volume += rec_get_converted_size(dummy_index, entry, 0)
3261
3403
+ page_dir_calc_reserved_space(1);
3262
3404
ut_a(volume <= 4 * UNIV_PAGE_SIZE
3263
3405
/ IBUF_PAGE_SIZE_PER_FREE_SPACE);
3265
ibuf_insert_to_index_page(entry, page,
3407
ibuf_insert_to_index_page(entry, block,
3266
3408
dummy_index, &mtr);
3267
3409
ibuf_dummy_index_free(dummy_index);
3290
#ifdef UNIV_IBUF_DEBUG
3432
#ifdef UNIV_IBUF_COUNT_DEBUG
3291
3433
if (ibuf_count_get(space, page_no) > 0) {
3292
3434
/* btr_print_tree(ibuf_data->index->tree, 100);
3293
3435
ibuf_print(); */
3296
if (update_ibuf_bitmap) {
3297
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, &mtr);
3298
ibuf_bitmap_page_set_bits(bitmap_page, page_no,
3438
if (UNIV_LIKELY(update_ibuf_bitmap)) {
3439
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
3441
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
3299
3442
IBUF_BITMAP_BUFFERED, FALSE, &mtr);
3301
3444
ulint old_bits = ibuf_bitmap_page_get_bits(
3302
bitmap_page, page_no, IBUF_BITMAP_FREE, &mtr);
3303
ulint new_bits = ibuf_index_page_calc_free(page);
3445
bitmap_page, page_no, zip_size,
3446
IBUF_BITMAP_FREE, &mtr);
3447
ulint new_bits = ibuf_index_page_calc_free(
3304
3449
#if 0 /* defined UNIV_IBUF_DEBUG */
3305
3450
fprintf(stderr, "Old bits %lu new bits %lu"
3306
3451
" max size %lu\n",