~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/include/btr0cur.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
                                should always be made using PAGE_CUR_LE to
139
139
                                search the position! */
140
140
        ulint           latch_mode, /*!< in: BTR_SEARCH_LEAF, ..., ORed with
141
 
                                BTR_INSERT and BTR_ESTIMATE;
 
141
                                at most one of BTR_INSERT, BTR_DELETE_MARK,
 
142
                                BTR_DELETE, or BTR_ESTIMATE;
142
143
                                cursor->left_block is used to store a pointer
143
144
                                to the left neighbor page, in the cases
144
145
                                BTR_SEARCH_PREV and BTR_MODIFY_PREV;
332
333
        ibool           val,    /*!< in: value to set */
333
334
        que_thr_t*      thr,    /*!< in: query thread */
334
335
        mtr_t*          mtr);   /*!< in: mtr */
335
 
/***********************************************************//**
336
 
Clear a secondary index record's delete mark.  This function is only
337
 
used by the insert buffer insert merge mechanism. */
338
 
UNIV_INTERN
339
 
void
340
 
btr_cur_del_unmark_for_ibuf(
341
 
/*========================*/
342
 
        rec_t*          rec,            /*!< in/out: record to delete unmark */
343
 
        page_zip_des_t* page_zip,       /*!< in/out: compressed page
344
 
                                        corresponding to rec, or NULL
345
 
                                        when the tablespace is
346
 
                                        uncompressed */
347
 
        mtr_t*          mtr);           /*!< in: mtr */
348
336
/*************************************************************//**
349
337
Tries to compress a page of the tree if it seems useful. It is assumed
350
338
that mtr holds an x-latch on the tree and on the cursor page. To avoid
570
558
        ulint           local_len);/*!< in: length of data, in bytes */
571
559
/*******************************************************************//**
572
560
Copies an externally stored field of a record to mem heap.
573
 
@return the field copied to heap */
 
561
@return the field copied to heap, or NULL if the field is incomplete */
574
562
UNIV_INTERN
575
563
byte*
576
564
btr_rec_copy_externally_stored_field(
596
584
        const upd_t*    update, /*!< in: update vector */
597
585
        mem_heap_t*     heap)   /*!< in: memory heap */
598
586
        __attribute__((nonnull));
599
 
 
 
587
/***********************************************************//**
 
588
Sets a secondary index record's delete mark to the given value. This
 
589
function is only used by the insert buffer merge mechanism. */
 
590
UNIV_INTERN
 
591
void
 
592
btr_cur_set_deleted_flag_for_ibuf(
 
593
/*==============================*/
 
594
        rec_t*          rec,            /*!< in/out: record */
 
595
        page_zip_des_t* page_zip,       /*!< in/out: compressed page
 
596
                                        corresponding to rec, or NULL
 
597
                                        when the tablespace is
 
598
                                        uncompressed */
 
599
        ibool           val,            /*!< in: value to set */
 
600
        mtr_t*          mtr);           /*!< in: mtr */
600
601
/*######################################################################*/
601
602
 
602
603
/** In the pessimistic delete, if the page data size drops below this
614
615
                                order); value ULINT_UNDEFINED
615
616
                                denotes array end */
616
617
        ulint   n_recs;         /*!< number of records on the page */
 
618
        ulint   page_no;        /*!< no of the page containing the record */
 
619
        ulint   page_level;     /*!< level of the page, if later we fetch
 
620
                                the page under page_no and it is no different
 
621
                                level then we know that the tree has been
 
622
                                reorganized */
617
623
};
618
624
 
619
625
#define BTR_PATH_ARRAY_N_SLOTS  250     /*!< size of path array (in slots) */
628
634
                                hash_node, and might be necessary to
629
635
                                update */
630
636
        BTR_CUR_BINARY,         /*!< success using the binary search */
631
 
        BTR_CUR_INSERT_TO_IBUF  /*!< performed the intended insert to
632
 
                                the insert buffer */
 
637
        BTR_CUR_INSERT_TO_IBUF, /*!< performed the intended insert to
 
638
                                the insert buffer */
 
639
        BTR_CUR_DEL_MARK_IBUF,  /*!< performed the intended delete
 
640
                                mark in the insert/delete buffer */
 
641
        BTR_CUR_DELETE_IBUF,    /*!< performed the intended delete in
 
642
                                the insert/delete buffer */
 
643
        BTR_CUR_DELETE_REF      /*!< row_purge_poss_sec() failed */
633
644
};
634
645
 
635
646
/** The tree cursor: the definition appears here only for the compiler
637
648
struct btr_cur_struct {
638
649
        dict_index_t*   index;          /*!< index where positioned */
639
650
        page_cur_t      page_cur;       /*!< page cursor */
 
651
        purge_node_t*   purge_node;     /*!< purge node, for BTR_DELETE */
640
652
        buf_block_t*    left_block;     /*!< this field is used to store
641
653
                                        a pointer to the left neighbor
642
654
                                        page, in the cases
693
705
                                        NULL */
694
706
        ulint           fold;           /*!< fold value used in the search if
695
707
                                        flag is BTR_CUR_HASH */
 
708
        /*----- Delete buffering -------*/
 
709
        ulint           ibuf_cnt;       /* in searches done on insert buffer
 
710
                                        trees, this contains the "counter"
 
711
                                        value (the first two bytes of the
 
712
                                        fourth field) extracted from the
 
713
                                        page above the leaf page, from the
 
714
                                        father node pointer that pointed to
 
715
                                        the leaf page. in other words, it
 
716
                                        contains the minimum counter value
 
717
                                        for records to be inserted on the
 
718
                                        chosen leaf page. If for some reason
 
719
                                        this can't be read, or if the search
 
720
                                        ended on the leftmost leaf page in
 
721
                                        the tree (in which case the father
 
722
                                        node pointer had the 'minimum
 
723
                                        record' flag set), this is
 
724
                                        ULINT_UNDEFINED. */
696
725
        /*------------------------------*/
697
726
        /* @} */
698
727
        btr_path_t*     path_arr;       /*!< in estimating the number of