~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merge Stewart - update to innodb 1.0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1997, 2009, 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
144
144
 
145
145
/***********************************************************//**
146
146
Removes a clustered index record after undo if possible.
 
147
This is attempted when the record was inserted by updating a
 
148
delete-marked record and there no longer exist transactions
 
149
that would see the delete-marked record.  In other words, we
 
150
roll back the insert by purging the record.
147
151
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
148
152
static
149
153
ulint
150
154
row_undo_mod_remove_clust_low(
151
155
/*==========================*/
152
156
        undo_node_t*    node,   /*!< in: row undo node */
153
 
        que_thr_t*      thr __attribute__((unused)), /*!< in: query thread */
 
157
        que_thr_t*      thr,    /*!< in: query thread */
154
158
        mtr_t*          mtr,    /*!< in: mtr */
155
159
        ulint           mode)   /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
156
160
{
159
163
        ulint           err;
160
164
        ibool           success;
161
165
 
 
166
        ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC);
162
167
        pcur = &(node->pcur);
163
168
        btr_cur = btr_pcur_get_btr_cur(pcur);
164
169
 
190
195
        } else {
191
196
                ut_ad(mode == BTR_MODIFY_TREE);
192
197
 
193
 
                /* Note that since this operation is analogous to purge,
194
 
                we can free also inherited externally stored fields:
195
 
                hence the RB_NONE in the call below */
 
198
                /* This operation is analogous to purge, we can free also
 
199
                inherited externally stored fields */
196
200
 
197
 
                btr_cur_pessimistic_delete(&err, FALSE, btr_cur, RB_NONE, mtr);
 
201
                btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
 
202
                                           thr_is_recv(thr)
 
203
                                           ? RB_RECOVERY_PURGE_REC
 
204
                                           : RB_NONE, mtr);
198
205
 
199
206
                /* The delete operation may fail if we have little
200
207
                file space left: TODO: easiest to crash the database
370
377
                } else {
371
378
                        ut_ad(mode == BTR_MODIFY_TREE);
372
379
 
373
 
                        /* No need to distinguish RB_RECOVERY here, because we
374
 
                        are deleting a secondary index record: the distinction
375
 
                        between RB_NORMAL and RB_RECOVERY only matters when
376
 
                        deleting a record that contains externally stored
 
380
                        /* No need to distinguish RB_RECOVERY_PURGE here,
 
381
                        because we are deleting a secondary index record:
 
382
                        the distinction between RB_NORMAL and
 
383
                        RB_RECOVERY_PURGE only matters when deleting a
 
384
                        record that contains externally stored
377
385
                        columns. */
378
386
                        ut_ad(!dict_index_is_clust(index));
379
387
                        btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
438
446
                                BTR_MODIFY_TREE */
439
447
        que_thr_t*      thr,    /*!< in: query thread */
440
448
        dict_index_t*   index,  /*!< in: index */
441
 
        dtuple_t*       entry)  /*!< in: index entry */
 
449
        const dtuple_t* entry)  /*!< in: index entry */
442
450
{
443
451
        mem_heap_t*     heap;
444
452
        btr_pcur_t      pcur;
533
541
        dict_index_t*   index;
534
542
        ulint           err     = DB_SUCCESS;
535
543
 
 
544
        ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC);
536
545
        heap = mem_heap_create(1024);
537
546
 
538
547
        while (node->index != NULL) {
550
559
                        does not exist.  However, this situation may
551
560
                        only occur during the rollback of incomplete
552
561
                        transactions. */
553
 
                        ut_a(trx_is_recv(thr_get_trx(thr)));
 
562
                        ut_a(thr_is_recv(thr));
554
563
                } else {
555
564
                        err = row_undo_mod_del_mark_or_remove_sec(
556
565
                                node, thr, index, entry);