~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2008-10-02 01:27:37 UTC
  • Revision ID: monty@inaugust.com-20081002012737-3uxmdovii2l14uqe
Removed unused crud.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        ut_a(success);
53
53
 
54
54
        if (ut_dulint_cmp(node->table->id, DICT_INDEXES_ID) == 0) {
55
 
                ut_ad(node->trx->dict_operation_lock_mode == RW_X_LATCH);
56
55
 
57
56
                /* Drop the index tree associated with the row in
58
57
                SYS_INDEXES table: */
235
234
        ut_ad(type == TRX_UNDO_INSERT_REC);
236
235
        node->rec_type = type;
237
236
 
238
 
        node->update = NULL;
239
237
        node->table = dict_table_get_on_id(table_id, node->trx);
240
238
 
241
 
        /* Skip the UNDO if we can't find the table or the .ibd file. */
242
 
        if (UNIV_UNLIKELY(node->table == NULL)) {
243
 
        } else if (UNIV_UNLIKELY(node->table->ibd_file_missing)) {
 
239
        if (node->table == NULL) {
 
240
 
 
241
                return;
 
242
        }
 
243
 
 
244
        if (node->table->ibd_file_missing) {
 
245
                /* We skip undo operations to missing .ibd files */
244
246
                node->table = NULL;
245
 
        } else {
246
 
                clust_index = dict_table_get_first_index(node->table);
247
247
 
248
 
                ptr = trx_undo_rec_get_row_ref(
249
 
                        ptr, clust_index, &node->ref, node->heap);
 
248
                return;
250
249
        }
 
250
 
 
251
        clust_index = dict_table_get_first_index(node->table);
 
252
 
 
253
        ptr = trx_undo_rec_get_row_ref(ptr, clust_index, &(node->ref),
 
254
                                       node->heap);
251
255
}
252
256
 
253
257
/***************************************************************
254
258
Undoes a fresh insert of a row to a table. A fresh insert means that
255
259
the same clustered index unique key did not have any record, even delete
256
260
marked, at the time of the insert. */
257
 
UNIV_INTERN
 
261
 
258
262
ulint
259
263
row_undo_ins(
260
264
/*=========*/
261
265
                                /* out: DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
262
266
        undo_node_t*    node)   /* in: row undo node */
263
267
{
 
268
        dtuple_t*       entry;
 
269
        ibool           found;
 
270
        ulint           err;
 
271
 
264
272
        ut_ad(node);
265
273
        ut_ad(node->state == UNDO_NODE_INSERT);
266
274
 
267
275
        row_undo_ins_parse_undo_rec(node);
268
276
 
269
 
        if (!node->table || !row_undo_search_clust_to_pcur(node)) {
 
277
        if (node->table == NULL) {
 
278
                found = FALSE;
 
279
        } else {
 
280
                found = row_undo_search_clust_to_pcur(node);
 
281
        }
 
282
 
 
283
        if (!found) {
270
284
                trx_undo_rec_release(node->trx, node->undo_no);
271
285
 
272
286
                return(DB_SUCCESS);
273
287
        }
274
288
 
275
 
        /* Iterate over all the indexes and undo the insert.*/
276
 
 
277
 
        /* Skip the clustered index (the first index) */
278
289
        node->index = dict_table_get_next_index(
279
290
                dict_table_get_first_index(node->table));
280
291
 
281
292
        while (node->index != NULL) {
282
 
                dtuple_t*       entry;
283
 
                ulint           err;
284
 
 
285
 
                entry = row_build_index_entry(node->row, node->ext,
286
 
                                              node->index, node->heap);
287
 
                ut_a(entry);
 
293
                entry = row_build_index_entry(node->row, node->index,
 
294
                                              node->heap);
288
295
                err = row_undo_ins_remove_sec(node->index, entry);
289
296
 
290
297
                if (err != DB_SUCCESS) {
295
302
                node->index = dict_table_get_next_index(node->index);
296
303
        }
297
304
 
298
 
        return(row_undo_ins_remove_clust_rec(node));
 
305
        err = row_undo_ins_remove_clust_rec(node);
 
306
 
 
307
        return(err);
299
308
}