summaryrefslogtreecommitdiffstats
path: root/Modules/_bsddb.c
Commit message (Collapse)AuthorAgeFilesLines
* - pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrenameGregory P. Smith2006-07-281-3/+3
| | | | | | | 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.
* Ensure we don't write beyond errText. I think I got this right, butNeal Norwitz2006-07-231-10/+19
| | | | | | | | | 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.
* Fix memory leak reported by valgrind while running test_subprocessNeal Norwitz2006-06-171-0/+2
|
* Get rid of function pointer cast.Martin v. Löwis2006-06-121-3/+3
|
* Cleanup Py_ssize_t a little (get rid of second #ifdef)Neal Norwitz2006-06-121-5/+2
|
* Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.Neal Norwitz2006-06-111-4/+2
| | | | | We know it's not NULL from the ParseTuple and DbObject_Check will verify it's not NULL.
* BSequence_set_range(): Rev 46688 ("Fix a bunch ofTim Peters2006-06-061-1/+1
| | | | | | parameter strings") changed this function's signature seemingly by mistake, which is causing buildbots to fail test_bsddb3. Restored the pre-46688 signature.
* Fix a bunch of parameter stringsNeal Norwitz2006-06-061-7/+7
|
* - bsddb: the __len__ method of a DB object has been fixed to return correctGregory P. Smith2006-06-051-6/+17
| | | | | results. It could previously incorrectly return 0 in some cases. Fixes SF bug 1493322 (pybsddb bug 1184012).
* * fix DBCursor.pget() bug with keyword argument names when no data= isGregory P. Smith2006-06-051-4/+4
| | | | supplied [SF pybsddb bug #1477863]
* * add support for DBSequence objects [patch #1466734]Gregory P. Smith2006-06-051-6/+455
|
* * support DBEnv.lsn_reset() method on BerkeleyDB >= 4.4 [patch #1494902]Gregory P. Smith2006-06-051-0/+25
|
* * support DBEnv.log_stat() method on BerkeleyDB >= 4.0 [patch #1494885]Gregory P. Smith2006-06-051-0/+68
|
* fix a bug in the previous commit. don't leak empty list on error return andGregory P. Smith2006-06-051-4/+7
| | | | | fix the additional rare (out of memory only) bug that it was supposed to fix of not freeing log_list when the python allocator failed.
* bugfix: when log_archive was called with the DB_ARCH_REMOVE flag presentGregory P. Smith2006-06-051-5/+9
| | | | | | | in BerkeleyDB >= 4.2 it tried to construct a list out of an uninitialized char **log_list. feature: export the DB_ARCH_REMOVE flag by name in the module on BerkeleyDB >= 4.2.
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-4/+4
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* Fix bsddb.db.DBError derived exceptions so they can be unpickled.Gregory P. Smith2006-04-081-6/+22
| | | | | Also adds some backwards compatibility when compiling _bsddb.c on earlier python versions (needed for pybsddb).
* Fix another leak in bsddb, and avoid use of uninitialized value -- funny howThomas Wouters2006-03-121-1/+2
| | | | gcc 4.0.x wasn't complaining about *that* one ;)
* Clean up _bsddb.c: add a couple dozen missing Py_DECREF()'s, a handful ofThomas Wouters2006-03-081-65/+73
| | | | | | | | | | missing PyObject_Del()'s, simplify some code by using Py_BuildValue() instead of creating a tuple with items manually, stop clobbering builtin exceptions in a few places, and guard against NULL-returning functions some more. This fixes 117 of the 780 (!?!#%@#$!!) reference leaks in test_bsddb3. I ain't not done yet, although this review of 5kloc was just the easy part.
* Add additional missing checks for return vals of PyTuple_New().Georg Brandl2006-03-071-66/+65
| | | | Normalize coding style.
* Fix gcc 4.0.x warning about use of uninitialized value.Thomas Wouters2006-03-071-1/+1
|
* Coverity found bug: test result of PyTuple_New() against NULL before use.Thomas Wouters2006-03-071-6/+6
| | | | Will backport.
* Fix DBEnv's set_tx_timestamp wrapper to be slightly more correct onThomas Wouters2006-03-011-4/+5
| | | | | | | | | non-32bit platforms. Will still only allow 32 bits in a timestamp on Win64, but at least it won't crash, and it'll work right on platforms where longs are big enough to contain time_t's. (A better-working, although conceptually less-right fix would have been to use Py_ssize_t here, but Martin and Tim won't let me.)
* Another bit of unconstification.Tim Peters2006-02-281-1/+1
|
* More unconsting.Martin v. Löwis2006-02-271-33/+33
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-3/+3
|
* maintain support for older python versions in this module so that itGregory P. Smith2006-01-301-0/+16
| | | | is ok for a standalone pybsddb source dist for use with <= 2.3.
* Add wrapper for DBEnv.set_tx_timeout method to allow time based DB_RECOVERGregory P. Smith2006-01-271-3/+18
|
* Fix bug #1413192, fix seg fault in bsddb if a txn was deleted before the env.Neal Norwitz2006-01-251-3/+6
| | | | Will backport.
* commits sourceforge patch #1407992 by neil.norwitz.Gregory P. Smith2006-01-241-7/+7
| | | | | | this fixes the bsddb db associate tests when compiled against BerkeleyDB 3.3 thru 4.1. 4.2 thru 4.4 already passed and still pass.
* Support for BerkeleyDB 4.4 (tested against 4.4.20 as well as all theGregory P. Smith2006-01-241-2/+16
| | | | | way back thru 3.2). This should be backported to the release24-maint branch.
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Fix errors on 64-bit platforms. Will backportNeal Norwitz2006-01-051-4/+4
|
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-34/+44
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* Get bsddb module to compile with version 3.2 of BSD DB.Neal Norwitz2005-10-201-0/+8
|
* remove c++ style commentGregory P. Smith2005-06-161-1/+1
|
* change set_bt_compare() callback comparison function to only take twoGregory P. Smith2005-06-061-10/+7
| | | | | arguments (left, right) like any sane comparison function. no need to pass in the db object as an argument.
* additional sanity check. secondaryDB cannot be closed.Gregory P. Smith2005-06-061-0/+1
|
* fixes pybsddb SF bug id 1215432. DB.associate() would crash when aGregory P. Smith2005-06-061-5/+3
| | | | | | DBError was supposed to be raised. needs backport to 2.4.x and possibly 2.3.x.
* pybsddb 4.3.2:Gregory P. Smith2005-06-041-24/+64
| | | | | | | | | | | * the has_key() method was not raising a DBError when a database error had occurred. [SF patch id 1212590] * added a wrapper for the DBEnv.set_lg_regionmax method [SF patch id 1212590] * DBKeyEmptyError now derives from KeyError just like DBNotFoundError. * internally everywhere DB_NOTFOUND was checked for has been updated to also check for DB_KEYEMPTY. This fixes the semantics of a couple operations on recno and queue databases to be more intuitive and results in less unexpected DBKeyEmptyError exceptions being raised.
* pybsddb 4.3.1, adds support for DB.set_bt_compare database btree comparisonGregory P. Smith2005-06-031-1/+163
| | | | | | functions written in python. contributed by <frederic.gobry@epfl.ch>
* fixed compilation against BerkeleyDB 3.2.9 (sf bug # 1077040)Gregory P. Smith2004-12-161-0/+8
|
* * Adds support for building against BerkeleyDB 4.3.21Gregory P. Smith2004-12-131-21/+74
| | | | * bumped the module version number up to 4.3.0
* SF bug 1017405: the keys() values() and items() DB methods wereGregory P. Smith2004-09-041-1/+1
| | | | ignoring their transaction (txn) argument.
* Fix memory leak and bump the version per GregNeal Norwitz2004-07-091-2/+2
|
* Cleanup support for older pythons (perhaps it should be removed?)Neal Norwitz2004-07-091-53/+10
|
* Adds support for DB.pget and DBCursor.pget methods.Gregory P. Smith2004-06-281-3/+198
| | | | | Based on a patch supplied by Ian Ward <ian@arevco.ca> on the pybsddb mailing list 2004-03-26.
* Add weakref support to all bsddb.db objects.Gregory P. Smith2004-06-281-7/+127
| | | | | Make DBTxn objects automatically call abort() in their destructor if not yet finalized and raise a RuntimeWarning to that effect.
* raise the module minor version.Gregory P. Smith2004-06-271-1/+1
|
* SF patch / bug #967763Gregory P. Smith2004-06-271-43/+76
| | | | | | | | | | | | Fix memory leaks revealed by valgrind and ensuing code inspection. In the existing test suite valgrind revealed two memory leaks (DB_get and DBC_set_range). Code inspection revealed that there were many other potential similar leaks (many on odd code error paths such as passing something other than a DBTxn object for a txn= parameter or in the face of an out of memory error). The most common case that would cause a leak was when using recno or queue format databases with integer keys, sometimes only with an exception exit.