~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: David Shrewsbury
  • Date: 2010-10-26 13:45:37 UTC
  • mto: (1882.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1883.
  • Revision ID: shrewsbury.dave@gmail.com-20101026134537-xncn5cm00jr01m2z
Fix Solaris gripe about unreachable statements

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2009, 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
395
395
}
396
396
 
397
397
/**************************************************************//**
398
 
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
 
398
Commits the pcur 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
405
422
btr_pcur_commit_specify_mtr(
406
423
/*========================*/
407
424
        btr_pcur_t*     pcur,   /*!< in: persistent cursor */
466
483
closed with btr_pcur_close. */
467
484
UNIV_INLINE
468
485
void
469
 
btr_pcur_open_func(
470
 
/*===============*/
 
486
btr_pcur_open(
 
487
/*==========*/
471
488
        dict_index_t*   index,  /*!< in: index */
472
489
        const dtuple_t* tuple,  /*!< in: tuple on which search done */
473
490
        ulint           mode,   /*!< in: PAGE_CUR_L, ...;
478
495
                                record! */
479
496
        ulint           latch_mode,/*!< in: BTR_SEARCH_LEAF, ... */
480
497
        btr_pcur_t*     cursor, /*!< in: memory buffer for persistent cursor */
481
 
        const char*     file,   /*!< in: file name */
482
 
        ulint           line,   /*!< in: line where called */
483
498
        mtr_t*          mtr)    /*!< in: mtr */
484
499
{
485
500
        btr_cur_t*      btr_cursor;
496
511
        btr_cursor = btr_pcur_get_btr_cur(cursor);
497
512
 
498
513
        btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
499
 
                                    btr_cursor, 0, file, line, mtr);
 
514
                                    btr_cursor, 0, mtr);
500
515
        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
501
516
 
502
517
        cursor->trx_if_known = NULL;
507
522
cursor. */
508
523
UNIV_INLINE
509
524
void
510
 
btr_pcur_open_with_no_init_func(
511
 
/*============================*/
 
525
btr_pcur_open_with_no_init(
 
526
/*=======================*/
512
527
        dict_index_t*   index,  /*!< in: index */
513
528
        const dtuple_t* tuple,  /*!< in: tuple on which search done */
514
529
        ulint           mode,   /*!< in: PAGE_CUR_L, ...;
526
541
        ulint           has_search_latch,/*!< in: latch mode the caller
527
542
                                currently has on btr_search_latch:
528
543
                                RW_S_LATCH, or 0 */
529
 
        const char*     file,   /*!< in: file name */
530
 
        ulint           line,   /*!< in: line where called */
531
544
        mtr_t*          mtr)    /*!< in: mtr */
532
545
{
533
546
        btr_cur_t*      btr_cursor;
540
553
        btr_cursor = btr_pcur_get_btr_cur(cursor);
541
554
 
542
555
        btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
543
 
                                    btr_cursor, has_search_latch,
544
 
                                    file, line, mtr);
 
556
                                    btr_cursor, has_search_latch, mtr);
545
557
        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
546
558
 
547
559
        cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
588
600
Positions a cursor at a randomly chosen position within a B-tree. */
589
601
UNIV_INLINE
590
602
void
591
 
btr_pcur_open_at_rnd_pos_func(
592
 
/*==========================*/
 
603
btr_pcur_open_at_rnd_pos(
 
604
/*=====================*/
593
605
        dict_index_t*   index,          /*!< in: index */
594
606
        ulint           latch_mode,     /*!< in: BTR_SEARCH_LEAF, ... */
595
607
        btr_pcur_t*     cursor,         /*!< in/out: B-tree pcur */
596
 
        const char*     file,           /*!< in: file name */
597
 
        ulint           line,           /*!< in: line where called */
598
608
        mtr_t*          mtr)            /*!< in: mtr */
599
609
{
600
610
        /* Initialize the cursor */
604
614
 
605
615
        btr_pcur_init(cursor);
606
616
 
607
 
        btr_cur_open_at_rnd_pos_func(index, latch_mode,
608
 
                                     btr_pcur_get_btr_cur(cursor),
609
 
                                     file, line, mtr);
 
617
        btr_cur_open_at_rnd_pos(index, latch_mode,
 
618
                                btr_pcur_get_btr_cur(cursor), mtr);
610
619
        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
611
620
        cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
612
621