~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/row/row0purge.c

  • Committer: Monty Taylor
  • Date: 2010-12-03 19:56:07 UTC
  • mto: (1975.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1976.
  • Revision ID: mordred@inaugust.com-20101203195607-yw50aynlw04dt5k6
All protocol stuff except for the buffer_length. WTF?

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1997, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1997, 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
44
44
#include "row0mysql.h"
45
45
#include "log0log.h"
46
46
 
47
 
/*************************************************************************
48
 
IMPORTANT NOTE: Any operation that generates redo MUST check that there
49
 
is enough space in the redo log before for that operation. This is
50
 
done by calling log_free_check(). The reason for checking the
51
 
availability of the redo log space before the start of the operation is
52
 
that we MUST not hold any synchonization objects when performing the
53
 
check.
54
 
If you make a change in this module make sure that no codepath is
55
 
introduced where a call to log_free_check() is bypassed. */
56
 
 
57
 
/*************************************************************************
58
 
IMPORTANT NOTE: Any operation that generates redo MUST check that there
59
 
is enough space in the redo log before for that operation. This is
60
 
done by calling log_free_check(). The reason for checking the
61
 
availability of the redo log space before the start of the operation is
62
 
that we MUST not hold any synchonization objects when performing the
63
 
check.
64
 
If you make a change in this module make sure that no codepath is
65
 
introduced where a call to log_free_check() is bypassed. */
66
 
 
67
47
/********************************************************************//**
68
48
Creates a purge node to a query graph.
69
49
@return own: purge node */
78
58
 
79
59
        ut_ad(parent && heap);
80
60
 
81
 
        node = static_cast<purge_node_t *>(mem_heap_alloc(heap, sizeof(purge_node_t)));
 
61
        node = mem_heap_alloc(heap, sizeof(purge_node_t));
82
62
 
83
63
        node->common.type = QUE_NODE_PURGE;
84
64
        node->common.parent = parent;
146
126
        pcur = &(node->pcur);
147
127
        btr_cur = btr_pcur_get_btr_cur(pcur);
148
128
 
149
 
        log_free_check();
150
129
        mtr_start(&mtr);
151
130
 
152
131
        success = row_purge_reposition_pcur(mode, node, &mtr);
161
140
 
162
141
        rec = btr_pcur_get_rec(pcur);
163
142
 
164
 
        if (node->roll_ptr != row_get_rec_roll_ptr(
165
 
                    rec, index, rec_get_offsets(rec, index, offsets_,
166
 
                                                ULINT_UNDEFINED, &heap))) {
 
143
        if (0 != ut_dulint_cmp(node->roll_ptr, row_get_rec_roll_ptr(
 
144
                                       rec, index, rec_get_offsets(
 
145
                                               rec, index, offsets_,
 
146
                                               ULINT_UNDEFINED, &heap)))) {
167
147
                if (UNIV_LIKELY_NULL(heap)) {
168
148
                        mem_heap_free(heap);
169
149
                }
380
360
        pcur.btr_cur.purge_node = node;
381
361
        /* Set the query thread, so that ibuf_insert_low() will be
382
362
        able to invoke thd_get_trx(). */
383
 
        pcur.btr_cur.thr = static_cast<que_thr_t *>(que_node_get_parent(node));
 
363
        pcur.btr_cur.thr = que_node_get_parent(node);
384
364
 
385
365
        search_result = row_search_index_entry(
386
366
                index, entry, BTR_MODIFY_LEAF | BTR_DELETE, &pcur, &mtr);
626
606
        byte*           ptr;
627
607
        trx_t*          trx;
628
608
        undo_no_t       undo_no;
629
 
        table_id_t      table_id;
 
609
        dulint          table_id;
630
610
        trx_id_t        trx_id;
631
611
        roll_ptr_t      roll_ptr;
632
612
        ulint           info_bits;
796
776
        que_thr_t*      thr)    /*!< in: query thread */
797
777
{
798
778
        purge_node_t*   node;
799
 
#ifdef UNIV_DEBUG
800
779
        ulint           err;
801
 
#endif /* UNIV_DEBUG */
802
780
 
803
781
        ut_ad(thr);
804
782
 
805
 
        node = static_cast<purge_node_t *>(thr->run_node);
 
783
        node = thr->run_node;
806
784
 
807
785
        ut_ad(que_node_get_type(node) == QUE_NODE_PURGE);
808
786
 
809
 
#ifdef UNIV_DEBUG
810
 
        err =
811
 
#endif /* UNIV_DEBUG */
812
 
        row_purge(node, thr);
 
787
        err = row_purge(node, thr);
813
788
 
814
 
#ifdef UNIV_DEBUG
815
 
        ut_a(err == DB_SUCCESS);
816
 
#endif /* UNIV_DEBUG */
 
789
        ut_ad(err == DB_SUCCESS);
817
790
 
818
791
        return(thr);
819
792
}