apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Turk" <mt...@mappingsoft.com>
Subject RE: [PATCH] apr_dbm -- db fix
Date Mon, 17 Sep 2001 18:55:21 GMT
> -----Original Message-----
> From: Ian Holsman [mailto:ianh@cnet.com]
> Sent: Monday, September 17, 2001 8:43 PM
> To: Mladen Turk
> Cc: APR Dev List
> how does this patch affect db3?

Currently you are returning data insted of key in apr_dbm_nextkey.
RETURN_DATUM should copy key to key not data.
So this patch fixes db1, db2 and db3

> > Index: apr_dbm.c
> > ===================================================================
> > RCS file: /home/cvspublic/apr-util/dbm/apr_dbm.c,v
> > retrieving revision 1.27
> > diff -u -r1.27 apr_dbm.c
> > --- apr_dbm.c	2001/08/29 18:34:05	1.27
> > +++ apr_dbm.c	2001/09/17 18:25:58
> > @@ -257,6 +257,10 @@
> > 
> >  #if DB_VER == 1
> >      dberr = (*f->bdb->seq)(f->bdb, pkey, &data, R_NEXT);
> > +    if (dberr == RET_SPECIAL) {
> > +        pkey->data = NULL;
> > +        pkey->size = 0;
> > +    }
> >  #else
> >      if (f->curs == NULL)
> >          return APR_EINVAL;
> > @@ -553,7 +557,7 @@
> > 
> >      CONVERT_DATUM(ckey, pkey);
> >      rv = APR_DBM_NEXTKEY(dbm->file, ckey, rd);
> > -    RETURN_DATUM(pkey, rd);
> > +    RETURN_DATUM(pkey, ckey);
> > 
> >      REGISTER_CLEANUP(dbm, pkey);
> > 
> > 
> > MT.
> -- 
> Ian Holsman          IanH@cnet.com
> Performance Measurement & Analysis
> CNET Networks   -   (415) 364-8608
> 
> 
> 

Mime
View raw message