David,
Thank you on behalf of all the Subversion developers for your timely
and informative response to the little buglet we found, and for the
O-fficial patch which clears it up.
Mike Pilato
cmpilato@collab.net
PS -- So, uh, when can we expect to see those beautiful Berkeley
sources available via anonymous CVS?  No, wait--I bet you're just
waiting for Subversion to reach 1.0, right? :-)  Thanks again, David.
David Krinsky <krinsky@sleepycat.com> writes:
> > The second set of these reads (after the append of more data) loops
> > forever because the .size field in the result DBT is always set to
> > 100.  Eventually, we get to the point where our offset is off the end
> > of the record, and *still* .size comes back 100.
> 
> Hi, Michael--
> 
> My name is David Krinsky, and I'm an engineer with Sleepycat Software;
> I'll own your Support Request #4164.
> 
> This is a bug we recently found in Berkeley DB;  the problem is that
> we were inconsistent about whether a partial get with a "doff"
> extending past the end of the record would return only the bytes
> available, or return a full dlen bytes and fill any space past the end
> of the record with padding.  Your analysis is exactly correct;  the
> mainline Btree code in 3.2.9 exhibits the former behavior (which we
> decided was correct), but records that are large enough to be put on
> an overflow page use a different code base and do the latter instead.
> 
> The patch you have is correct, but we have committed to the DB sources
> a slightly different version, which allocates only as much memory
> as is needed.  I have attached it below;  it will also be included
> in the next release of Berkeley DB.
> 
> Thanks for your detailed report;  please let us know if you have
> any further questions or problems.
> 
> Regards,
> Dave.
> 
> -- 
> David Krinsky				krinsky@sleepycat.com
> Sleepycat Software			http://www.sleepycat.com
> 
> Index: db/db_overflow.c
> ===================================================================
> RCS file: /b/CVSROOT/db/db/db_overflow.c,v
> retrieving revision 11.32
> diff -c -r11.32 db_overflow.c
> *** db/db_overflow.c	2001/05/17 17:23:49	11.32
> --- db/db_overflow.c	2001/06/14 18:24:01
> ***************
> *** 99,105 ****
>   	 */
>   	if (F_ISSET(dbt, DB_DBT_PARTIAL)) {
>   		start = dbt->doff;
> ! 		needed = dbt->dlen;
>   	} else {
>   		start = 0;
>   		needed = tlen;
> --- 99,110 ----
>   	 */
>   	if (F_ISSET(dbt, DB_DBT_PARTIAL)) {
>   		start = dbt->doff;
> ! 		if (start > tlen)
> ! 			needed = 0;
> ! 		else if (dbt->dlen > tlen - start)
> ! 			needed = tlen - start;
> ! 		else
> ! 			needed = dbt->dlen;
>   	} else {
>   		start = 0;
>   		needed = tlen;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:32 2006