~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-proposed

« back to all changes in this revision

Viewing changes to storage/innobase/ibuf/ibuf0ibuf.c

  • Committer: Package Import Robot
  • Author(s): Dave Chiluk, Eduardo Damato
  • Date: 2014-01-09 09:44:14 UTC
  • mfrom: (18.1.5 precise-security)
  • Revision ID: package-import@ubuntu.com-20140109094414-ght3gi7yvzsyvhm5
Tags: 5.5.34-0ubuntu0.12.04.2
[ Eduardo Damato ]
Fix upstart script to account for datadir disk shortage (LP: #1121874) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include "log0recv.h"
57
57
#include "que0que.h"
58
58
#include "srv0start.h" /* srv_shutdown_state */
 
59
#include "rem0cmp.h"
59
60
 
60
61
/*      STRUCTURE OF AN INSERT BUFFER RECORD
61
62
 
3824
3825
 
3825
3826
/********************************************************************//**
3826
3827
During merge, inserts to an index page a secondary index entry extracted
3827
 
from the insert buffer. */
 
3828
from the insert buffer.
 
3829
@return newly inserted record */
3828
3830
static
3829
 
void
 
3831
rec_t*
3830
3832
ibuf_insert_to_index_page_low(
3831
3833
/*==========================*/
 
3834
                                /* out: newly inserted record */
3832
3835
        const dtuple_t* entry,  /*!< in: buffered entry to insert */
3833
3836
        buf_block_t*    block,  /*!< in/out: index page where the buffered
3834
3837
                                entry should be placed */
3843
3846
        ulint           zip_size;
3844
3847
        const page_t*   bitmap_page;
3845
3848
        ulint           old_bits;
 
3849
        rec_t*          rec;
 
3850
        DBUG_ENTER("ibuf_insert_to_index_page_low");
3846
3851
 
3847
 
        if (UNIV_LIKELY
3848
 
            (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
3849
 
                return;
 
3852
        rec = page_cur_tuple_insert(page_cur, entry, index, 0, mtr);
 
3853
        if (rec != NULL) {
 
3854
                DBUG_RETURN(rec);
3850
3855
        }
3851
3856
 
3852
3857
        /* If the record did not fit, reorganize */
3856
3861
 
3857
3862
        /* This time the record must fit */
3858
3863
 
3859
 
        if (UNIV_LIKELY
3860
 
            (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
3861
 
                return;
 
3864
        rec = page_cur_tuple_insert(page_cur, entry, index, 0, mtr);
 
3865
        if (rec != NULL) {
 
3866
                DBUG_RETURN(rec);
3862
3867
        }
3863
3868
 
3864
3869
        page = buf_block_get_frame(block);
3892
3897
        fputs("InnoDB: Submit a detailed bug report"
3893
3898
              " to http://bugs.mysql.com\n", stderr);
3894
3899
        ut_ad(0);
 
3900
        DBUG_RETURN(NULL);
3895
3901
}
3896
3902
 
3897
3903
/************************************************************************
3911
3917
        ulint           low_match;
3912
3918
        page_t*         page            = buf_block_get_frame(block);
3913
3919
        rec_t*          rec;
 
3920
        DBUG_ENTER("ibuf_insert_to_index_page");
3914
3921
 
3915
3922
        ut_ad(ibuf_inside(mtr));
3916
3923
        ut_ad(dtuple_check_typed(entry));
3955
3962
                      "InnoDB: Submit a detailed bug report to"
3956
3963
                      " http://bugs.mysql.com!\n", stderr);
3957
3964
 
3958
 
                return;
 
3965
                DBUG_VOID_RETURN;
3959
3966
        }
3960
3967
 
3961
3968
        low_match = page_cur_search(block, index, entry,
3990
3997
                                rec, page_zip, FALSE, mtr);
3991
3998
updated_in_place:
3992
3999
                        mem_heap_free(heap);
3993
 
                        return;
 
4000
                        DBUG_VOID_RETURN;
3994
4001
                }
3995
4002
 
3996
4003
                /* Copy the info bits. Clear the delete-mark. */
4034
4041
                lock_rec_store_on_page_infimum(block, rec);
4035
4042
                page_cur_delete_rec(&page_cur, index, offsets, mtr);
4036
4043
                page_cur_move_to_prev(&page_cur);
 
4044
 
 
4045
                rec = ibuf_insert_to_index_page_low(entry, block, index, mtr,
 
4046
                                                    &page_cur);
 
4047
                ut_ad(!cmp_dtuple_rec(entry, rec,
 
4048
                                      rec_get_offsets(rec, index, NULL,
 
4049
                                                      ULINT_UNDEFINED,
 
4050
                                                      &heap)));
4037
4051
                mem_heap_free(heap);
4038
4052
 
4039
 
                ibuf_insert_to_index_page_low(entry, block, index, mtr,
4040
 
                                              &page_cur);
4041
4053
                lock_rec_restore_from_page_infimum(block, rec, block);
4042
4054
        } else {
4043
4055
                ibuf_insert_to_index_page_low(entry, block, index, mtr,
4044
4056
                                              &page_cur);
4045
4057
        }
 
4058
        DBUG_VOID_RETURN;
4046
4059
}
4047
4060
 
4048
4061
/****************************************************************//**
4360
4373
                              BTR_MODIFY_TREE, pcur, mtr)) {
4361
4374
 
4362
4375
                mutex_exit(&ibuf_mutex);
4363
 
                ut_ad(!ibuf_inside(mtr));
4364
4376
                ut_ad(mtr->state == MTR_COMMITTED);
4365
4377
                goto func_exit;
4366
4378
        }
4381
4393
        ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
4382
4394
 
4383
4395
func_exit:
4384
 
        ut_ad(!ibuf_inside(mtr));
4385
4396
        ut_ad(mtr->state == MTR_COMMITTED);
4386
4397
        btr_pcur_close(pcur);
4387
4398
 
4718
4729
                                                      BTR_MODIFY_LEAF,
4719
4730
                                                      &pcur, &mtr)) {
4720
4731
 
4721
 
                                        ut_ad(!ibuf_inside(&mtr));
4722
4732
                                        ut_ad(mtr.state == MTR_COMMITTED);
4723
4733
                                        mops[op]++;
4724
4734
                                        ibuf_dummy_index_free(dummy_index);