Commit Graph

120 Commits

Author SHA1 Message Date
Stefan Krah 7711273ce8 Use bitwise instead of logical or for flags. 2011-09-15 22:56:00 +02:00
Jesus Cea bf088f811c Issue #9675: Final touch 2010-11-08 12:57:59 +00:00
Jesus Cea 84f2c325c3 Issue #9675: better error handling in bsddb 2010-11-05 00:13:50 +00:00
Antoine Pitrou c83ea137d7 Untabify C files. Will watch buildbots. 2010-05-09 14:46:46 +00:00
Jesus Cea 6557aac599 pybsddb 4.8.4 integration. Please, comment in issue #8156 2010-03-22 14:22:26 +00:00
Matthias Klose 54cc539a2b - Issue #6949: Allow the _bsddb extension to be built with db-4.8.x. 2010-03-15 12:46:18 +00:00
Florent Xicluna e7901c5ebb #7808: Fix reference leaks in _bsddb and related tests. 2010-03-01 20:45:01 +00:00
Jesus Cea 5cd5f12a48 Bugfix for issue3885 and 'DB.verify()' crash.
Reviewed by Nick Coghlan.
2008-09-23 18:54:08 +00:00
Jesus Cea ac25fab12f Fix some leaks - Neal Norwitz 2008-09-03 17:50:32 +00:00
Jesus Cea 4907d27c1f Update bsddb code to version 4.7.3pre2. This code should
be compatible with Python 3.0, also.

  http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.3
2008-08-31 14:00:51 +00:00
Jesus Cea c5a11fabdb bsddb module updated to version 4.7.2devel9.
This patch publishes the work done until now
for Python 3.0 compatibility. Still a lot
to be done.

When possible, we use 3.0 features in Python 2.6,
easing development and testing, and exposing internal
changes to a wider audience, for better test coverage.

Some mode details:
http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.2
2008-07-23 11:38:42 +00:00
Gregory P. Smith 572226cad8 Define macros so that this still compiles on Python prior to r63675. 2008-05-26 19:03:35 +00:00
Christian Heimes 593daf545b Renamed PyString to PyBytes 2008-05-26 12:51:38 +00:00
Jesus Cea ca3939cd52 bsddb module updated to version 4.7.0 2008-05-22 15:27:38 +00:00
Gregory P. Smith 664782e1c8 issue2858: Fix potential memory corruption when bsddb.db.DBEnv.lock_get
and other bsddb.db object constructors raised an exception.
Debugging & patch by Neal Norowitz.
2008-05-17 06:12:02 +00:00
Jesus Cea ef9764f1a4 bsddb module updated to version 4.6.4 2008-05-13 18:45:46 +00:00
Martin v. Löwis 83c9201465 Fix typo. 2008-04-24 13:17:24 +00:00
Gregory P. Smith eeed5b7c22 Merge this fix from the pybsddb tree:
r293 | jcea | 2008-01-31 01:08:19 -0800 (Thu, 31 Jan 2008) | 4 lines

Solved memory leak when using cursors with
databases without environment.
2008-02-03 07:20:53 +00:00
Christian Heimes e93237dfcc #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available. 2007-12-19 02:37:44 +00:00
Gregory P. Smith fc006692ad * db->get_types is only available in BerkeleyDB >= 4.2
* get compiling with older versions of python again for a stand alone release.
2007-11-05 09:06:28 +00:00
Gregory P. Smith ac11e02143 Add the bsddb.db.DBEnv.lock_id_free method.
Improve test_lock's tempdir creation and cleanup.
2007-11-05 02:56:31 +00:00
Gregory P. Smith ec10a4a402 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.
2007-11-05 02:32:26 +00:00
Gregory P. Smith aae141a751 Fix bug introduced in revision 58385. Database keys could no longer
have NULL bytes in them.  Replace the errant strdup with a
malloc+memcpy.  Adds a unit test for the correct behavior.
2007-11-01 21:08:14 +00:00
Neal Norwitz f3ca169bb4 Get this module to compile with bsddb versions prior to 4.3 2007-10-12 03:52:34 +00:00
Neal Norwitz 088beae1f2 Get rid of compiler warning about retval being used (returned) without
being initialized.  (gcc warning and Coverity 202)
2007-10-12 03:01:54 +00:00
Gregory P. Smith 10bed54ae2 Fix a double free when positioning a database cursor to a non-existant
string key (and probably a few other situations with string keys).
This was reported with a patch as pybsddb sourceforge bug 1708868 by
jjjhhhlll at gmail.
2007-10-09 06:50:43 +00:00
Gregory P. Smith 392505391e Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
object available as bsddb.db.api.  This is based on the patch submitted
by Duncan Grisby here:
  http://sourceforge.net/tracker/index.php?func=detail&aid=1551895&group_id=13900&atid=313900
See this thread for additional info:
  http://sourceforge.net/mailarchive/forum.php?thread_name=E1GAVDK-0002rk-Iw%40apasphere.com&forum_name=pybsddb-users

It also cleans up the code a little by removing some ifdef/endifs for
python prior to 2.1 and for unsupported Berkeley DB <= 3.2.
2007-10-09 06:02:21 +00:00
Gregory P. Smith e70be5cbb9 Stab in the dark attempt to fix the test_bsddb3 failure on sparc and S-390
ubuntu buildbots.
2007-10-06 07:48:10 +00:00
Gregory P. Smith f80578548d email address update 2007-09-09 20:25:00 +00:00
Martin v. Löwis 6819210b9e PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00
Neal Norwitz 994ebed50c Backout the original 'fix' to 1721309 which had no effect.
Different versions of Berkeley DB handle this differently.
The comments and bug report should have the details.  Memory is allocated
in 4.4 (and presumably earlier), but not in 4.5.  Thus
4.5 has the free error, but not earlier versions.

Mostly update comments, plus make the free conditional.

This fix was already applied to the 2.5 branch.
2007-06-03 20:32:50 +00:00
Neal Norwitz 4868ef8832 Whoops, need to pay attention to those test failures.
Move the clear to *before* the first use, not after.
2007-05-19 04:34:55 +00:00
Neal Norwitz 59f58aaeed Clear data so random memory does not get freed. Will backport. 2007-05-19 03:48:47 +00:00
Kristján Valur Jónsson bd77c037ed Accomodate 64 bit time_t in the _bsddb module. 2007-04-26 15:24:54 +00:00
Gregory P. Smith 11a70c3c96 bump module version to match supported berkeleydb version 2007-01-05 02:06:17 +00:00
Gregory P. Smith 8b96a35d14 Support linking of the bsddb module against BerkeleyDB 4.5.x
(will backport to 2.5)
2007-01-05 01:59:42 +00:00
Neal Norwitz 4fe442383d Bug #1599782: Fix segfault on bsddb.db.DB().type().
The problem is that _DB_get_type() can't be called without the GIL
because it calls a bunch of PyErr_* APIs when an error occurs.
There were no other cases in this file that it was called without the GIL.
Removing the BEGIN/END THREAD around _DB_get_type() made everything work.

Will backport.
2006-11-21 05:26:22 +00:00
Gregory P. Smith 2fa067982c Fixes a bug with bsddb.DB.stat where the flags and txn keyword
arguments are transposed.  (reported by Louis Zechtzer)
..already committed to release24-maint
..needs committing to release25-maint
2006-09-19 17:35:04 +00:00
Neal Norwitz 5aa96895d8 Handle malloc and fopen failures more gracefully.
Klocwork 180-181
2006-08-13 18:11:43 +00:00
Gregory P. Smith 641cddf0fa - pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
  sleepycat API allows.

Also adds an appropriate test case for DBEnv.dbrename and dbremove.
2006-07-28 01:35:25 +00:00
Neal Norwitz dce937f32c Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.

Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
2006-07-23 08:01:43 +00:00
Neal Norwitz e75cad6125 Fix memory leak reported by valgrind while running test_subprocess 2006-06-17 22:38:15 +00:00
Martin v. Löwis 70ee3ccd1e Get rid of function pointer cast. 2006-06-12 04:26:31 +00:00
Neal Norwitz 09a29fae8f Cleanup Py_ssize_t a little (get rid of second #ifdef) 2006-06-12 02:05:55 +00:00
Neal Norwitz b4fcf8d787 Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
2006-06-11 05:44:18 +00:00
Tim Peters bb21b2c50c BSequence_set_range(): Rev 46688 ("Fix a bunch of
parameter strings") changed this function's signature
seemingly by mistake, which is causing buildbots to fail
test_bsddb3.  Restored the pre-46688 signature.
2006-06-06 15:50:17 +00:00
Neal Norwitz dd2a6bf14f Fix a bunch of parameter strings 2006-06-06 07:23:01 +00:00
Gregory P. Smith 3c228b19f0 - bsddb: the __len__ method of a DB object has been fixed to return correct
results.  It could previously incorrectly return 0 in some cases.
  Fixes SF bug 1493322 (pybsddb bug 1184012).
2006-06-05 23:59:37 +00:00
Gregory P. Smith 372b583a6b * fix DBCursor.pget() bug with keyword argument names when no data= is
supplied [SF pybsddb bug #1477863]
2006-06-05 18:48:21 +00:00
Gregory P. Smith f0547d0d3e * add support for DBSequence objects [patch #1466734] 2006-06-05 17:38:04 +00:00