[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Support both BDB 4.0 and 4.1

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-10-24 02:02:23 CEST

Branko Čibej wrote:

> Philip Martin wrote:
>
>> Branko ÄŒibej <brane@xbc.nu> writes:
>>
>>
>>
>>> Here's a second version of this patch, slightly cleaned up. I moved
>>> svn_bdb__check_version into its own file, and I realised there's no
>>> need to remember the compile-time DB version in static variables --
>>> those defines are constants, anyway. I also reverted the include of
>>> bdb_compat.h from the headers that didn't use any of its features.
>>>
>>
>>
>> The .dsp bit didn't apply, but what do I care about that gooey stuff :)
>>
>> It still doesn't work over ra_dav, I've built BDB 4.1 with debug so I
>> now know exactly where it's failing:
>>
> [snip gdb-fu]
>
>> The relevant BDB code is
>>
>> if (!TXN_ON(dbenv)) {
>> __db_err(dbenv,
>> "DB_AUTO_COMMIT may not be specified in non-transactional
>> environment");
>> return (EINVAL);
>> }
>>
>>
>> The AUTO_COMMIT flag is added by vt_db_open in apr_dbm_open.c.
>>
>
> Aha! That's an APR bug, then. It's not passing DB_INIT_TXN to
> DB_:ENV->open; compare with libsvn_fs/fs.c:494. In fact, APR doesn't
> seem to be opening an environment at all, si I suspect it shouldn't be
> using DB_AUTO_COMMIT. Well, duh.
>
Philip, could you try this patch?

Index: apr_dbm_berkeleydb.c
===================================================================
RCS file: /home/cvs/apr-util/dbm/apr_dbm_berkeleydb.c,v
retrieving revision 1.20
diff -u -r1.20 apr_dbm_berkeleydb.c
--- apr_dbm_berkeleydb.c 4 Oct 2002 04:25:12 -0000 1.20
+++ apr_dbm_berkeleydb.c 24 Oct 2002 00:00:31 -0000
@@ -199,9 +199,6 @@
         int dberr;
 
 #if DB_VER >= 3
-#if DB_VER == 4
- dbmode |= DB_AUTO_COMMIT;
-#endif
         if ((dberr = db_create(&file.bdb, NULL, 0)) == 0) {
             if ((dberr = (*file.bdb->open)(file.bdb,
 #if DB_VER == 4
@@ -288,11 +285,7 @@
     apr_status_t rv;
     DBT ckey = { 0 };
     DBT cvalue = { 0 };
-#if DB_VER == 4
- int flags = DB_AUTO_COMMIT;
-#else
     int flags = 0;
-#endif
 
     ckey.data = key.dptr;
     ckey.size = key.dsize;
@@ -314,11 +307,7 @@
 {
     apr_status_t rv;
     DBT ckey = { 0 };
-#if DB_VER == 4
- int flags = DB_AUTO_COMMIT;
-#else
     int flags = 0;
-#endif
 
     ckey.data = key.dptr;
     ckey.size = key.dsize;

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 24 02:04:11 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.