From: Sergey Vojtovich Date: April 1 2010 11:52am Subject: bzr commit into mysql-5.1-bugteam branch (svoj:3496) List-Archive: http://lists.mysql.com/commits/104850 Message-Id: <0L0700MSZ4ZIX720@fe-emea-10.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary_(ID_4X+/CF4r6JuVZ6HoHAHaIQ)" --Boundary_(ID_4X+/CF4r6JuVZ6HoHAHaIQ) MIME-version: 1.0 Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Content-disposition: inline #At file:///home/svoj/devel/innodb-snapshots/mysql-5.1-bugteam/ based on revid:svoj@stripped 3496 Sergey Vojtovich 2010-04-01 Applying InnoDB snapshot Detailed revision comments: r6673 | marko | 2010-02-11 13:09:48 +0200 (Thu, 11 Feb 2010) | 9 lines branches/zip: Relax a debug assertion about a missing BLOB. (Issue #452) When rolling back an incomplete transaction in purge, tolerate missing BLOBs also in update undo, when undoing an INSERT by updating a delete-marked record, and the delete-marked record is no longer needed. Previously, we only tolerated missing BLOBs in insert undo. This merely fixes a debug assertion; the code performed correctly without UNIV_DEBUG. rb://249 approved by Sunny Bains. modified: storage/innodb_plugin/btr/btr0cur.c storage/innodb_plugin/include/trx0types.h storage/innodb_plugin/row/row0umod.c === modified file 'storage/innodb_plugin/btr/btr0cur.c' --- a/storage/innodb_plugin/btr/btr0cur.c 2010-04-01 11:37:45 +0000 +++ b/storage/innodb_plugin/btr/btr0cur.c 2010-04-01 11:52:08 +0000 @@ -4260,7 +4260,7 @@ btr_free_externally_stored_field( /* In the rollback of uncommitted transactions, we may encounter a clustered index record whose BLOBs have not been written. There is nothing to free then. */ - ut_a(rb_ctx == RB_RECOVERY); + ut_a(rb_ctx == RB_RECOVERY || rb_ctx == RB_RECOVERY_PURGE_REC); return; } @@ -4306,7 +4306,7 @@ btr_free_externally_stored_field( || (mach_read_from_1(field_ref + BTR_EXTERN_LEN) & BTR_EXTERN_OWNER_FLAG) /* Rollback and inherited field */ - || (rb_ctx != RB_NONE + || ((rb_ctx == RB_NORMAL || rb_ctx == RB_RECOVERY) && (mach_read_from_1(field_ref + BTR_EXTERN_LEN) & BTR_EXTERN_INHERITED_FLAG))) { === modified file 'storage/innodb_plugin/include/trx0types.h' --- a/storage/innodb_plugin/include/trx0types.h 2009-09-02 23:48:06 +0000 +++ b/storage/innodb_plugin/include/trx0types.h 2010-04-01 11:52:08 +0000 @@ -70,6 +70,13 @@ typedef struct trx_named_savept_struct t enum trx_rb_ctx { RB_NONE = 0, /*!< no rollback */ RB_NORMAL, /*!< normal rollback */ + RB_RECOVERY_PURGE_REC, + /*!< rolling back an incomplete transaction, + in crash recovery, rolling back an + INSERT that was performed by updating a + delete-marked record; if the delete-marked record + no longer exists in an active read view, it will + be purged */ RB_RECOVERY /*!< rolling back an incomplete transaction, in crash recovery */ }; === modified file 'storage/innodb_plugin/row/row0umod.c' --- a/storage/innodb_plugin/row/row0umod.c 2010-04-01 11:51:48 +0000 +++ b/storage/innodb_plugin/row/row0umod.c 2010-04-01 11:52:08 +0000 @@ -154,7 +154,7 @@ ulint row_undo_mod_remove_clust_low( /*==========================*/ undo_node_t* node, /*!< in: row undo node */ - que_thr_t* thr __attribute__((unused)), /*!< in: query thread */ + que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr, /*!< in: mtr */ ulint mode) /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */ { @@ -195,11 +195,13 @@ row_undo_mod_remove_clust_low( } else { ut_ad(mode == BTR_MODIFY_TREE); - /* Note that since this operation is analogous to purge, - we can free also inherited externally stored fields: - hence the RB_NONE in the call below */ + /* This operation is analogous to purge, we can free also + inherited externally stored fields */ - btr_cur_pessimistic_delete(&err, FALSE, btr_cur, RB_NONE, mtr); + btr_cur_pessimistic_delete(&err, FALSE, btr_cur, + thr_is_recv(thr) + ? RB_RECOVERY_PURGE_REC + : RB_NONE, mtr); /* The delete operation may fail if we have little file space left: TODO: easiest to crash the database @@ -376,10 +378,11 @@ row_undo_mod_del_mark_or_remove_sec_low( } else { ut_ad(mode == BTR_MODIFY_TREE); - /* No need to distinguish RB_RECOVERY here, because we - are deleting a secondary index record: the distinction - between RB_NORMAL and RB_RECOVERY only matters when - deleting a record that contains externally stored + /* No need to distinguish RB_RECOVERY_PURGE here, + because we are deleting a secondary index record: + the distinction between RB_NORMAL and + RB_RECOVERY_PURGE only matters when deleting a + record that contains externally stored columns. */ ut_ad(!dict_index_is_clust(index)); btr_cur_pessimistic_delete(&err, FALSE, btr_cur, --Boundary_(ID_4X+/CF4r6JuVZ6HoHAHaIQ) MIME-version: 1.0 Content-type: text/bzr-bundle; CHARSET=US-ASCII; name="bzr/svoj@stripped" Content-transfer-encoding: 7BIT Content-disposition: inline; filename="bzr/svoj@stripped" # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: svoj@stripped # target_branch: file:///home/svoj/devel/innodb-snapshots/mysql-5.1-\ # bugteam/ # testament_sha1: b8588975ea6bb5d036b86ff549ad6a0b83f1eda6 # timestamp: 2010-04-01 15:52:20 +0400 # base_revision_id: svoj@stripped # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWYGUKzMAA77fgGAweX////+n 36C////0YAf9bcbjvgAE0yq1yA4ut7NHCUQmmgKehE9NPSeU2U1P0p6gBgQaHqAMT9SBohPVPRNT 2mmUajamgPUAAGgGgAaBoDUyaMip6PVNB6g9TQ9IAAAAAAAASIqeQU2p6mFT2pkn6o9qeUQ9TNIy NqYMpjT1AJiHGTJoxDTQwE0MTRpkxAyMJo00wgyYSSAgEwEmTUzVPQZqanoanqZNGj1AAAaZqZAV Ek20NjabXC1DSbMHu4aan2ef2T5nMc2ji0/dtqtyNbZrtL51yNcksE1XS03EaNBU4VeVTL84ooyT IwAggrBtuzwSzMS405BUvLe+TGfokovHz/oudPA4Wgdiqm2DY2Gzel381L+440vk5Nk3P2545Xlc UtksdJPg8kEyECgStX+gFnCyk7yalr911m8aSjWbCqw0KYvp7Ihh/R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