diff options
author | Nirbhay Choubey <nirbhay@skysql.com> | 2014-05-21 11:09:55 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@skysql.com> | 2014-05-21 11:09:55 -0400 |
commit | 086af8367ed2499adae378638225ceb14c85f046 (patch) | |
tree | 953720d86a4decd67a24b560ffbe277900ff9609 /storage/innobase/row/row0upd.cc | |
parent | 558995ad84ca1348dfe681a8d111650225fcc205 (diff) | |
parent | 1170a54060168d885cbf682836342d4fc4ccae1a (diff) | |
download | mariadb-git-086af8367ed2499adae378638225ceb14c85f046.tar.gz |
bzr merge -r4209 maria/10.0.
Diffstat (limited to 'storage/innobase/row/row0upd.cc')
-rw-r--r-- | storage/innobase/row/row0upd.cc | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index d34ffdd5f6d..6a727e16812 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2146,9 +2146,7 @@ row_upd_clust_rec_by_insert_inherit_func( data += len - BTR_EXTERN_FIELD_REF_SIZE; /* The pointer must not be zero. */ ut_a(memcmp(data, field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)); - /* The BLOB must be owned. */ - ut_a(!(data[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG)); - + data[BTR_EXTERN_LEN] &= ~BTR_EXTERN_OWNER_FLAG; data[BTR_EXTERN_LEN] |= BTR_EXTERN_INHERITED_FLAG; /* The BTR_EXTERN_INHERITED_FLAG only matters in rollback. Purge will always free the extern fields of @@ -2256,7 +2254,13 @@ err_exit: rec, offsets, entry, node->update); if (change_ownership) { - btr_pcur_store_position(pcur, mtr); + /* The blobs are disowned here, expecting the + insert down below to inherit them. But if the + insert fails, then this disown will be undone + when the operation is rolled back. */ + btr_cur_disown_inherited_fields( + btr_cur_get_page_zip(btr_cur), + rec, index, offsets, node->update, mtr); } } @@ -2310,41 +2314,6 @@ err_exit: ? UPD_NODE_INSERT_BLOB : UPD_NODE_INSERT_CLUSTERED; - if (err == DB_SUCCESS && change_ownership) { - /* Mark the non-updated fields disowned by the old record. */ - - /* NOTE: this transaction has an x-lock on the record - and therefore other transactions cannot modify the - record when we have no latch on the page. In addition, - we assume that other query threads of the same - transaction do not modify the record in the meantime. - Therefore we can assert that the restoration of the - cursor succeeds. */ - - mtr_start(mtr); - - if (!btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur, mtr)) { - ut_error; - } - - rec = btr_cur_get_rec(btr_cur); - offsets = rec_get_offsets(rec, index, offsets, - ULINT_UNDEFINED, &heap); - ut_ad(page_rec_is_user_rec(rec)); - ut_ad(rec_get_deleted_flag(rec, rec_offs_comp(offsets))); - - btr_cur_disown_inherited_fields( - btr_cur_get_page_zip(btr_cur), - rec, index, offsets, node->update, mtr); - - /* It is not necessary to call row_log_table for - this, because during online table rebuild, purge will - not free any BLOBs in the table, whether or not they - are owned by the clustered index record. */ - - mtr_commit(mtr); - } - mem_heap_free(heap); return(err); @@ -2387,7 +2356,7 @@ row_upd_clust_rec( if (dict_index_is_online_ddl(index)) { rebuilt_old_pk = row_log_table_get_pk( - btr_cur_get_rec(btr_cur), index, offsets, &heap); + btr_cur_get_rec(btr_cur), index, offsets, NULL, &heap); } /* Try optimistic updating of the record, keeping changes within |