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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Dave Chiluk, Eduardo Damato
  • Date: 2014-01-09 09:44:14 UTC
  • mfrom: (18.1.5 precise-security)
  • Revision ID: package-import@ubuntu.com-20140109094414-ght3gi7yvzsyvhm5
Tags: 5.5.34-0ubuntu0.12.04.2
[ Eduardo Damato ]
Fix upstart script to account for datadir disk shortage (LP: #1121874) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
 
3
Copyright (c) 1997, 2013, 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
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
 
Place, Suite 330, Boston, MA 02111-1307 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 
 
15
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
128
128
}
129
129
 
130
130
/***********************************************************//**
131
 
Removes a clustered index record after undo if possible.
 
131
Purges a clustered index record after undo if possible.
132
132
This is attempted when the record was inserted by updating a
133
133
delete-marked record and there no longer exist transactions
134
 
that would see the delete-marked record.  In other words, we
135
 
roll back the insert by purging the record.
 
134
that would see the delete-marked record.
136
135
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
137
136
static
138
137
ulint
140
139
/*==========================*/
141
140
        undo_node_t*    node,   /*!< in: row undo node */
142
141
        que_thr_t*      thr,    /*!< in: query thread */
143
 
        mtr_t*          mtr,    /*!< in: mtr */
 
142
        mtr_t*          mtr,    /*!< in/out: mini-transaction */
144
143
        ulint           mode)   /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
145
144
{
146
145
        btr_cur_t*      btr_cur;
147
146
        ulint           err;
 
147
        ulint           trx_id_offset;
148
148
 
149
149
        ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC);
150
150
 
159
159
 
160
160
        btr_cur = btr_pcur_get_btr_cur(&node->pcur);
161
161
 
 
162
        trx_id_offset = btr_cur_get_index(btr_cur)->trx_id_offset;
 
163
 
 
164
        if (!trx_id_offset) {
 
165
                mem_heap_t*     heap    = NULL;
 
166
                ulint           trx_id_col;
 
167
                ulint*          offsets;
 
168
                ulint           len;
 
169
 
 
170
                trx_id_col = dict_index_get_sys_col_pos(
 
171
                        btr_cur_get_index(btr_cur), DATA_TRX_ID);
 
172
                ut_ad(trx_id_col > 0);
 
173
                ut_ad(trx_id_col != ULINT_UNDEFINED);
 
174
 
 
175
                offsets = rec_get_offsets(
 
176
                        btr_cur_get_rec(btr_cur), btr_cur_get_index(btr_cur),
 
177
                        NULL, trx_id_col + 1, &heap);
 
178
 
 
179
                trx_id_offset = rec_get_nth_field_offs(
 
180
                        offsets, trx_id_col, &len);
 
181
                ut_ad(len == DATA_TRX_ID_LEN);
 
182
                mem_heap_free(heap);
 
183
        }
 
184
 
 
185
        if (trx_read_trx_id(btr_cur_get_rec(btr_cur) + trx_id_offset)
 
186
            != node->new_trx_id) {
 
187
                /* The record must have been purged and then replaced
 
188
                with a different one. */
 
189
                return(DB_SUCCESS);
 
190
        }
 
191
 
 
192
        /* We are about to remove an old, delete-marked version of the
 
193
        record that may have been delete-marked by a different transaction
 
194
        than the rolling-back one. */
 
195
        ut_ad(rec_get_deleted_flag(btr_cur_get_rec(btr_cur),
 
196
                                   dict_table_is_comp(node->table)));
 
197
 
162
198
        if (mode == BTR_MODIFY_LEAF) {
163
199
                err = btr_cur_optimistic_delete(btr_cur, mtr)
164
200
                        ? DB_SUCCESS