Commit b7721c14 authored by marko's avatar marko

branches/innodb+: ibuf_get_volume_buffered_count(), ibuf_get_volume_buffered():

Make n_recs signed.  When the records are processed backwards and the last
buffered operations are deletes, this allows *n_recs to become negative,
as it should.  This should finally put Issue #117 to rest.
parent aaf4432c
...@@ -2575,7 +2575,7 @@ ibuf_get_volume_buffered_count( ...@@ -2575,7 +2575,7 @@ ibuf_get_volume_buffered_count(
const rec_t* rec, /* in: insert buffer record */ const rec_t* rec, /* in: insert buffer record */
byte* hash, /* in/out: hash array */ byte* hash, /* in/out: hash array */
ulint size, /* in: size of hash array, in bytes */ ulint size, /* in: size of hash array, in bytes */
ulint* n_recs) /* in/out: estimated number of records lint* n_recs) /* in/out: estimated number of records
on the page that rec points to */ on the page that rec points to */
{ {
ulint len; ulint len;
...@@ -2647,7 +2647,7 @@ ibuf_get_volume_buffered_count( ...@@ -2647,7 +2647,7 @@ ibuf_get_volume_buffered_count(
break; break;
case IBUF_OP_DELETE: case IBUF_OP_DELETE:
/* A record will be removed from the page. */ /* A record will be removed from the page. */
if (n_recs && *n_recs > 0) { if (n_recs) {
(*n_recs)--; (*n_recs)--;
} }
/* While deleting a record actually frees up space, /* While deleting a record actually frees up space,
...@@ -2698,7 +2698,7 @@ ibuf_get_volume_buffered( ...@@ -2698,7 +2698,7 @@ ibuf_get_volume_buffered(
or BTR_MODIFY_TREE */ or BTR_MODIFY_TREE */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint page_no,/* in: page number of an index page */ ulint page_no,/* in: page number of an index page */
ulint* n_recs, /* in/out: minimum number of records on the lint* n_recs, /* in/out: minimum number of records on the
page after the buffered changes have been page after the buffered changes have been
applied, or NULL to disable the counting */ applied, or NULL to disable the counting */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
...@@ -3154,7 +3154,7 @@ ibuf_insert_low( ...@@ -3154,7 +3154,7 @@ ibuf_insert_low(
dtuple_t* ibuf_entry; dtuple_t* ibuf_entry;
mem_heap_t* heap; mem_heap_t* heap;
ulint buffered; ulint buffered;
ulint min_n_recs; lint min_n_recs;
rec_t* ins_rec; rec_t* ins_rec;
ibool old_bit_value; ibool old_bit_value;
page_t* bitmap_page; page_t* bitmap_page;
......
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