summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorDebarun Banerjee <debarun.banerjee@oracle.com>2015-06-03 11:43:12 +0530
committerDebarun Banerjee <debarun.banerjee@oracle.com>2015-06-03 11:43:12 +0530
commite59914034ab695035c3fe48f046a96bb98d53044 (patch)
treedf08a349c1664292f74e4bea529b7ded225dbf9c /storage
parent4b8304a9a41c8382d18e084608c33e5c27bec311 (diff)
downloadmariadb-git-e59914034ab695035c3fe48f046a96bb98d53044.tar.gz
BUG#21065746 RQG_PARTN_PRUNING_VALGRIND FAILED IN REM0REC.CC
Problem : --------- This is a regression of Bug#19138298. In purge_node_t::validate_pcur we are trying to get offsets for all columns of clustered index from stored record in persistent cursor. This would fail when stored record is not having all fields of the index. The stored record stores only fields that are needed to uniquely identify the entry. Solution : ---------- 1. Use pcur.old_n_fields to get fields that are stored 2. Add comment to note dependency between stored fields in purge node ref and stored cursor. 3. Return if the cursor record is not already stored as it is not safe to access cursor record directly without latch. Reviewed-by: Marko Makela <marko.makela@oracle.com> RB: 9139
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/row/row0purge.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/storage/innobase/row/row0purge.c b/storage/innobase/row/row0purge.c
index e32f81b4da9..5e6e6b4ca41 100644
--- a/storage/innobase/row/row0purge.c
+++ b/storage/innobase/row/row0purge.c
@@ -823,12 +823,12 @@ Validate the persisent cursor in the purge node. The purge node has two
references to the clustered index record - one via the ref member, and the
other via the persistent cursor. These two references must match each
other if the found_clust flag is set.
-@return true if the persistent cursor is consistent with the ref member.*/
+@return true if the stored copy of persistent cursor is consistent
+with the ref member.*/
ibool
row_purge_validate_pcur(
purge_node_t* node)
{
- const rec_t* rec ;
dict_index_t* clust_index;
ulint* offsets;
int st;
@@ -841,23 +841,25 @@ row_purge_validate_pcur(
return(TRUE);
}
- clust_index = node->pcur.btr_cur.index;
-
- if (node->pcur.old_stored == BTR_PCUR_OLD_STORED) {
- rec = node->pcur.old_rec;
- } else {
- rec = btr_pcur_get_rec(&node->pcur);
+ if (node->pcur.old_stored != BTR_PCUR_OLD_STORED) {
+ return(TRUE);
}
- offsets = rec_get_offsets(rec,
- clust_index, NULL, ULINT_UNDEFINED, &node->heap);
+ clust_index = node->pcur.btr_cur.index;
+
+ offsets = rec_get_offsets(node->pcur.old_rec, clust_index, NULL,
+ node->pcur.old_n_fields, &node->heap);
- st = cmp_dtuple_rec(node->ref, rec, offsets);
+ /* Here we are comparing the purge ref record and the stored initial
+ part in persistent cursor. Both cases we store n_uniq fields of the
+ cluster index and so it is fine to do the comparison. We note this
+ dependency here as pcur and ref belong to different modules. */
+ st = cmp_dtuple_rec(node->ref, node->pcur.old_rec, offsets);
if (st != 0) {
fprintf(stderr, "Purge node pcur validation failed\n");
dtuple_print(stderr, node->ref);
- rec_print(stderr, rec, clust_index);
+ rec_print(stderr, node->pcur.old_rec, clust_index);
return(FALSE);
}