~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

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