~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2009-01-09 07:02:24 UTC
  • mto: (779.1.2 devel)
  • mto: This revision was merged to the branch mainline in revision 784.
  • Revision ID: mordred@inaugust.com-20090109070224-prwl5p52mfql3zfw
Split out readline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify it under
6
 
the terms of the GNU General Public License as published by the Free Software
7
 
Foundation; version 2 of the License.
8
 
 
9
 
This program is distributed in the hope that it will be useful, but WITHOUT
10
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
 
 
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
16
 
 
17
 
*****************************************************************************/
18
 
 
19
1
/******************************************************
20
2
Purge obsolete records
21
3
 
 
4
(c) 1997 Innobase Oy
 
5
 
22
6
Created 3/14/1997 Heikki Tuuri
23
7
*******************************************************/
24
8
 
233
217
        ibool           found;
234
218
        ulint           err;
235
219
        mtr_t           mtr;
236
 
        mtr_t           mtr_vers;
 
220
        mtr_t*          mtr_vers;
237
221
 
238
222
        log_free_check();
239
223
        mtr_start(&mtr);
241
225
        found = row_search_index_entry(index, entry, mode, &pcur, &mtr);
242
226
 
243
227
        if (!found) {
244
 
                /* Not found.  This is a legitimate condition.  In a
245
 
                rollback, InnoDB will remove secondary recs that would
246
 
                be purged anyway.  Then the actual purge will not find
247
 
                the secondary index record.  Also, the purge itself is
248
 
                eager: if it comes to consider a secondary index
249
 
                record, and notices it does not need to exist in the
250
 
                index, it will remove it.  Then if/when the purge
251
 
                comes to consider the secondary index record a second
252
 
                time, it will not exist any more in the index. */
 
228
                /* Not found */
253
229
 
254
230
                /* fputs("PURGE:........sec entry not found\n", stderr); */
255
231
                /* dtuple_print(stderr, entry); */
266
242
        which cannot be purged yet, requires its existence. If some requires,
267
243
        we should do nothing. */
268
244
 
269
 
        mtr_start(&mtr_vers);
270
 
 
271
 
        success = row_purge_reposition_pcur(BTR_SEARCH_LEAF, node, &mtr_vers);
 
245
        mtr_vers = mem_alloc(sizeof(mtr_t));
 
246
 
 
247
        mtr_start(mtr_vers);
 
248
 
 
249
        success = row_purge_reposition_pcur(BTR_SEARCH_LEAF, node, mtr_vers);
272
250
 
273
251
        if (success) {
274
252
                old_has = row_vers_old_has_index_entry(
275
253
                        TRUE, btr_pcur_get_rec(&(node->pcur)),
276
 
                        &mtr_vers, index, entry);
 
254
                        mtr_vers, index, entry);
277
255
        }
278
256
 
279
 
        btr_pcur_commit_specify_mtr(&(node->pcur), &mtr_vers);
 
257
        btr_pcur_commit_specify_mtr(&(node->pcur), mtr_vers);
 
258
 
 
259
        mem_free(mtr_vers);
280
260
 
281
261
        if (!success || !old_has) {
282
262
                /* Remove the index record */