3857 Marko Mäkelä 2012-05-23
WL#6255 preparation: Add the accessor trx_undo_trx_id_is_insert().
modified:
storage/innobase/include/trx0undo.h
storage/innobase/include/trx0undo.ic
storage/innobase/row/row0merge.cc
3856 Marko Mäkelä 2012-05-23
Remove bogus __attribute__((pure)) on indexes.
An index can become corrupted between calls or its online_status may
change between calls.
modified:
storage/innobase/include/dict0dict.h
=== modified file 'storage/innobase/include/trx0undo.h'
--- a/storage/innobase/include/trx0undo.h revid:marko.makela@stripped0120523114530-7punvfhswqm82tvc
+++ b/storage/innobase/include/trx0undo.h revid:marko.makela@stripped214-9wp928wdmv0k82hk
@@ -65,6 +65,15 @@ ibool
trx_undo_roll_ptr_is_insert(
/*========================*/
roll_ptr_t roll_ptr); /*!< in: roll pointer */
+/***********************************************************************//**
+Returns true if the record is of the insert type.
+@return true if the record was freshly inserted (not updated). */
+UNIV_INLINE
+bool
+trx_undo_trx_id_is_insert(
+/*======================*/
+ const byte* trx_id) /*!< in: DB_TRX_ID, followed by DB_ROLL_PTR */
+ __attribute__((nonnull, pure, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************//**
Writes a roll ptr to an index page. In case that the size changes in
=== modified file 'storage/innobase/include/trx0undo.ic'
--- a/storage/innobase/include/trx0undo.ic revid:marko.makela@stripped20523114530-7punvfhswqm82tvc
+++ b/storage/innobase/include/trx0undo.ic revid:marko.makela@stripped14-9wp928wdmv0k82hk
@@ -101,6 +101,21 @@ trx_undo_roll_ptr_is_insert(
ut_ad(roll_ptr < (1ULL << 56));
return((ibool) (roll_ptr >> 55));
}
+
+/***********************************************************************//**
+Returns true if the record is of the insert type.
+@return true if the record was freshly inserted (not updated). */
+UNIV_INLINE
+bool
+trx_undo_trx_id_is_insert(
+/*======================*/
+ const byte* trx_id) /*!< in: DB_TRX_ID, followed by DB_ROLL_PTR */
+{
+#if DATA_TRX_ID + 1 != DATA_ROLL_PTR
+# error
+#endif
+ return(static_cast<bool>(trx_id[DATA_TRX_ID_LEN] >> 7));
+}
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************//**
=== modified file 'storage/innobase/row/row0merge.cc'
--- a/storage/innobase/row/row0merge.cc revid:marko.makela@strippedhswqm82tvc
+++ b/storage/innobase/row/row0merge.cc revid:marko.makela@stripped
@@ -1451,7 +1451,6 @@ row_merge_read_clustered_index(
if (UNIV_LIKELY_NULL(rec_offs_any_null_extern(rec, offsets))) {
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
trx_id_t trx_id;
- roll_ptr_t roll_ptr;
ulint trx_id_offset;
/* It is possible that the record was
@@ -1468,10 +1467,8 @@ row_merge_read_clustered_index(
}
trx_id = trx_read_trx_id(rec + trx_id_offset);
- roll_ptr = trx_read_roll_ptr(rec + trx_id_offset
- + DATA_TRX_ID_LEN);
ut_a(trx_rw_is_active(trx_id, NULL));
- ut_a(trx_undo_roll_ptr_is_insert(roll_ptr));
+ ut_a(trx_undo_trx_id_is_insert(rec + trx_id_offset));
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
/* When !online, we are holding an X-lock on
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-trunk-wl6255 branch (marko.makela:3856 to 3857) WL#6255 | marko.makela | 23 May |