566
557
/*************************************************************************
567
558
Initializes an ibuf bitmap page. */
570
561
ibuf_bitmap_page_init(
571
562
/*==================*/
572
buf_block_t* block, /* in: bitmap page */
573
mtr_t* mtr) /* in: mtr */
563
page_t* page, /* in: bitmap page */
564
mtr_t* mtr) /* in: mtr */
576
567
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);
569
/* 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); */
582
576
fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP);
584
/* Write all zeros to the 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);
593
578
memset(page + IBUF_BITMAP, 0, byte_offset);
595
580
/* The remaining area (up to the page trailer) is uninitialized. */
794
753
ibuf_set_free_bits_low(
795
754
/*===================*/
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 */
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 */
804
761
page_t* bitmap_page;
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);
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);
816
776
#ifdef UNIV_IBUF_DEBUG
819
"Setting space %lu page %lu free bits to %lu should be %lu\n",
821
ibuf_index_page_calc_free(zip_size, block));
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));
824
ut_a(val <= ibuf_index_page_calc_free(zip_size, block));
784
ut_a(val <= ibuf_index_page_calc_free(page));
825
785
#endif /* UNIV_IBUF_DEBUG */
826
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
786
ibuf_bitmap_page_set_bits(bitmap_page, buf_frame_get_page_no(page),
827
787
IBUF_BITMAP_FREE, val, mtr);
830
791
/****************************************************************************
832
793
mini-transaction, hence this operation does not restrict further work to only
833
794
ibuf bitmap operations, which would result if the latch to the bitmap page
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 */
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
850
809
page_t* bitmap_page;
855
page = buf_block_get_frame(block);
857
if (!page_is_leaf(page)) {
811
if (type & DICT_CLUSTERED) {
816
if (btr_page_get_level_low(page) != 0) {
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);
823
bitmap_page = ibuf_bitmap_get_map_page(
824
buf_frame_get_space_id(page), buf_frame_get_page_no(page),
869
#ifdef UNIV_IBUF_DEBUG
870
827
if (max_val != ULINT_UNDEFINED) {
828
#ifdef UNIV_IBUF_DEBUG
873
831
old_val = ibuf_bitmap_page_get_bits(
874
bitmap_page, page_no, zip_size,
832
bitmap_page, buf_frame_get_page_no(page),
875
833
IBUF_BITMAP_FREE, &mtr);
877
835
if (old_val != max_val) {
879
837
"Ibuf: page %lu old val %lu max val %lu\n",
880
page_get_page_no(page),
838
buf_frame_get_page_no(page),
881
839
old_val, max_val);
885
843
ut_a(old_val <= max_val);
846
#ifdef UNIV_IBUF_DEBUG
888
848
fprintf(stderr, "Setting page no %lu free bits to %lu should be %lu\n",
889
page_get_page_no(page), val,
890
ibuf_index_page_calc_free(zip_size, block));
849
buf_frame_get_page_no(page), val,
850
ibuf_index_page_calc_free(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,
853
ut_a(val <= ibuf_index_page_calc_free(page));
855
ibuf_bitmap_page_set_bits(bitmap_page, buf_frame_get_page_no(page),
896
856
IBUF_BITMAP_FREE, val, &mtr);
897
857
mtr_commit(&mtr);
902
862
separate mini-transaction, hence this operation does not restrict further
903
863
work to only ibuf bitmap operations, which would result if the latch to the
904
864
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. */
907
884
ibuf_reset_free_bits(
908
885
/*=================*/
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 */
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 */
913
ibuf_set_free_bits(block, 0, ULINT_UNDEFINED);
891
ibuf_set_free_bits(index->type, page, 0, ULINT_UNDEFINED);
916
894
/**************************************************************************
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. */
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. */
922
900
ibuf_update_free_bits_low(
923
901
/*======================*/
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 */
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 */
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. */
912
before = ibuf_index_page_calc_free_bits(max_ins_size);
914
after = ibuf_index_page_calc_free(page);
945
916
if (before != after) {
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);
917
ibuf_set_free_bits_low(index->type, page, after, mtr);
991
921
/**************************************************************************
992
922
Updates the free bits for the two pages to reflect the present state. Does
993
923
this in the mtr given, which means that the latching order rules virtually
994
924
prevent any further operations until mtr is committed. */
997
927
ibuf_update_free_bits_for_two_pages_low(
998
928
/*====================================*/
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 */
929
dict_index_t* index, /* in: index */
930
page_t* page1, /* in: index page */
931
page_t* page2, /* in: index page */
1003
932
mtr_t* mtr) /* in: mtr */
1086
1012
/***************************************************************************
1087
1013
Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages. */
1092
1018
/* out: TRUE if level 2 or level 3 page */
1093
1019
ulint space, /* in: space id */
1094
ulint zip_size,/* in: compressed page size in bytes, or 0 */
1095
1020
ulint page_no,/* in: page number */
1096
1021
mtr_t* mtr) /* in: mtr which will contain an x-latch to the
1097
1022
bitmap page if the page is not one of the fixed
1098
1023
address ibuf pages */
1100
1025
page_t* bitmap_page;
1102
if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
1028
if (ibuf_fixed_addr_page(space, page_no)) {
1107
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
1033
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, mtr);
1109
return(ibuf_bitmap_page_get_bits(bitmap_page, page_no, zip_size,
1110
IBUF_BITMAP_IBUF, mtr));
1035
ret = ibuf_bitmap_page_get_bits(bitmap_page, page_no, IBUF_BITMAP_IBUF,
1113
1040
/************************************************************************
2868
2774
Makes an index insert to the insert buffer, instead of directly to the disk
2869
2775
page, if this is possible. Does not do insert if the index is clustered
2875
2781
/* out: TRUE if success */
2876
const dtuple_t* entry, /* in: index entry to insert */
2782
dtuple_t* entry, /* in: index entry to insert */
2877
2783
dict_index_t* index, /* in: index where to insert */
2878
2784
ulint space, /* in: space id where to insert */
2879
ulint zip_size,/* in: compressed page size in bytes, or 0 */
2880
2785
ulint page_no,/* in: page number where to insert */
2881
2786
que_thr_t* thr) /* in: query thread */
2886
2790
ut_a(trx_sys_multiple_tablespace_format);
2887
2791
ut_ad(dtuple_check_typed(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);
2793
ut_a(!(index->type & DICT_CLUSTERED));
2795
if (rec_get_converted_size(index, entry)
2895
2796
>= (page_get_free_space_of_empty(dict_table_is_comp(index->table))
2900
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, entry_size,
2901
index, space, zip_size, page_no, thr);
2801
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, index, space, page_no,
2902
2803
if (err == DB_FAIL) {
2903
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, entry_size,
2904
index, space, zip_size, page_no, thr);
2804
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, index, space,
2907
2808
if (err == DB_SUCCESS) {
2977
low_match = page_cur_search(block, index, entry,
2877
low_match = page_cur_search(page, index, entry,
2978
2878
PAGE_CUR_LE, &page_cur);
2980
2880
if (low_match == dtuple_get_n_fields(entry)) {
2982
page_zip_des_t* page_zip;
2984
2881
rec = page_cur_get_rec(&page_cur);
2985
block = page_cur_get_block(&page_cur);
2986
page_zip = buf_block_get_page_zip(block);
2988
btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
2883
btr_cur_del_unmark_for_ibuf(rec, mtr);
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);
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);
3168
3056
created in the buffer pool, this function deletes its buffered entries from
3169
3057
the insert buffer; there can exist entries for such a page if the page
3170
3058
belonged to an index which subsequently was dropped. */
3173
3061
ibuf_merge_or_delete_for_page(
3174
3062
/*==========================*/
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 */
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
3188
3072
mem_heap_t* heap;
3189
3073
btr_pcur_t pcur;
3190
3074
dtuple_t* entry;
3191
3075
dtuple_t* search_tuple;
3192
3076
rec_t* ibuf_rec;
3193
3078
page_t* bitmap_page;
3194
3079
ibuf_data_t* ibuf_data;
3195
3080
ulint n_inserts;
3196
3081
#ifdef UNIV_IBUF_DEBUG
3199
page_zip_des_t* page_zip = NULL;
3200
3084
ibool tablespace_being_deleted = FALSE;
3201
3085
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);
3208
3088
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
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)) {
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) {
3232
3099
/* If the following returns FALSE, we get the counter
3233
3100
incremented, and must decrement it when we leave this
3234
3101
function. When the counter is > 0, that prevents tablespace
3237
3104
tablespace_being_deleted = fil_inc_pending_ibuf_merges(space);
3239
if (UNIV_UNLIKELY(tablespace_being_deleted)) {
3106
if (tablespace_being_deleted) {
3240
3107
/* Do not try to read the bitmap page from space;
3241
3108
just delete the ibuf records for the page */
3244
3111
update_ibuf_bitmap = FALSE;
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);
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 */
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)) {
3272
3133
/* Currently the insert buffer of space 0 takes care of inserts to all
3361
3220
btr_pcur_open_on_user_rec(ibuf_data->index, search_tuple, PAGE_CUR_GE,
3362
3221
BTR_MODIFY_LEAF, &pcur, &mtr);
3363
if (!btr_pcur_is_on_user_rec(&pcur)) {
3222
if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
3364
3223
ut_ad(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
3366
3225
goto reset_bit;
3370
ut_ad(btr_pcur_is_on_user_rec(&pcur));
3229
ut_ad(btr_pcur_is_on_user_rec(&pcur, &mtr));
3372
3231
ibuf_rec = btr_pcur_get_rec(&pcur);
3374
3233
/* Check if the entry is for this index page */
3375
3234
if (ibuf_rec_get_page_no(ibuf_rec) != page_no
3376
3235
|| ibuf_rec_get_space(ibuf_rec) != space) {
3378
page_header_reset_last_insert(
3379
block->frame, page_zip, &mtr);
3237
page_header_reset_last_insert(page, &mtr);
3381
3239
goto reset_bit;
3384
if (UNIV_UNLIKELY(corruption_noticed)) {
3242
if (corruption_noticed) {
3385
3243
fputs("InnoDB: Discarding record\n ", stderr);
3386
3244
rec_print_old(stderr, ibuf_rec);
3387
fputs("\nInnoDB: from the insert buffer!\n\n", stderr);
3245
fputs("\n from the insert buffer!\n\n", stderr);
3389
3247
/* Now we have at pcur a record which should be
3390
3248
inserted to the index page; NOTE that the call below
3391
3249
copies pointers to fields in ibuf_rec, and we must
3393
3251
insertion is finished! */
3394
3252
dict_index_t* dummy_index;
3395
3253
dulint max_trx_id = page_get_max_trx_id(
3396
page_align(ibuf_rec));
3397
page_update_max_trx_id(block, page_zip, max_trx_id);
3254
buf_frame_align(ibuf_rec));
3255
page_update_max_trx_id(page, max_trx_id);
3399
3257
entry = ibuf_build_entry_from_ibuf_rec(
3400
3258
ibuf_rec, heap, &dummy_index);
3401
3259
#ifdef UNIV_IBUF_DEBUG
3402
volume += rec_get_converted_size(dummy_index, entry, 0)
3260
volume += rec_get_converted_size(dummy_index, entry)
3403
3261
+ page_dir_calc_reserved_space(1);
3404
3262
ut_a(volume <= 4 * UNIV_PAGE_SIZE
3405
3263
/ IBUF_PAGE_SIZE_PER_FREE_SPACE);
3407
ibuf_insert_to_index_page(entry, block,
3265
ibuf_insert_to_index_page(entry, page,
3408
3266
dummy_index, &mtr);
3409
3267
ibuf_dummy_index_free(dummy_index);
3432
#ifdef UNIV_IBUF_COUNT_DEBUG
3290
#ifdef UNIV_IBUF_DEBUG
3433
3291
if (ibuf_count_get(space, page_no) > 0) {
3434
3292
/* btr_print_tree(ibuf_data->index->tree, 100);
3435
3293
ibuf_print(); */
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,
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,
3442
3299
IBUF_BITMAP_BUFFERED, FALSE, &mtr);
3444
3301
ulint old_bits = ibuf_bitmap_page_get_bits(
3445
bitmap_page, page_no, zip_size,
3446
IBUF_BITMAP_FREE, &mtr);
3447
ulint new_bits = ibuf_index_page_calc_free(
3302
bitmap_page, page_no, IBUF_BITMAP_FREE, &mtr);
3303
ulint new_bits = ibuf_index_page_calc_free(page);
3449
3304
#if 0 /* defined UNIV_IBUF_DEBUG */
3450
3305
fprintf(stderr, "Old bits %lu new bits %lu"
3451
3306
" max size %lu\n",