summaryrefslogtreecommitdiffstats
path: root/Modules/_bsddb.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2006-01-24 09:46:48 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2006-01-24 09:46:48 (GMT)
commit29602d2153e56081fad5db19e356e51c37ec2ec8 (patch)
treef6d5ccee866f58a4b00e4378192c9f1652127fbc /Modules/_bsddb.c
parentbab05c96049ddcfabfdf314d60835cc4e245d400 (diff)
downloadcpython-29602d2153e56081fad5db19e356e51c37ec2ec8.zip
cpython-29602d2153e56081fad5db19e356e51c37ec2ec8.tar.gz
cpython-29602d2153e56081fad5db19e356e51c37ec2ec8.tar.bz2
Support for BerkeleyDB 4.4 (tested against 4.4.20 as well as all the
way back thru 3.2). This should be backported to the release24-maint branch.
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r--Modules/_bsddb.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index aa4a161..1047745 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -97,7 +97,7 @@
#error "eek! DBVER can't handle minor versions > 9"
#endif
-#define PY_BSDDB_VERSION "4.3.3"
+#define PY_BSDDB_VERSION "4.4.0"
static char *rcs_id = "$Id$";
@@ -4308,8 +4308,13 @@ DBEnv_lock_stat(DBEnvObject* self, PyObject* args)
#endif
MAKE_ENTRY(nrequests);
MAKE_ENTRY(nreleases);
- MAKE_ENTRY(nnowaits);
+#if (DBVER < 44)
+ MAKE_ENTRY(nnowaits); /* these were renamed in 4.4 */
MAKE_ENTRY(nconflicts);
+#else
+ MAKE_ENTRY(lock_nowait);
+ MAKE_ENTRY(lock_wait);
+#endif
MAKE_ENTRY(ndeadlocks);
MAKE_ENTRY(regsize);
MAKE_ENTRY(region_wait);
@@ -5153,7 +5158,11 @@ DL_EXPORT(void) init_bsddb(void)
ADD_INT(d, DB_LOCK_IREAD);
ADD_INT(d, DB_LOCK_IWR);
#if (DBVER >= 33)
+#if (DBVER < 44)
ADD_INT(d, DB_LOCK_DIRTY);
+#else
+ ADD_INT(d, DB_LOCK_READ_UNCOMMITTED); /* renamed in 4.4 */
+#endif
ADD_INT(d, DB_LOCK_WWRITE);
#endif
@@ -5255,6 +5264,11 @@ DL_EXPORT(void) init_bsddb(void)
ADD_INT(d, DB_MULTIPLE_KEY);
#endif
+#if (DBVER >= 44)
+ ADD_INT(d, DB_READ_UNCOMMITTED); /* replaces DB_DIRTY_READ in 4.4 */
+ ADD_INT(d, DB_READ_COMMITTED);
+#endif
+
#if (DBVER >= 33)
ADD_INT(d, DB_DONOTINDEX);
#endif