Commit 95d7d87c authored by marko's avatar marko

branches/innodb+: Fix Issue #112, which was introduced in r2962 and

reintroduced in r2970.

ibuf_get_volume_buffered_hash(): Add the parameters "types" and "data".
The bug was that "types" lacked the offset IBUF_REC_INFO_SIZE, and the
type information would be read from the wrong place.
parent 58d342c9
......@@ -2535,19 +2535,18 @@ ibuf_get_volume_buffered_hash(
/* out: TRUE if a new record,
FALSE if possible duplicate */
const rec_t* rec, /* in: ibuf record in post-4.1 format */
const byte* types, /* in: fields */
const byte* data, /* in: start of user record data */
byte* hash, /* in/out: hash array */
ulint size) /* in: size of hash array, in bytes */
{
ulint len;
ulint fold;
const byte* types;
ulint types_len;
ulint bitmask;
types = rec_get_nth_field_old(rec, 3, &types_len);
len = ibuf_rec_get_size(rec, types, rec_get_n_fields_old(rec) - 4,
FALSE);
fold = ut_fold_binary(types + types_len, len);
fold = ut_fold_binary(data, len);
hash += (fold / 8) % size;
bitmask = 1 << (fold % 8);
......@@ -2619,7 +2618,10 @@ ibuf_get_volume_buffered_count(
case IBUF_OP_DELETE_MARK:
/* There must be a record to delete-mark.
See if this record has been already buffered. */
if (ibuf_get_volume_buffered_hash(rec, hash, size)) {
if (ibuf_get_volume_buffered_hash(rec,
field + IBUF_REC_INFO_SIZE,
field + len,
hash, size)) {
(*n_recs)++;
}
break;
......
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