~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Renamed strings to mystrings, for include/lib naming consistency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
                                we may run out of file space */
83
83
        undo_node_t*    node,   /* in: row undo node */
84
84
        que_thr_t*      thr,    /* in: query thread */
85
 
        mtr_t*          mtr,    /* in: mtr; must be committed before
86
 
                                latching any further pages */
 
85
        mtr_t*          mtr,    /* in: mtr */
87
86
        ulint           mode)   /* in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
88
87
{
 
88
        big_rec_t*      dummy_big_rec;
89
89
        btr_pcur_t*     pcur;
90
90
        btr_cur_t*      btr_cur;
91
91
        ulint           err;
106
106
                                                btr_cur, node->update,
107
107
                                                node->cmpl_info, thr, mtr);
108
108
        } else {
109
 
                mem_heap_t*     heap            = NULL;
110
 
                big_rec_t*      dummy_big_rec;
111
 
 
112
109
                ut_ad(mode == BTR_MODIFY_TREE);
113
110
 
114
111
                err = btr_cur_pessimistic_update(
115
112
                        BTR_NO_LOCKING_FLAG
116
113
                        | BTR_NO_UNDO_LOG_FLAG
117
114
                        | BTR_KEEP_SYS_FLAG,
118
 
                        btr_cur, &heap, &dummy_big_rec, node->update,
 
115
                        btr_cur, &dummy_big_rec, node->update,
119
116
                        node->cmpl_info, thr, mtr);
120
 
 
121
 
                ut_a(!dummy_big_rec);
122
 
                if (UNIV_LIKELY_NULL(heap)) {
123
 
                        mem_heap_free(heap);
124
 
                }
125
117
        }
126
118
 
127
119
        return(err);
419
411
        btr_pcur_t      pcur;
420
412
        upd_t*          update;
421
413
        ulint           err             = DB_SUCCESS;
 
414
        ibool           found;
422
415
        big_rec_t*      dummy_big_rec;
423
416
        mtr_t           mtr;
424
417
        trx_t*          trx             = thr_get_trx(thr);
426
419
        log_free_check();
427
420
        mtr_start(&mtr);
428
421
 
429
 
        /* Ignore indexes that are being created. */
430
 
        if (UNIV_UNLIKELY(*index->name == TEMP_INDEX_PREFIX)) {
431
 
 
432
 
                return(DB_SUCCESS);
433
 
        }
434
 
 
435
 
        if (UNIV_UNLIKELY(!row_search_index_entry(index, entry,
436
 
                                                  mode, &pcur, &mtr))) {
 
422
        found = row_search_index_entry(index, entry, mode, &pcur, &mtr);
 
423
 
 
424
        if (!found) {
437
425
                fputs("InnoDB: error in sec index entry del undo in\n"
438
426
                      "InnoDB: ", stderr);
439
427
                dict_index_name_print(stderr, trx, index);
469
457
                        err = btr_cur_optimistic_update(
470
458
                                BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
471
459
                                btr_cur, update, 0, thr, &mtr);
472
 
                        switch (err) {
473
 
                        case DB_OVERFLOW:
474
 
                        case DB_UNDERFLOW:
475
 
                        case DB_ZIP_OVERFLOW:
 
460
                        if (err == DB_OVERFLOW || err == DB_UNDERFLOW) {
476
461
                                err = DB_FAIL;
477
462
                        }
478
463
                } else {
479
464
                        ut_a(mode == BTR_MODIFY_TREE);
480
465
                        err = btr_cur_pessimistic_update(
481
466
                                BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG,
482
 
                                btr_cur, &heap, &dummy_big_rec,
 
467
                                btr_cur, &dummy_big_rec,
483
468
                                update, 0, thr, &mtr);
484
 
                        ut_a(!dummy_big_rec);
485
469
                }
486
470
 
487
471
                mem_heap_free(heap);
513
497
        while (node->index != NULL) {
514
498
                index = node->index;
515
499
 
516
 
                entry = row_build_index_entry(node->row, node->ext,
517
 
                                              index, heap);
518
 
                ut_a(entry);
 
500
                entry = row_build_index_entry(node->row, index, heap);
 
501
 
519
502
                err = row_undo_mod_del_mark_or_remove_sec(node, thr, index,
520
503
                                                          entry);
521
504
                if (err != DB_SUCCESS) {
553
536
        while (node->index != NULL) {
554
537
                index = node->index;
555
538
 
556
 
                entry = row_build_index_entry(node->row, node->ext,
557
 
                                              index, heap);
558
 
                ut_a(entry);
 
539
                entry = row_build_index_entry(node->row, index, heap);
 
540
 
559
541
                err = row_undo_mod_del_unmark_sec_and_undo_update(
560
542
                        BTR_MODIFY_LEAF, thr, index, entry);
561
543
                if (err == DB_FAIL) {
608
590
                                                     node->update)) {
609
591
 
610
592
                        /* Build the newest version of the index entry */
611
 
                        entry = row_build_index_entry(node->row, node->ext,
612
 
                                                      index, heap);
613
 
                        ut_a(entry);
 
593
                        entry = row_build_index_entry(node->row, index, heap);
 
594
 
614
595
                        /* NOTE that if we updated the fields of a
615
596
                        delete-marked secondary index record so that
616
597
                        alphabetically they stayed the same, e.g.,
636
617
                        the secondary index record if we updated its fields
637
618
                        but alphabetically they stayed the same, e.g.,
638
619
                        'abc' -> 'aBc'. */
639
 
                        mem_heap_empty(heap);
640
 
                        entry = row_build_index_entry(node->undo_row,
641
 
                                                      node->undo_ext,
642
 
                                                      index, heap);
643
 
                        ut_a(entry);
644
620
 
 
621
                        row_upd_index_replace_new_col_vals(entry, index,
 
622
                                                           node->update, NULL);
645
623
                        err = row_undo_mod_del_unmark_sec_and_undo_update(
646
624
                                BTR_MODIFY_LEAF, thr, index, entry);
647
625
                        if (err == DB_FAIL) {
726
704
 
727
705
/***************************************************************
728
706
Undoes a modify operation on a row of a table. */
729
 
UNIV_INTERN
 
707
 
730
708
ulint
731
709
row_undo_mod(
732
710
/*=========*/
734
712
        undo_node_t*    node,   /* in: row undo node */
735
713
        que_thr_t*      thr)    /* in: query thread */
736
714
{
 
715
        ibool   found;
737
716
        ulint   err;
738
717
 
739
718
        ut_ad(node && thr);
741
720
 
742
721
        row_undo_mod_parse_undo_rec(node, thr);
743
722
 
744
 
        if (!node->table || !row_undo_search_clust_to_pcur(node)) {
 
723
        if (node->table == NULL) {
 
724
                found = FALSE;
 
725
        } else {
 
726
                found = row_undo_search_clust_to_pcur(node);
 
727
        }
 
728
 
 
729
        if (!found) {
745
730
                /* It is already undone, or will be undone by another query
746
731
                thread, or table was dropped */
747
732