diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2007-11-05 02:32:26 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2007-11-05 02:32:26 (GMT) |
commit | ec10a4a402e5b6845b247f688fc157be45414cdd (patch) | |
tree | 99112af225bd76faa84bad94a826406bf77c7065 /Modules/_bsddb.c | |
parent | 9c466baa014fa32474f338cc153caea8236a0555 (diff) | |
download | cpython-ec10a4a402e5b6845b247f688fc157be45414cdd.zip cpython-ec10a4a402e5b6845b247f688fc157be45414cdd.tar.gz cpython-ec10a4a402e5b6845b247f688fc157be45414cdd.tar.bz2 |
Fixes bug 477182 on pybsddb.sf.net. DB objects now load the flags and
pay attention to them when opening an existing database. This means
that d[] behaves properly even on databases previously created with DB_DUP
or DB_DUPSORT flags to allow duplicate keys.
http://sourceforge.net/tracker/index.php?func=detail&aid=477182&group_id=13900&atid=113900
Do not backport, this bugfix could be considered an API change.
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r-- | Modules/_bsddb.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index d03f72b..95ccb43 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -1836,21 +1836,6 @@ DB_open(DBObject* self, PyObject* args, PyObject* kwargs) return NULL; } -#if 0 && (DBVER >= 41) - if ((!txn) && (txnobj != Py_None) && self->myenvobj - && (self->myenvobj->flags & DB_INIT_TXN)) - { - /* If no 'txn' parameter was supplied (no DbTxn object and None was not - * explicitly passed) but we are in a transaction ready environment: - * add DB_AUTO_COMMIT to allow for older pybsddb apps using transactions - * to work on BerkeleyDB 4.1 without needing to modify their - * DBEnv or DB open calls. - * TODO make this behaviour of the library configurable. - */ - flags |= DB_AUTO_COMMIT; - } -#endif - MYDB_BEGIN_ALLOW_THREADS; #if (DBVER >= 41) err = self->db->open(self->db, txn, filename, dbname, type, flags, mode); @@ -1864,6 +1849,8 @@ DB_open(DBObject* self, PyObject* args, PyObject* kwargs) return NULL; } + self->db->get_flags(self->db, &self->setflags); + self->flags = flags; RETURN_NONE(); } |