Changeset: fff94a9041d2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fff94a9041d2
Modified Files:
gdk/gdk_select.c
Branch: Jul2015
Log Message:
Off-by-one error.
p is incremented before the number of remaining items is calculated, a
calculation that involves p. Compensate for the early increment.
This fixes bug 3784.
diffs (39 lines):
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -786,7 +786,7 @@ fullscan_str(BAT *b, BAT *s, BAT *bn, co
buninsfix(bn, dst, cnt, o,
(BUN) ((dbl) cnt / (dbl) (p-r)
* (dbl) (q-p) * 1.1 + 1024),
- BATcapacity(bn) + q - p, BUN_NONE);
+ BATcapacity(bn) + q - p + 1,
BUN_NONE);
cnt++;
}
o++;
@@ -801,7 +801,7 @@ fullscan_str(BAT *b, BAT *s, BAT *bn, co
buninsfix(bn, dst, cnt, o,
(BUN) ((dbl) cnt / (dbl) (p-r)
* (dbl) (q-p) * 1.1 + 1024),
- BATcapacity(bn) + q - p, BUN_NONE);
+ BATcapacity(bn) + q - p + 1,
BUN_NONE);
cnt++;
}
o++;
@@ -816,7 +816,7 @@ fullscan_str(BAT *b, BAT *s, BAT *bn, co
buninsfix(bn, dst, cnt, o,
(BUN) ((dbl) cnt / (dbl) (p-r)
* (dbl) (q-p) * 1.1 + 1024),
- BATcapacity(bn) + q - p, BUN_NONE);
+ BATcapacity(bn) + q - p + 1,
BUN_NONE);
cnt++;
}
o++;
@@ -831,7 +831,7 @@ fullscan_str(BAT *b, BAT *s, BAT *bn, co
buninsfix(bn, dst, cnt, o,
(BUN) ((dbl) cnt / (dbl) (p-r)
* (dbl) (q-p) * 1.1 + 1024),
- BATcapacity(bn) + q - p, BUN_NONE);
+ BATcapacity(bn) + q - p + 1,
BUN_NONE);
cnt++;
}
o++;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list