36 Commits

Author SHA1 Message Date
Gregory P. Smith
05a24d7fec * closes SF bug/patch 967763
- fixes various memory leaks found by valgrind and a follup closer
    code inspection of the bsddb module.  (merges r1.32 of _bsddb.c
    and an associated test case)
  - also merges the one line r1.37 _bsddb.c fix that fixes a leak on
    the rare DBEnv creation failed error path.
2004-12-19 23:59:51 +00:00
Gregory P. Smith
e2f81fd1b8 fix for SF bug #897820 (backport of cvs diff -r1.14 -r1.15 __init__.py)
Use os.unlink() instead of the BerkeleyDB DB_TRUNCATE flag.
2004-07-13 21:06:51 +00:00
Gregory P. Smith
400363004e Remove the offending added bit of a test case that doesn't apply to
the python 2.3.x branch as the bsddb.set_get_returns_none() default
behaviour is different than on 2.4 and leter.  (yes a correct test
case for this branch could be written; removing this bad test gets
things not-failing fastest)
2004-05-15 21:37:34 +00:00
Gregory P. Smith
8d9363f711 fix bug related to SF bug id 788421 where DBC.set_range() could call
free() on something it did not allocate for non B-Tree based databases.
2004-03-16 07:47:45 +00:00
Gregory P. Smith
dd5f37301e Fixes SF bsddb module bug 788421:
* Fixed a bug in the compatibility interface set_location() method
   where it would not properly search to the next nearest key when
   used on BTree databases.  [SF bug id 788421]
 * Fixed a bug in the compatibility interface set_location() method
   where it could crash when looking up keys in a hash or recno
   format database due to an incorrect free().
2004-02-26 10:21:13 +00:00
Gregory P. Smith
2c627c44f3 simplify some import statements and clean up a docstring and BerkeleyDB library
version check to mention that we support versions 3.2 - 4.2.
2003-09-21 23:18:29 +00:00
Raymond Hettinger
6a5596cc52 Backport Greg's patch (1.7 to 1.8) for backwards code compatability. 2003-09-21 04:51:46 +00:00
Raymond Hettinger
4737992e8c Fix documentation bugs.
Add support for iterators and other mapping methods.
Convert tests to unittest format and expand their coverage.
2003-09-16 21:42:13 +00:00
Barry Warsaw
e3ea281280 readerThread(): Add max_retries to both DeadlockWrap() calls. This
may cause some tests to fail but it prevents them from hanging.
2003-07-21 23:01:34 +00:00
Barry Warsaw
e676c5ef3e test01_join(): Fix a test failure when run with "python -O". The
setting of sCursor happened in an assert.
2003-07-21 18:43:33 +00:00
Gregory P. Smith
ad30fa03a4 fix to work on python <= 2.1 2003-07-09 05:33:14 +00:00
Gregory P. Smith
df35beed40 bugfix: proper import bsddb exists below 2003-07-09 05:29:24 +00:00
Gregory P. Smith
455d46f0d9 bsddb 4.1.6:
* Extended DB & DBEnv set_get_returns_none functionality to take a
   "level" instead of a boolean flag.  The boolean 0 and 1 values still
   have the same effect.  A value of 2 extends the "return None instead
   of raising an exception" behaviour to the DBCursor set methods.
   This will become the default behaviour in pybsddb 4.2.
 * Fixed a typo in DBCursor.join_item method that made it crash instead
   of returning a value.  Obviously nobody uses it.  Wrote a test case
   for join and join_item.
2003-07-09 04:45:59 +00:00
Gregory P. Smith
bc6e94a0fa Wrap the cursor functions with dbutils.DeadlockWrap to deal with the
expected DBLockDeadLockErrors.
2003-05-28 08:26:43 +00:00
Tim Peters
0eadaac7dc Whitespace normalization. 2003-04-24 16:02:54 +00:00
Gregory P. Smith
fe11d3e0d4 Adds support for the DBEnv->set_timeout() method. 2003-03-27 17:23:29 +00:00
Barry Warsaw
9914227caa Fix compatibility for earlier versions of Python (than 2.3), which
doesn't have UserDict.DictMixin.
2003-02-08 03:18:58 +00:00
Raymond Hettinger
30a634e0a9 SF patch #674396: Apply UserDict.DictMixin to expand dbshelve and dbojb
to have a full dictionary interface.
2003-02-05 04:12:41 +00:00
Gregory P. Smith
bc2adef898 fix for use on python 2.1 2003-02-03 04:19:40 +00:00
Barry Warsaw
f71de3e9a0 Everything worked in both the distutils distro and in Python 2.3cvs,
so merge from the bsddb-bsddb3-schizo-branch back to the trunk.
2003-01-28 17:20:44 +00:00
Gregory P. Smith
b6c9f78074 bugfix: do not double-close DB cursor during deallocation when the
underlying DB has already been closed (and thus all of its cursors).
        This fixes a potential segfault.
        SF pybsddb bug id 667343
bugfix: close the DB object when raising an exception due to an error
        during DB.open.  This prevents an exception when closing the
        environment about not all databases being closed.
        SF pybsddb bug id 667340
2003-01-17 08:42:50 +00:00
Gregory P. Smith
c25fd3fb48 bugfix: disallow use of DB_TXN after commit() or abort(), prevents a
coredump or segmentation violation.

Sourceforge patch ID 664896:
http://sourceforge.net/tracker/index.php?func=detail&aid=664896&group_id=13900&atid=313900

The bug was reported on the pybsddb-users mailing list.
2003-01-17 07:52:59 +00:00
Barry Warsaw
9149aeb842 Python 2.1's string module doesn't have ascii_letters, so let's just
hard code it.  We want this module to work with Python 2.1 for now.
2003-01-10 19:28:15 +00:00
Barry Warsaw
a21bdeae51 Cleanups, and conversion of assert to assertEqual() 2003-01-10 19:03:29 +00:00
Barry Warsaw
b1dcbd223e Make two tests non-locale-dependent 2002-12-31 19:27:45 +00:00