~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/btr/btr0pcur.cc

  • 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
 
43
43
{
44
44
        btr_pcur_t*     pcur;
45
45
 
46
 
        pcur = mem_alloc(sizeof(btr_pcur_t));
 
46
        pcur = (btr_pcur_t *)mem_alloc(sizeof(btr_pcur_t));
47
47
 
48
48
        pcur->btr_cur.index = NULL;
49
49
        btr_pcur_init(pcur);
177
177
 
178
178
        if (pcur_donate->old_rec_buf) {
179
179
 
180
 
                pcur_receive->old_rec_buf = mem_alloc(pcur_donate->buf_size);
 
180
                pcur_receive->old_rec_buf = (unsigned char *)mem_alloc(pcur_donate->buf_size);
181
181
 
182
182
                ut_memcpy(pcur_receive->old_rec_buf, pcur_donate->old_rec_buf,
183
183
                          pcur_donate->buf_size);
205
205
are identical to the ones of the original user record */
206
206
UNIV_INTERN
207
207
ibool
208
 
btr_pcur_restore_position(
209
 
/*======================*/
 
208
btr_pcur_restore_position_func(
 
209
/*===========================*/
210
210
        ulint           latch_mode,     /*!< in: BTR_SEARCH_LEAF, ... */
211
211
        btr_pcur_t*     cursor,         /*!< in: detached persistent cursor */
 
212
        const char*     file,           /*!< in: file name */
 
213
        ulint           line,           /*!< in: line where called */
212
214
        mtr_t*          mtr)            /*!< in: mtr */
213
215
{
214
216
        dict_index_t*   index;
217
219
        ulint           old_mode;
218
220
        mem_heap_t*     heap;
219
221
 
 
222
        ut_ad(mtr);
 
223
        ut_ad(mtr->state == MTR_ACTIVE);
 
224
 
220
225
        index = btr_cur_get_index(btr_pcur_get_btr_cur(cursor));
221
226
 
222
227
        if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED)
257
262
                if (UNIV_LIKELY(buf_page_optimistic_get(
258
263
                                        latch_mode,
259
264
                                        cursor->block_when_stored,
260
 
                                        cursor->modify_clock, mtr))) {
 
265
                                        cursor->modify_clock,
 
266
                                        file, line, mtr))) {
261
267
                        cursor->pos_state = BTR_PCUR_IS_POSITIONED;
262
268
 
263
269
                        buf_block_dbg_add_level(btr_pcur_get_block(cursor),
312
318
                mode = PAGE_CUR_L;
313
319
        }
314
320
 
315
 
        btr_pcur_open_with_no_init(index, tuple, mode, latch_mode,
316
 
                                   cursor, 0, mtr);
 
321
        btr_pcur_open_with_no_init_func(index, tuple, mode, latch_mode,
 
322
                                        cursor, 0, file, line, mtr);
317
323
 
318
324
        /* Restore the old search mode */
319
325
        cursor->search_mode = old_mode;
446
452
        mtr_t*          mtr)    /*!< in: mtr */
447
453
{
448
454
        ulint           prev_page_no;
449
 
        ulint           space;
450
455
        page_t*         page;
451
456
        buf_block_t*    prev_block;
452
457
        ulint           latch_mode;
482
487
        page = btr_pcur_get_page(cursor);
483
488
 
484
489
        prev_page_no = btr_page_get_prev(page, mtr);
485
 
        space = buf_block_get_space(btr_pcur_get_block(cursor));
486
490
 
487
491
        if (prev_page_no == FIL_NULL) {
488
492
        } else if (btr_pcur_is_before_first_on_page(cursor)) {
553
557
BTR_MODIFY_LEAF. */
554
558
UNIV_INTERN
555
559
void
556
 
btr_pcur_open_on_user_rec(
557
 
/*======================*/
 
560
btr_pcur_open_on_user_rec_func(
 
561
/*===========================*/
558
562
        dict_index_t*   index,          /*!< in: index */
559
563
        const dtuple_t* tuple,          /*!< in: tuple on which search done */
560
564
        ulint           mode,           /*!< in: PAGE_CUR_L, ... */
562
566
                                        BTR_MODIFY_LEAF */
563
567
        btr_pcur_t*     cursor,         /*!< in: memory buffer for persistent
564
568
                                        cursor */
 
569
        const char*     file,           /*!< in: file name */
 
570
        ulint           line,           /*!< in: line where called */
565
571
        mtr_t*          mtr)            /*!< in: mtr */
566
572
{
567
 
        btr_pcur_open(index, tuple, mode, latch_mode, cursor, mtr);
 
573
        btr_pcur_open_func(index, tuple, mode, latch_mode, cursor,
 
574
                           file, line, mtr);
568
575
 
569
576
        if ((mode == PAGE_CUR_GE) || (mode == PAGE_CUR_G)) {
570
577