summaryrefslogtreecommitdiffstats
path: root/Modules/_bsddb.c
Commit message (Collapse)AuthorAgeFilesLines
* fix issue2858: potential memory corruption when any of the bsddb.db.*Gregory P. Smith2008-05-171-7/+5
| | | | constructors raised an exception. backportes from trunk c63403.
* backport r60544 from trunk:Gregory P. Smith2008-02-031-2/+6
| | | | | | | | 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.
* * fix failing test_recno.py - backport from trunk.Gregory P. Smith2007-11-071-1/+1
| | | | * bump _bsddb patch version number.
* Backport r58757, r58758, r58759.Gregory P. Smith2007-11-011-1/+3
| | | | | | | | | | | | | | | | | | | | Undoes incorrect dbtables fix and errant strdup introduced as described below: r58757 | gregory.p.smith | 2007-11-01 14:08:14 -0700 (Thu, 01 Nov 2007) | 4 lines 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. r58758 | gregory.p.smith | 2007-11-01 14:15:36 -0700 (Thu, 01 Nov 2007) | 3 lines Undo revision 58533 58534 fixes. Those were a workaround for a problem introduced by 58385. r58759 | gregory.p.smith | 2007-11-01 14:17:47 -0700 (Thu, 01 Nov 2007) | 2 lines false "fix" undone as correct problem was found and fixed.
* Backport 58385 from trunk: fix a double free bug in the _bsddb moduleGregory P. Smith2007-10-091-1/+13
| | | | on DBCursor.get (and a friends) when passing in a string key.
* Backport rev 58343: fix DBSequence.get_key() to not crash/fail/etc.Gregory P. Smith2007-10-061-1/+7
|
* Backout the original 'fix' to 1721309 which had no effect.Neal Norwitz2007-05-201-5/+9
| | | | | | | | | 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.
* Backport rev 55452:Neal Norwitz2007-05-191-1/+1
| | | | | Whoops, need to pay attention to those test failures. Move the clear to *before* the first use, not after.
* Backport rev 55450:Neal Norwitz2007-05-191-0/+1
| | | | SF bug #1721309: Clear data so random memory does not get freed.
* support linking the _bsddb extension module against BerkeleyDB 4.5Gregory P. Smith2007-01-051-1/+9
| | | | [backport of r53252]
* Backport of 52811:Neal Norwitz2006-11-211-2/+0
| | | | | | | | | 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.
* fix: DB.stat flags and txn keyword arguments were backwards.Gregory P. Smith2006-09-301-2/+2
|
* Handle malloc and fopen failures more gracefully.Neal Norwitz2006-08-131-2/+8
| | | | Klocwork 180-181
* - 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.