summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2011-06-15 10:16:59 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2011-06-15 10:16:59 +0300
commita8629376994c1365923ac9144354d7cd99d8288a (patch)
tree2981e9e882d9e24ba62acab6ae812bd16ccab855
parent98d527d3cb89b5e7f8e14d4e5ccf43b03b6f6e25 (diff)
downloadmariadb-git-a8629376994c1365923ac9144354d7cd99d8288a.tar.gz
Introduce UNIV_BLOB_NULL_DEBUG for temporarily hiding Bug#12650861.
Some ut_a(!rec_offs_any_null_extern()) assertion failures are indicating genuine BLOB bugs, others are bogus failures when rolling back incomplete transactions at crash recovery. This needs more work, and until I get a chance to work on it, other testing must not be disrupted by this.
-rw-r--r--storage/innobase/btr/btr0cur.c4
-rw-r--r--storage/innobase/include/rem0rec.h4
-rw-r--r--storage/innobase/include/rem0rec.ic4
-rw-r--r--storage/innobase/include/univ.i4
-rw-r--r--storage/innobase/row/row0row.c8
-rw-r--r--storage/innobase/row/row0vers.c16
-rw-r--r--storage/innobase/trx/trx0rec.c4
-rw-r--r--storage/innodb_plugin/btr/btr0cur.c4
-rw-r--r--storage/innodb_plugin/include/rem0rec.h4
-rw-r--r--storage/innodb_plugin/include/rem0rec.ic4
-rw-r--r--storage/innodb_plugin/include/univ.i2
-rw-r--r--storage/innodb_plugin/row/row0row.c8
-rw-r--r--storage/innodb_plugin/row/row0vers.c16
-rw-r--r--storage/innodb_plugin/trx/trx0rec.c4
14 files changed, 44 insertions, 42 deletions
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
index 1d17aa998f6..d5bed3bec99 100644
--- a/storage/innobase/btr/btr0cur.c
+++ b/storage/innobase/btr/btr0cur.c
@@ -1592,9 +1592,9 @@ btr_cur_optimistic_update(
heap = mem_heap_create(1024);
offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
#ifdef UNIV_DEBUG
if (btr_cur_print_record_ops && thr) {
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 67baeb7d8d2..a1a206c3281 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -339,7 +339,7 @@ rec_offs_any_extern(
/*================*/
/* out: TRUE if a field is stored externally */
const ulint* offsets);/* in: array returned by rec_get_offsets() */
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
/********************************************************
Determine if the offsets are for a record containing null BLOB pointers. */
UNIV_INLINE
@@ -351,7 +351,7 @@ rec_offs_any_null_extern(
or NULL if none found */
rec_t* rec, /*!< in: record */
const ulint* offsets); /*!< in: rec_get_offsets(rec) */
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
/***************************************************************
Sets the value of the ith field extern storage bit. */
UNIV_INLINE
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index 566c62e30f2..9e659f12881 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -1021,7 +1021,7 @@ rec_offs_any_extern(
return(FALSE);
}
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
/********************************************************
Determine if the offsets are for a record containing null BLOB pointers. */
UNIV_INLINE
@@ -1055,7 +1055,7 @@ rec_offs_any_null_extern(
return(NULL);
}
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
/***************************************************************
Sets the value of the ith field extern storage bit. */
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index a67b1b3895e..8eb78491b04 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -88,8 +88,8 @@ memory is read outside the allocated blocks. */
#if 0
#define UNIV_DEBUG_VALGRIND /* Enable extra
Valgrind instrumentation */
-#define UNIV_BLOB_LIGHT_DEBUG /* Enable off-page column
- debugging without UNIV_DEBUG */
+#define UNIV_BLOB_NULL_DEBUG /* Enable deep off-page
+ column debugging */
#define UNIV_DEBUG /* Enable ut_ad() assertions */
#define UNIV_LIST_DEBUG /* debug UT_LIST_ macros */
#define UNIV_MEM_DEBUG /* detect memory leaks etc */
diff --git a/storage/innobase/row/row0row.c b/storage/innobase/row/row0row.c
index 247f19e097c..b9efdcfbfdd 100644
--- a/storage/innobase/row/row0row.c
+++ b/storage/innobase/row/row0row.c
@@ -210,13 +210,13 @@ row_build(
ut_ad(rec_offs_validate(rec, index, offsets));
}
-#if 0/* defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG*/
+#if 0 && defined UNIV_BLOB_NULL_DEBUG
/* This one can fail in trx_rollback_or_clean_all_without_sess()
if the server crashed during an insert before the
btr_store_big_rec_extern_fields() did mtr_commit()
all BLOB pointers to the clustered index record. */
ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* 0 && UNIV_BLOB_NULL_DEBUG */
if (type != ROW_COPY_POINTERS) {
/* Take a copy of rec to heap */
@@ -310,10 +310,10 @@ row_rec_to_index_entry(
rec = rec_copy(buf, rec, offsets);
/* Avoid a debug assertion in rec_offs_validate(). */
rec_offs_make_valid(rec, index, offsets);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
} else {
ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
}
rec_len = rec_offs_n_fields(offsets);
diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c
index 906b46fb51b..a52ef3cc083 100644
--- a/storage/innobase/row/row0vers.c
+++ b/storage/innobase/row/row0vers.c
@@ -473,10 +473,10 @@ row_vers_build_for_consistent_read(
/* The view already sees this version: we can
copy it to in_heap and return */
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#if defined UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(
version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
buf = mem_heap_alloc(in_heap,
rec_offs_size(*offsets));
@@ -511,9 +511,9 @@ row_vers_build_for_consistent_read(
*offsets = rec_get_offsets(prev_version, index, *offsets,
ULINT_UNDEFINED, offset_heap);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(prev_version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
trx_id = row_get_rec_trx_id(prev_version, index, *offsets);
@@ -615,9 +615,9 @@ row_vers_build_for_semi_consistent_read(
/* We found a version that belongs to a
committed transaction: return it. */
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
if (rec == version) {
*old_vers = rec;
@@ -676,9 +676,9 @@ row_vers_build_for_semi_consistent_read(
version = prev_version;
*offsets = rec_get_offsets(version, index, *offsets,
ULINT_UNDEFINED, offset_heap);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
}/* for (;;) */
if (heap) {
diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c
index 730ac6a6f60..2a9224b0a72 100644
--- a/storage/innobase/trx/trx0rec.c
+++ b/storage/innobase/trx/trx0rec.c
@@ -1397,9 +1397,9 @@ trx_undo_prev_version_build(
return(DB_ERROR);
}
-# if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+# ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(rec, offsets));
-# endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+# endif /* UNIV_BLOB_NULL_DEBUG */
if (row_upd_changes_field_size_or_external(index, offsets, update)) {
ulint* ext_vect;
diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c
index ea59fe9d025..84ba0b99e58 100644
--- a/storage/innodb_plugin/btr/btr0cur.c
+++ b/storage/innodb_plugin/btr/btr0cur.c
@@ -1871,9 +1871,9 @@ btr_cur_optimistic_update(
heap = mem_heap_create(1024);
offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
#ifdef UNIV_DEBUG
if (btr_cur_print_record_ops && thr) {
diff --git a/storage/innodb_plugin/include/rem0rec.h b/storage/innodb_plugin/include/rem0rec.h
index 06de23be757..fff44eecb00 100644
--- a/storage/innodb_plugin/include/rem0rec.h
+++ b/storage/innodb_plugin/include/rem0rec.h
@@ -480,7 +480,7 @@ ulint
rec_offs_any_extern(
/*================*/
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
/******************************************************//**
Determine if the offsets are for a record containing null BLOB pointers.
@return first field containing a null BLOB pointer, or NULL if none found */
@@ -491,7 +491,7 @@ rec_offs_any_null_extern(
const rec_t* rec, /*!< in: record */
const ulint* offsets) /*!< in: rec_get_offsets(rec) */
__attribute__((nonnull, warn_unused_result));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
/******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec.
@return nonzero if externally stored */
diff --git a/storage/innodb_plugin/include/rem0rec.ic b/storage/innodb_plugin/include/rem0rec.ic
index 7cff36fee6c..252484a7433 100644
--- a/storage/innodb_plugin/include/rem0rec.ic
+++ b/storage/innodb_plugin/include/rem0rec.ic
@@ -1088,7 +1088,7 @@ rec_offs_any_extern(
return(UNIV_UNLIKELY(*rec_offs_base(offsets) & REC_OFFS_EXTERNAL));
}
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
/******************************************************//**
Determine if the offsets are for a record containing null BLOB pointers.
@return first field containing a null BLOB pointer, or NULL if none found */
@@ -1124,7 +1124,7 @@ rec_offs_any_null_extern(
return(NULL);
}
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
/******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec.
diff --git a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i
index 6ac227a59a6..63d8e7140b5 100644
--- a/storage/innodb_plugin/include/univ.i
+++ b/storage/innodb_plugin/include/univ.i
@@ -179,6 +179,8 @@ command. Not tested on Windows. */
debugging without UNIV_DEBUG */
#define UNIV_BLOB_LIGHT_DEBUG /* Enable off-page column
debugging without UNIV_DEBUG */
+#define UNIV_BLOB_NULL_DEBUG /* Enable deep off-page
+ column debugging */
#define UNIV_DEBUG /* Enable ut_ad() assertions
and disable UNIV_INLINE */
#define UNIV_DEBUG_LOCK_VALIDATE /* Enable
diff --git a/storage/innodb_plugin/row/row0row.c b/storage/innodb_plugin/row/row0row.c
index 80b449a416b..8aba375d046 100644
--- a/storage/innodb_plugin/row/row0row.c
+++ b/storage/innodb_plugin/row/row0row.c
@@ -231,13 +231,13 @@ row_build(
ut_ad(rec_offs_validate(rec, index, offsets));
}
-#if 0 /* defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG */
+#if 0 && defined UNIV_BLOB_NULL_DEBUG
/* This one can fail in trx_rollback_active() if
the server crashed during an insert before the
btr_store_big_rec_extern_fields() did mtr_commit()
all BLOB pointers to the clustered index record. */
ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* 0 && UNIV_BLOB_NULL_DEBUG */
if (type != ROW_COPY_POINTERS) {
/* Take a copy of rec to heap */
@@ -423,10 +423,10 @@ row_rec_to_index_entry(
rec = rec_copy(buf, rec, offsets);
/* Avoid a debug assertion in rec_offs_validate(). */
rec_offs_make_valid(rec, index, offsets);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
} else {
ut_a(!rec_offs_any_null_extern(rec, offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
}
entry = row_rec_to_index_entry_low(rec, index, offsets, n_ext, heap);
diff --git a/storage/innodb_plugin/row/row0vers.c b/storage/innodb_plugin/row/row0vers.c
index 8a7bb842293..2d39f92d18f 100644
--- a/storage/innodb_plugin/row/row0vers.c
+++ b/storage/innodb_plugin/row/row0vers.c
@@ -550,10 +550,10 @@ row_vers_build_for_consistent_read(
/* The view already sees this version: we can
copy it to in_heap and return */
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(
version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
buf = mem_heap_alloc(in_heap,
rec_offs_size(*offsets));
@@ -588,9 +588,9 @@ row_vers_build_for_consistent_read(
*offsets = rec_get_offsets(prev_version, index, *offsets,
ULINT_UNDEFINED, offset_heap);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(prev_version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
trx_id = row_get_rec_trx_id(prev_version, index, *offsets);
@@ -691,9 +691,9 @@ row_vers_build_for_semi_consistent_read(
/* We found a version that belongs to a
committed transaction: return it. */
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
if (rec == version) {
*old_vers = rec;
@@ -752,9 +752,9 @@ row_vers_build_for_semi_consistent_read(
version = prev_version;
*offsets = rec_get_offsets(version, index, *offsets,
ULINT_UNDEFINED, offset_heap);
-#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+#ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(version, *offsets));
-#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+#endif /* UNIV_BLOB_NULL_DEBUG */
}/* for (;;) */
if (heap) {
diff --git a/storage/innodb_plugin/trx/trx0rec.c b/storage/innodb_plugin/trx/trx0rec.c
index 9f2fd59d82b..297838365d5 100644
--- a/storage/innodb_plugin/trx/trx0rec.c
+++ b/storage/innodb_plugin/trx/trx0rec.c
@@ -1577,9 +1577,9 @@ trx_undo_prev_version_build(
return(DB_ERROR);
}
-# if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+# ifdef UNIV_BLOB_NULL_DEBUG
ut_a(!rec_offs_any_null_extern(rec, offsets));
-# endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+# endif /* UNIV_BLOB_NULL_DEBUG */
if (row_upd_changes_field_size_or_external(index, offsets, update)) {
ulint n_ext;