Commit 08ed716d authored by Sergey Vojtovich's avatar Sergey Vojtovich

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.
parent d4c7bd2f
...@@ -4260,7 +4260,7 @@ btr_free_externally_stored_field( ...@@ -4260,7 +4260,7 @@ btr_free_externally_stored_field(
/* In the rollback of uncommitted transactions, we may /* In the rollback of uncommitted transactions, we may
encounter a clustered index record whose BLOBs have encounter a clustered index record whose BLOBs have
not been written. There is nothing to free then. */ 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; return;
} }
...@@ -4306,7 +4306,7 @@ btr_free_externally_stored_field( ...@@ -4306,7 +4306,7 @@ btr_free_externally_stored_field(
|| (mach_read_from_1(field_ref + BTR_EXTERN_LEN) || (mach_read_from_1(field_ref + BTR_EXTERN_LEN)
& BTR_EXTERN_OWNER_FLAG) & BTR_EXTERN_OWNER_FLAG)
/* Rollback and inherited field */ /* 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) && (mach_read_from_1(field_ref + BTR_EXTERN_LEN)
& BTR_EXTERN_INHERITED_FLAG))) { & BTR_EXTERN_INHERITED_FLAG))) {
......
...@@ -70,6 +70,13 @@ typedef struct trx_named_savept_struct trx_named_savept_t; ...@@ -70,6 +70,13 @@ typedef struct trx_named_savept_struct trx_named_savept_t;
enum trx_rb_ctx { enum trx_rb_ctx {
RB_NONE = 0, /*!< no rollback */ RB_NONE = 0, /*!< no rollback */
RB_NORMAL, /*!< normal 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, RB_RECOVERY /*!< rolling back an incomplete transaction,
in crash recovery */ in crash recovery */
}; };
......
...@@ -154,7 +154,7 @@ ulint ...@@ -154,7 +154,7 @@ ulint
row_undo_mod_remove_clust_low( row_undo_mod_remove_clust_low(
/*==========================*/ /*==========================*/
undo_node_t* node, /*!< in: row undo node */ 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 */ mtr_t* mtr, /*!< in: mtr */
ulint mode) /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */ ulint mode) /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
{ {
...@@ -195,11 +195,13 @@ row_undo_mod_remove_clust_low( ...@@ -195,11 +195,13 @@ row_undo_mod_remove_clust_low(
} else { } else {
ut_ad(mode == BTR_MODIFY_TREE); ut_ad(mode == BTR_MODIFY_TREE);
/* Note that since this operation is analogous to purge, /* This operation is analogous to purge, we can free also
we can free also inherited externally stored fields: inherited externally stored fields */
hence the RB_NONE in the call below */
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 /* The delete operation may fail if we have little
file space left: TODO: easiest to crash the database file space left: TODO: easiest to crash the database
...@@ -376,10 +378,11 @@ row_undo_mod_del_mark_or_remove_sec_low( ...@@ -376,10 +378,11 @@ row_undo_mod_del_mark_or_remove_sec_low(
} else { } else {
ut_ad(mode == BTR_MODIFY_TREE); ut_ad(mode == BTR_MODIFY_TREE);
/* No need to distinguish RB_RECOVERY here, because we /* No need to distinguish RB_RECOVERY_PURGE here,
are deleting a secondary index record: the distinction because we are deleting a secondary index record:
between RB_NORMAL and RB_RECOVERY only matters when the distinction between RB_NORMAL and
deleting a record that contains externally stored RB_RECOVERY_PURGE only matters when deleting a
record that contains externally stored
columns. */ columns. */
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment