~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-10-15 05:30:39 UTC
  • mfrom: (1843.8.7 trunk-drizzle)
  • Revision ID: brian@tangent.org-20101015053039-ebmv3hnn1yaq4wqy
Merge in refactoring on table (broken it up by type, this will allow me to
insert the new locking).

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, 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
135
135
 
136
136
        ut_ad(trx && parent && heap);
137
137
 
138
 
        undo = static_cast<undo_node_t *>(mem_heap_alloc(heap, sizeof(undo_node_t)));
 
138
        undo = mem_heap_alloc(heap, sizeof(undo_node_t));
139
139
 
140
140
        undo->common.type = QUE_NODE_UNDO;
141
141
        undo->common.parent = parent;
185
185
        offsets = rec_get_offsets(rec, clust_index, offsets,
186
186
                                  ULINT_UNDEFINED, &heap);
187
187
 
188
 
        if (!found || node->roll_ptr
189
 
            != row_get_rec_roll_ptr(rec, clust_index, offsets)) {
 
188
        if (!found || 0 != ut_dulint_cmp(node->roll_ptr,
 
189
                                         row_get_rec_roll_ptr(rec, clust_index,
 
190
                                                              offsets))) {
190
191
 
191
192
                /* We must remove the reservation on the undo log record
192
193
                BEFORE releasing the latch on the clustered index page: this
198
199
 
199
200
                ret = FALSE;
200
201
        } else {
201
 
                row_ext_t**     ext;
202
 
 
203
 
                if (dict_table_get_format(node->table) >= DICT_TF_FORMAT_ZIP) {
204
 
                        /* In DYNAMIC or COMPRESSED format, there is
205
 
                        no prefix of externally stored columns in the
206
 
                        clustered index record. Build a cache of
207
 
                        column prefixes. */
208
 
                        ext = &node->ext;
209
 
                } else {
210
 
                        /* REDUNDANT and COMPACT formats store a local
211
 
                        768-byte prefix of each externally stored
212
 
                        column. No cache is needed. */
213
 
                        ext = NULL;
214
 
                        node->ext = NULL;
215
 
                }
216
 
 
217
202
                node->row = row_build(ROW_COPY_DATA, clust_index, rec,
218
 
                                      offsets, NULL, ext, node->heap);
 
203
                                      offsets, NULL, &node->ext, node->heap);
219
204
                if (node->update) {
220
205
                        node->undo_row = dtuple_copy(node->row, node->heap);
221
206
                        row_upd_replace(node->undo_row, &node->undo_ext,
312
297
 
313
298
        if (locked_data_dict) {
314
299
 
315
 
                row_mysql_freeze_data_dictionary(trx);
 
300
                row_mysql_lock_data_dictionary(trx);
316
301
        }
317
302
 
318
303
        if (node->state == UNDO_NODE_INSERT) {
327
312
 
328
313
        if (locked_data_dict) {
329
314
 
330
 
                row_mysql_unfreeze_data_dictionary(trx);
 
315
                row_mysql_unlock_data_dictionary(trx);
331
316
        }
332
317
 
333
318
        /* Do some cleanup */
360
345
 
361
346
        trx = thr_get_trx(thr);
362
347
 
363
 
        node = static_cast<undo_node_t *>(thr->run_node);
 
348
        node = thr->run_node;
364
349
 
365
350
        ut_ad(que_node_get_type(node) == QUE_NODE_UNDO);
366
351