~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/btr0pcur.ic

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
 
Place, Suite 330, Boston, MA 02111-1307 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
15
St, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
395
395
}
396
396
 
397
397
/**************************************************************//**
398
 
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
 
398
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
399
399
that is, the cursor becomes detached. If there have been modifications
400
400
to the page where pcur is positioned, this can be used instead of
401
401
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
402
402
before calling this, if restoration of cursor is wanted later. */
403
403
UNIV_INLINE
404
404
void
405
 
btr_pcur_commit(
406
 
/*============*/
407
 
        btr_pcur_t*     pcur)   /*!< in: persistent cursor */
408
 
{
409
 
        ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED);
410
 
 
411
 
        pcur->latch_mode = BTR_NO_LATCHES;
412
 
 
413
 
        mtr_commit(pcur->mtr);
414
 
 
415
 
        pcur->pos_state = BTR_PCUR_WAS_POSITIONED;
416
 
}
417
 
 
418
 
/**************************************************************//**
419
 
Differs from btr_pcur_commit in that we can specify the mtr to commit. */
420
 
UNIV_INLINE
421
 
void
422
405
btr_pcur_commit_specify_mtr(
423
406
/*========================*/
424
407
        btr_pcur_t*     pcur,   /*!< in: persistent cursor */
483
466
closed with btr_pcur_close. */
484
467
UNIV_INLINE
485
468
void
486
 
btr_pcur_open(
487
 
/*==========*/
 
469
btr_pcur_open_func(
 
470
/*===============*/
488
471
        dict_index_t*   index,  /*!< in: index */
489
472
        const dtuple_t* tuple,  /*!< in: tuple on which search done */
490
473
        ulint           mode,   /*!< in: PAGE_CUR_L, ...;
495
478
                                record! */
496
479
        ulint           latch_mode,/*!< in: BTR_SEARCH_LEAF, ... */
497
480
        btr_pcur_t*     cursor, /*!< in: memory buffer for persistent cursor */
 
481
        const char*     file,   /*!< in: file name */
 
482
        ulint           line,   /*!< in: line where called */
498
483
        mtr_t*          mtr)    /*!< in: mtr */
499
484
{
500
485
        btr_cur_t*      btr_cursor;
511
496
        btr_cursor = btr_pcur_get_btr_cur(cursor);
512
497
 
513
498
        btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
514
 
                                    btr_cursor, 0, mtr);
 
499
                                    btr_cursor, 0, file, line, mtr);
515
500
        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
516
501
 
517
502
        cursor->trx_if_known = NULL;
522
507
cursor. */
523
508
UNIV_INLINE
524
509
void
525
 
btr_pcur_open_with_no_init(
526
 
/*=======================*/
 
510
btr_pcur_open_with_no_init_func(
 
511
/*============================*/
527
512
        dict_index_t*   index,  /*!< in: index */
528
513
        const dtuple_t* tuple,  /*!< in: tuple on which search done */
529
514
        ulint           mode,   /*!< in: PAGE_CUR_L, ...;
541
526
        ulint           has_search_latch,/*!< in: latch mode the caller
542
527
                                currently has on btr_search_latch:
543
528
                                RW_S_LATCH, or 0 */
 
529
        const char*     file,   /*!< in: file name */
 
530
        ulint           line,   /*!< in: line where called */
544
531
        mtr_t*          mtr)    /*!< in: mtr */
545
532
{
546
533
        btr_cur_t*      btr_cursor;
553
540
        btr_cursor = btr_pcur_get_btr_cur(cursor);
554
541
 
555
542
        btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
556
 
                                    btr_cursor, has_search_latch, mtr);
 
543
                                    btr_cursor, has_search_latch,
 
544
                                    file, line, mtr);
557
545
        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
558
546
 
559
547
        cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
600
588
Positions a cursor at a randomly chosen position within a B-tree. */
601
589
UNIV_INLINE
602
590
void
603
 
btr_pcur_open_at_rnd_pos(
604
 
/*=====================*/
 
591
btr_pcur_open_at_rnd_pos_func(
 
592
/*==========================*/
605
593
        dict_index_t*   index,          /*!< in: index */
606
594
        ulint           latch_mode,     /*!< in: BTR_SEARCH_LEAF, ... */
607
595
        btr_pcur_t*     cursor,         /*!< in/out: B-tree pcur */
 
596
        const char*     file,           /*!< in: file name */
 
597
        ulint           line,           /*!< in: line where called */
608
598
        mtr_t*          mtr)            /*!< in: mtr */
609
599
{
610
600
        /* Initialize the cursor */
614
604
 
615
605
        btr_pcur_init(cursor);
616
606
 
617
 
        btr_cur_open_at_rnd_pos(index, latch_mode,
618
 
                                btr_pcur_get_btr_cur(cursor), mtr);
 
607
        btr_cur_open_at_rnd_pos_func(index, latch_mode,
 
608
                                     btr_pcur_get_btr_cur(cursor),
 
609
                                     file, line, mtr);
619
610
        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
620
611
        cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
621
612