~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/row/row0vers.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

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, 2011, Oracle and/or its affiliates. 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
71
71
                                        warning */
72
72
        trx_t*          trx;
73
73
        ulint           rec_del;
 
74
#ifdef UNIV_DEBUG
74
75
        ulint           err;
 
76
#endif /* UNIV_DEBUG */
75
77
        mtr_t           mtr;
76
78
        ulint           comp;
77
79
 
169
171
 
170
172
                heap2 = heap;
171
173
                heap = mem_heap_create(1024);
172
 
                err = trx_undo_prev_version_build(clust_rec, &mtr, version,
173
 
                                                  clust_index, clust_offsets,
174
 
                                                  heap, &prev_version);
 
174
#ifdef UNIV_DEBUG
 
175
                err =
 
176
#endif /* UNIV_DEBUG */
 
177
                trx_undo_prev_version_build(clust_rec, &mtr, version,
 
178
                                            clust_index, clust_offsets,
 
179
                                            heap, &prev_version);
175
180
                mem_heap_free(heap2); /* free version and clust_offsets */
176
181
 
177
182
                if (prev_version == NULL) {
545
550
                                /* The view already sees this version: we can
546
551
                                copy it to in_heap and return */
547
552
 
 
553
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
 
554
                                ut_a(!rec_offs_any_null_extern(
 
555
                                             version, *offsets));
 
556
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
 
557
 
548
558
                                buf = mem_heap_alloc(in_heap,
549
559
                                                     rec_offs_size(*offsets));
550
560
                                *old_vers = rec_copy(buf, version, *offsets);
578
588
                *offsets = rec_get_offsets(prev_version, index, *offsets,
579
589
                                           ULINT_UNDEFINED, offset_heap);
580
590
 
 
591
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
 
592
                ut_a(!rec_offs_any_null_extern(prev_version, *offsets));
 
593
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
 
594
 
581
595
                trx_id = row_get_rec_trx_id(prev_version, index, *offsets);
582
596
 
583
597
                if (read_view_sees_trx_id(view, trx_id)) {
664
678
 
665
679
                mutex_enter(&kernel_mutex);
666
680
                version_trx = trx_get_on_id(version_trx_id);
 
681
                if (version_trx
 
682
                    && (version_trx->conc_state == TRX_COMMITTED_IN_MEMORY
 
683
                        || version_trx->conc_state == TRX_NOT_STARTED)) {
 
684
 
 
685
                        version_trx = NULL;
 
686
                }
667
687
                mutex_exit(&kernel_mutex);
668
688
 
669
 
                if (!version_trx
670
 
                    || version_trx->conc_state == TRX_NOT_STARTED
671
 
                    || version_trx->conc_state == TRX_COMMITTED_IN_MEMORY) {
 
689
                if (!version_trx) {
672
690
 
673
691
                        /* We found a version that belongs to a
674
692
                        committed transaction: return it. */
675
693
 
 
694
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
 
695
                        ut_a(!rec_offs_any_null_extern(version, *offsets));
 
696
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
 
697
 
676
698
                        if (rec == version) {
677
699
                                *old_vers = rec;
678
700
                                err = DB_SUCCESS;
730
752
                version = prev_version;
731
753
                *offsets = rec_get_offsets(version, index, *offsets,
732
754
                                           ULINT_UNDEFINED, offset_heap);
 
755
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
 
756
                ut_a(!rec_offs_any_null_extern(version, *offsets));
 
757
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
733
758
        }/* for (;;) */
734
759
 
735
760
        if (heap) {