summaryrefslogtreecommitdiffstats
path: root/lib/tdb
Commit message (Collapse)AuthorAgeFilesLines
* tdb: build and run unit tests in tdb/test/Rusty Russell2012-02-141-7/+87
| | | | | | | | | | | | | | | | | | | | Now we can build the test binaries: the CCAN style is to compile everything called "compile_ok*.c", compile and run everything called "run*.c", compile, link with the module, and run everything called "api*.c", and link any other C files (presumably test helpers) into all the tests. Unfortunately, actually passing that between the various parts of wscript is painful, so I open-coded the names. Also, the tests expect to be run in a (temporary) directory they can pollute, with the test directory found in test/ (to find the canned TDB files, for example). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Tue Feb 14 06:53:46 CET 2012 on sn-devel-104
* tdb/test: fix up tests for use in SAMBA tdb code.Rusty Russell2012-02-145-13/+16
| | | | | | | | | | | 1) Make sure we include "tdb_private.h" first, to get the right headers (esp. the correct setting of _FILE_OFFSET_BITS before unistd.h). 2) Fix 3G file test since expand logic has changed. 3) Fix nested transaction test, since default is to allow nesting. 4) Capture fdatasync, which was slowing down transaction expand. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: wean CCAN-style unit tests off of tap.Rusty Russell2012-02-1425-23/+64
| | | | | | | | We could use subunit, but that's overkill. Just print messages when we fail, and use exit status. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: import unit tests from CCAN into tdb/test/Rusty Russell2012-02-1435-1/+2567
| | | | | | | | | | | I pulled tdb into CCAN as an experiment a while ago; it doesn't belong there, but it has accumulated some important unit tests. These are copied from CCAN version init-1486-gc438ec1 with #include "../" changed to #include "../common/". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: make tdb_private.h idempotent.Rusty Russell2012-02-141-0/+3
| | | | | | | | | | The most convenient way to write unit tests in C is to directly #include the C files (CCAN uses this, for example). That works quite well, but it means that tdb_private.h now needs to be protected against multiple inclusions. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* Add "repack" command to tdbtool.Ira Cooper2012-01-071-0/+7
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Jan 7 02:18:41 CET 2012 on sn-devel-104
* Fix compile when TDB_TRACE is enabled.Ira Cooper2012-01-061-1/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jan 6 04:16:41 CET 2012 on sn-devel-104
* tdb: Use tdb_parse_record in tdb_update_hashVolker Lendecke2011-12-251-12/+16
| | | | This avoids a tdb_fetch, thus a malloc/memcpy/free in the tdb_store path
* tdb: don't free old recovery area when expanding if already at EOF.Rusty Russell2011-12-211-17/+30
| | | | | | | | | | | | We allocate a new recovery area by expanding the file. But if the recovery area is already at the end of file (as shown in at least one client case), we can simply expand the record, rather than freeing it and creating a new one. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Wed Dec 21 06:25:40 CET 2011 on sn-devel-104
* tdb: use same expansion factor logic when expanding for new recovery area.Rusty Russell2011-12-213-21/+34
| | | | | | | | | | If we're expanding because the current recovery area is too small, we expand only the amount we need. This can quickly lead to exponential growth when we have a slowly-expanding record (hence a slowly-expanding transaction size). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: Avoid a malloc/memcpy in _tdb_storeVolker Lendecke2011-12-191-17/+8
|
* tdb: be more careful on 4G files.Rusty Russell2011-12-196-23/+53
| | | | | | | | | | | I came across a tdb which had wrapped to 4G + 4K, and the contents had been destroyed by processes which thought it only 4k long. Fix this by checking on open, and making tdb_oob() check for wrap itself. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Mon Dec 19 07:52:01 CET 2011 on sn-devel-104
* tdb: Fix python documentation for tdb moduleAmitay Isaacs2011-12-131-1/+1
|
* Remove unused variable.Jeremy Allison2011-11-241-1/+0
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Nov 24 00:17:41 CET 2011 on sn-devel-104
* Fix a bunch of "warning: variable ‘XXXX’ set but not used ↵Jeremy Allison2011-11-211-3/+1
| | | | | | | [-Wunused-but-set-variable]" warnings from the new gcc. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Nov 21 23:39:08 CET 2011 on sn-devel-104
* waf: Factor checking for undefined symbol flags out into separate method.Jelmer Vernooij2011-11-131-0/+2
| | | | | Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sun Nov 13 19:38:38 CET 2011 on sn-devel-104
* pytdb: Shorter description which fits on a single line.Jelmer Vernooij2011-11-131-1/+2
|
* tdb: Only check for pkg-config file when checking for system tdb.Jelmer Vernooij2011-11-131-1/+1
|
* wafsamba: Only install .pc files if libraries are public.Jelmer Vernooij2011-08-211-3/+1
|
* tdb: Install pkg-config file.Jelmer Vernooij2011-08-211-1/+3
|
* tdb: increment sequence number in tdb_wipe_all().Rusty Russell2011-08-161-0/+2
| | | | | | | | | TDB2 testing revealed that tdb1 doesn't do this. It's minor, but fix it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Tue Aug 16 10:47:41 CEST 2011 on sn-devel-104
* tdb: remove 'EOF' print from tdbrestoreAndrew Tridgell2011-07-211-1/+0
| | | | | | the EOF message is pointless, and makes for noisy scripts Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* tdb2: create tdb2 versions of various testing TDBs.Rusty Russell2011-06-201-21/+42
| | | | | | | Soon, TDB2 will handle tdb1 files, but until then, we substitute. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_store: check returns for 0, not -1.Rusty Russell2011-06-202-4/+4
| | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: enable VALGRIND to remove valgrind noise.Rusty Russell2011-06-081-35/+0
| | | | | | | | | | | | | | Andrew Bartlett complained that valgrind needs --partial-loads-ok=yes otherwise the Jenkins hash makes it complain. My benchmarking here revealed that at least with modern gcc (4.5) and CPU (Intel i5 32 bit) there's no measurable performance penalty for the "correct" code, so rip out the optimized one. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Wed Jun 8 11:05:47 CEST 2011 on sn-devel-104
* lib/tdb/python/tests/simple.py: don't assume TDB ordering.Rusty Russell2011-06-021-1/+3
| | | | | | | | | TDB2 can break this assumption. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Thu Jun 2 12:07:40 CEST 2011 on sn-devel-104
* tdb: fix a build warning.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* Support the 'PYTHON' environment variable.Jelmer Vernooij2011-04-231-0/+1
| | | | | Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Apr 23 04:19:05 CEST 2011 on sn-devel-104
* tdb_backup: avoid transaction on backup file, use lockallSimo Sorce2011-04-191-8/+13
| | | | | | | | Transactions have the side effect of generating bigger files. By removing the transaction files get as much as 30% smaller. Autobuild-User: Simo Sorce <idra@samba.org> Autobuild-Date: Tue Apr 19 23:34:37 CEST 2011 on sn-devel-104
* tdb: make sure we skip over recovery area correctly.Rusty Russell2011-04-193-17/+44
| | | | | | | | | | If it's really the recovery area, we can trust the rec_len field, and don't have to go groping for bitpatterns. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Tue Apr 19 14:15:22 CEST 2011 on sn-devel-104
* tdb_expand: limit the expansion with huge recordsSimo Sorce2011-04-181-5/+20
| | | | | | | ldb can create huge records when saving indexes. Limit the tdb expansion to avoid consuming a lot of memory for no good reason if the record being saved is huge.
* tdb: tdb_repack() only when it's worthwhile.Rusty Russell2011-04-181-6/+31
| | | | | | | | | tdb_repack() is expensive and consumes memory, so we can spend some effort to see if it's worthwhile. In particular, tdbbackup doesn't need to repack: it started with an empty database! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: fix transaction recovery area for converted tdbs.Rusty Russell2011-04-181-2/+4
| | | | | | | | This is why macros are dangerous; these were converting the pointers, not the things pointed to! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb: Fix Coverity ID 2238: SECURE_CODINGVolker Lendecke2011-03-301-24/+24
|
* tdb: Fix Coverity ID 2192: NO_EFFECTVolker Lendecke2011-03-271-1/+1
| | | | (ret < 0) can never be true
* tdb: rename convert_string() to tdb_convert_string()Andrew Tridgell2011-03-251-5/+5
| | | | this prevents a conflict with the convert_string() in samba
* lib: don't install public headers if a private libraryAndrew Tridgell2011-03-151-0/+1
| | | | | for talloc/tevent/tdb, only install headers if we are doing a standalone build
* tdb: use public_headers to install header filesAndrew Tridgell2011-03-151-1/+1
|
* tdb: use system include style for system headersAndrew Tridgell2011-03-151-1/+1
|
* python: use os.environ[] instead of os.putenv()Andrew Tridgell2011-02-221-1/+1
| | | | | | | using os.putenv() causes too much confusion, as it doesn't update os.getenv() Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* tdb: Fix a C++ warningVolker Lendecke2011-02-121-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Feb 12 19:50:55 CET 2011 on sn-devel-104
* build: removed the old autogen.sh and autogen-waf.sh scriptsAndrew Tridgell2011-02-071-11/+0
| | | | | | | for the builds that use waf only, these are no longer needed and just cause confusion Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* tdb: Added doxygen documentation.Andreas Schneider2011-01-193-25/+2454
| | | | | Autobuild-User: Andreas Schneider <asn@samba.org> Autobuild-Date: Wed Jan 19 11:26:34 CET 2011 on sn-devel-104
* waf: ensure "make dist" works from a clean git tree for all librariesAndrew Tridgell2011-01-081-2/+4
| | | | | | | this uses a temporary waf lock file to force the build directory Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Sat Jan 8 02:35:22 CET 2011 on sn-devel-104
* tdbrestore: Update to GPLv3+, remove old FSF address.Jelmer Vernooij2011-01-061-3/+2
|
* s4-python: Only set BASETYPE flag if subclassing is supported.Jelmer Vernooij2011-01-011-1/+1
| | | | | Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Jan 1 03:39:58 CET 2011 on sn-devel-104
* talloc/tdb/tevent: Remove obsolete signatures files.Jelmer Vernooij2011-01-011-61/+0
|
* tdb: add ABI/tdb-1.2.9.sigsStefan Metzmacher2010-12-291-0/+62
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Dec 29 11:26:12 CET 2010 on sn-devel-104
* tdb: tdb_summary() support.Rusty Russell2010-12-297-10/+206
| | | | | Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Wed Dec 29 10:12:05 CET 2010 on sn-devel-104
* tdb: setup TEST_DATA_PREFIX for make testStefan Metzmacher2010-12-271-1/+5
| | | | metze