~ubuntu-branches/ubuntu/raring/mysql-5.5/raring-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-01-16 08:29:25 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20130116082925-znscu5xswxo6pmw2
Tags: 5.5.29-0ubuntu1
* SECURITY UPDATE: Update to 5.5.29 to fix security issues (LP: #1100264)
  - http://www.oracle.com/technetwork/topics/security/cpujan2013-1515902.html
* debian/patches/CVE-2012-5611.patch: removed, included upstream.
* debian/patches/38_scripts__mysqld_safe.sh__signals.patch: refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
introduced where a call to log_free_check() is bypassed. */
70
70
 
71
71
/***********************************************************//**
72
 
Checks if also the previous version of the clustered index record was
73
 
modified or inserted by the same transaction, and its undo number is such
74
 
that it should be undone in the same rollback.
75
 
@return TRUE if also previous modify or insert of this row should be undone */
76
 
static
77
 
ibool
78
 
row_undo_mod_undo_also_prev_vers(
79
 
/*=============================*/
80
 
        undo_node_t*    node,   /*!< in: row undo node */
81
 
        undo_no_t*      undo_no)/*!< out: the undo number */
82
 
{
83
 
        trx_undo_rec_t* undo_rec;
84
 
        trx_t*          trx;
85
 
 
86
 
        trx = node->trx;
87
 
 
88
 
        if (node->new_trx_id != trx->id) {
89
 
 
90
 
                *undo_no = 0;
91
 
                return(FALSE);
92
 
        }
93
 
 
94
 
        undo_rec = trx_undo_get_undo_rec_low(node->new_roll_ptr, node->heap);
95
 
 
96
 
        *undo_no = trx_undo_rec_get_undo_no(undo_rec);
97
 
 
98
 
        return(trx->roll_limit <= *undo_no);
99
 
}
100
 
 
101
 
/***********************************************************//**
102
72
Undoes a modify in a clustered index record.
103
73
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
104
74
static
226
196
        btr_pcur_t*     pcur;
227
197
        mtr_t           mtr;
228
198
        ulint           err;
229
 
        ibool           success;
230
 
        ibool           more_vers;
231
 
        undo_no_t       new_undo_no;
232
199
 
233
200
        ut_ad(node && thr);
234
201
 
235
202
        log_free_check();
236
203
 
237
 
        /* Check if also the previous version of the clustered index record
238
 
        should be undone in this same rollback operation */
239
 
 
240
 
        more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no);
241
 
 
242
204
        pcur = &(node->pcur);
243
205
 
244
206
        mtr_start(&mtr);
286
248
 
287
249
        trx_undo_rec_release(node->trx, node->undo_no);
288
250
 
289
 
        if (more_vers && err == DB_SUCCESS) {
290
 
 
291
 
                /* Reserve the undo log record to the prior version after
292
 
                committing &mtr: this is necessary to comply with the latching
293
 
                order, as &mtr may contain the fsp latch which is lower in
294
 
                the latch hierarchy than trx->undo_mutex. */
295
 
 
296
 
                success = trx_undo_rec_reserve(node->trx, new_undo_no);
297
 
 
298
 
                if (success) {
299
 
                        node->state = UNDO_NODE_PREV_VERS;
300
 
                }
301
 
        }
302
 
 
303
251
        return(err);
304
252
}
305
253
 
847
795
        trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id,
848
796
                                       roll_ptr, info_bits, trx,
849
797
                                       node->heap, &(node->update));
850
 
        node->new_roll_ptr = roll_ptr;
851
798
        node->new_trx_id = trx_id;
852
799
        node->cmpl_info = cmpl_info;
853
800
}