platform/upstream/lmdb.git
8 years agoITS#8263 streamline prev patch
Hallvard Furuseth [Sun, 11 Oct 2015 20:40:49 +0000 (21:40 +0100)]
ITS#8263 streamline prev patch

8 years agoITS#8263 fix cursor tracking in cursor_put
Howard Chu [Wed, 7 Oct 2015 05:30:58 +0000 (06:30 +0100)]
ITS#8263 fix cursor tracking in cursor_put

8 years agoITS#8264 fix cursor_del cursor tracking
Howard Chu [Tue, 6 Oct 2015 06:57:14 +0000 (07:57 +0100)]
ITS#8264 fix cursor_del cursor tracking

Some destination fixups need to happen immediately after nodes
are moved, before rebalancing

8 years agoITS#8258 fix rebalance/split
Howard Chu [Sun, 4 Oct 2015 00:56:25 +0000 (01:56 +0100)]
ITS#8258 fix rebalance/split

The tree height can also increase during rebalance, not just shrink.
This can happen if update_key needs to split a parent branch page.

8 years agoFix typo in mdb_tassert().
Hallvard Furuseth [Thu, 1 Oct 2015 17:43:58 +0000 (19:43 +0200)]
Fix typo in mdb_tassert().

No effect on current code.

8 years agoITS#8259 fix usage ordering
Howard Chu [Wed, 30 Sep 2015 17:11:20 +0000 (18:11 +0100)]
ITS#8259 fix usage ordering

8 years agoITS#8221 fix typos
Howard Chu [Tue, 29 Sep 2015 16:31:56 +0000 (17:31 +0100)]
ITS#8221 fix typos

8 years agoITS#8221 cleanup prev commit
Howard Chu [Sun, 27 Sep 2015 21:34:22 +0000 (22:34 +0100)]
ITS#8221 cleanup prev commit

8 years agoITS#8221 don't merge branch pages needlessly
Howard Chu [Sat, 26 Sep 2015 15:50:28 +0000 (16:50 +0100)]
ITS#8221 don't merge branch pages needlessly

8 years agoITS#8256 Create install directories if needed
Luke Yeager [Sat, 19 Sep 2015 01:06:43 +0000 (18:06 -0700)]
ITS#8256 Create install directories if needed

8 years agoITS#8237 fix ITS#7589 regression
Howard Chu [Sun, 6 Sep 2015 18:18:19 +0000 (19:18 +0100)]
ITS#8237 fix ITS#7589 regression

8 years agoITS#7377 mdb_env_init_meta(): Catch calloc error
Hallvard Furuseth [Sun, 23 Aug 2015 09:12:45 +0000 (11:12 +0200)]
ITS#7377 mdb_env_init_meta(): Catch calloc error

8 years agoDoc tweak - MDB_RESERVE / DUPSORT incompat
Howard Chu [Sat, 22 Aug 2015 13:00:12 +0000 (14:00 +0100)]
Doc tweak - MDB_RESERVE / DUPSORT incompat

For those people who insist on ignoring the obvious.

8 years agoAnother MDB_APPEND doc tweak
Howard Chu [Fri, 21 Aug 2015 20:40:33 +0000 (21:40 +0100)]
Another MDB_APPEND doc tweak

Missed this in 7ce29b9edbdaf34b7aeb545324008ed4dff62952

8 years agoITS#8069 char* strings on Windows are ASCII
Pavel Medvedev [Wed, 19 Aug 2015 16:19:48 +0000 (17:19 +0100)]
ITS#8069 char* strings on Windows are ASCII

8 years agoITS#8067 add ssize_t typedef for MSVC
Pavel Medvedev [Wed, 19 Aug 2015 15:39:08 +0000 (16:39 +0100)]
ITS#8067 add ssize_t typedef for MSVC

8 years agoBump version to 0.9.16
Howard Chu [Fri, 14 Aug 2015 00:01:40 +0000 (01:01 +0100)]
Bump version to 0.9.16

8 years agoITS#8192 fix typo
Howard Chu [Wed, 29 Jul 2015 23:54:05 +0000 (00:54 +0100)]
ITS#8192 fix typo

8 years agoITS#8192 cleanup unused label on WIN32
Howard Chu [Wed, 29 Jul 2015 19:03:43 +0000 (20:03 +0100)]
ITS#8192 cleanup unused label on WIN32

8 years agoITS#8192 fix reference to EINTR on WIN32 from ITS#8106
Howard Chu [Wed, 29 Jul 2015 19:01:34 +0000 (20:01 +0100)]
ITS#8192 fix reference to EINTR on WIN32 from ITS#8106

8 years agoSimpler mdb_env_write_meta()
Hallvard Furuseth [Sun, 26 Jul 2015 05:20:19 +0000 (07:20 +0200)]
Simpler mdb_env_write_meta()

8 years agoKill magic numbers for NUM_METAS, databases
Hallvard Furuseth [Sun, 26 Jul 2015 05:16:41 +0000 (07:16 +0200)]
Kill magic numbers for NUM_METAS, databases

9 years agoITS#7377 Catch mdb_put() to blocked/read-only txns
Hallvard Furuseth [Sun, 19 Jul 2015 19:44:02 +0000 (21:44 +0200)]
ITS#7377 Catch mdb_put() to blocked/read-only txns

...early enough that txn state is left unchanged.

9 years agoITS#7377 Always notice env error on txn startup.
Hallvard Furuseth [Sun, 19 Jul 2015 19:43:10 +0000 (21:43 +0200)]
ITS#7377 Always notice env error on txn startup.

Move the check to the end of txn startup.  Catches env
breakage which happens while the new txn waits for a lock.

9 years agoCleanup: Drop !mt_dbxs hack, use MDB_TXN_FINISHED
Hallvard Furuseth [Sun, 19 Jul 2015 19:31:54 +0000 (21:31 +0200)]
Cleanup: Drop !mt_dbxs hack, use MDB_TXN_FINISHED

9 years agoCatch most uses of finished/parent txns.
Hallvard Furuseth [Sun, 19 Jul 2015 19:31:25 +0000 (21:31 +0200)]
Catch most uses of finished/parent txns.

* Add MDB_TXN_FINISHED, MDB_TXN_HAS_CHILD, MDB_TXN_BLOCKED.
* Clear mt_numdbs in writers, for TXN_DBI_EXIST() to catch.
  We already do in readers.

9 years agoMove code into mdb_txn_end(). Was mdb_txn_reset0.
Hallvard Furuseth [Sun, 19 Jul 2015 19:30:12 +0000 (21:30 +0200)]
Move code into mdb_txn_end(). Was mdb_txn_reset0.

Side effects:
* Clean txn up a bit even before freeing it.
* Tweak DEBUG output at txn end. Add DEBUG after commit(writer).

9 years agoITS#8200 Fix mdb_midl_shrink() usage, return void
Hallvard Furuseth [Sun, 19 Jul 2015 19:18:31 +0000 (21:18 +0200)]
ITS#8200 Fix mdb_midl_shrink() usage, return void

9 years agoFactor me_metas[toggle] out to mdb_env_pick_meta()
Hallvard Furuseth [Sat, 11 Jul 2015 19:10:33 +0000 (21:10 +0200)]
Factor me_metas[toggle] out to mdb_env_pick_meta()

9 years agoSimpler mdb_node_add()
Hallvard Furuseth [Sat, 11 Jul 2015 19:09:36 +0000 (21:09 +0200)]
Simpler mdb_node_add()

9 years agoITS#8181 Verify that records are/aren't DBs.
Hallvard Furuseth [Sat, 11 Jul 2015 19:01:40 +0000 (21:01 +0200)]
ITS#8181 Verify that records are/aren't DBs.

Except we don't catch the user passing F_SUBDATA to
mdb_cursor_<put/del>, like an internal LMDB call.

9 years agoITS#8190 fix cursor EOF bug
Howard Chu [Tue, 7 Jul 2015 12:41:32 +0000 (13:41 +0100)]
ITS#8190 fix cursor EOF bug

9 years agoMore ESECT declarations
Hallvard Furuseth [Sat, 4 Jul 2015 11:50:21 +0000 (13:50 +0200)]
More ESECT declarations

9 years agoAdd DB_USRVALID, to avoid 'dbi == FREE_DBI' tests
Hallvard Furuseth [Sat, 4 Jul 2015 11:49:12 +0000 (13:49 +0200)]
Add DB_USRVALID, to avoid 'dbi == FREE_DBI' tests

9 years agoSimpler flag/DBI checks and MDB_DEBUG
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:07 +0000 (13:48 +0200)]
Simpler flag/DBI checks and MDB_DEBUG

9 years agoSimpler mdb_drop().
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:06 +0000 (13:48 +0200)]
Simpler mdb_drop().

MDB_DBI_CHANGED(,MAIN_DBI) is never true.

9 years agoSimpler mdb_node_shrink()
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:05 +0000 (13:48 +0200)]
Simpler mdb_node_shrink()

9 years agoSimpler mdb_txn_commit().
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:04 +0000 (13:48 +0200)]
Simpler mdb_txn_commit().

mt_env is always set.
Commit(mt_child) resets mt_child, so parent need not.

9 years agomdb_txn_begin() cleanup
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:03 +0000 (13:48 +0200)]
mdb_txn_begin() cleanup

9 years agomdb_drop0(): Omit scanning DUPSORT sub-DB leaves
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:02 +0000 (13:48 +0200)]
mdb_drop0(): Omit scanning DUPSORT sub-DB leaves

9 years agoUse mdb_cmp_long() for FREE_DBI
Hallvard Furuseth [Sat, 4 Jul 2015 11:48:01 +0000 (13:48 +0200)]
Use mdb_cmp_long() for FREE_DBI

9 years agomdb_env_get_flags(): Hide internal flags
Hallvard Furuseth [Sat, 4 Jul 2015 11:42:41 +0000 (13:42 +0200)]
mdb_env_get_flags(): Hide internal flags

9 years agoITS#7969 Wrap unportable __sync_synchronize in #if
Hallvard Furuseth [Fri, 3 Jul 2015 20:38:50 +0000 (22:38 +0200)]
ITS#7969 Wrap unportable __sync_synchronize in #if

9 years agoRestore support for Posix semaphores
Hallvard Furuseth [Thu, 2 Jul 2015 19:14:56 +0000 (21:14 +0200)]
Restore support for Posix semaphores

9 years agoFix mdb_mutex_t, add mdb_mutexref_t, drop MDB_MUTEX().
Hallvard Furuseth [Thu, 2 Jul 2015 19:06:35 +0000 (21:06 +0200)]
Fix mdb_mutex_t, add mdb_mutexref_t, drop MDB_MUTEX().

Fixes the types of Windows HANDLEs, they became HANDLE*.
MDB_MUTEX() took a magic r/w arg which it's nice to get rid of.

9 years agoAdd MDB_USE_POSIX_MUTEX.
Hallvard Furuseth [Thu, 2 Jul 2015 19:06:27 +0000 (21:06 +0200)]
Add MDB_USE_POSIX_MUTEX.

So far just to help aligning mdb.master and mdb.RE.
We'll make it an option later.

9 years agoCHANGES only belongs in mdb.RE
Howard Chu [Thu, 2 Jul 2015 17:03:36 +0000 (18:03 +0100)]
CHANGES only belongs in mdb.RE

9 years agoBump version to 0.9.15
Howard Chu [Fri, 19 Jun 2015 13:13:43 +0000 (14:13 +0100)]
Bump version to 0.9.15

(not really, since this is the dev/non-release branch)

9 years agoUse ftok() for semget(), and only lower mode bits
Hallvard Furuseth [Tue, 2 Jun 2015 18:51:03 +0000 (20:51 +0200)]
Use ftok() for semget(), and only lower mode bits

9 years agoClarify mdb_env_open() doc of 'mode' param
Hallvard Furuseth [Tue, 2 Jun 2015 18:49:33 +0000 (20:49 +0200)]
Clarify mdb_env_open() doc of 'mode' param

9 years agoITS#8156 Fix MDB_MAXKEYSIZE doc
Hallvard Furuseth [Thu, 28 May 2015 18:51:24 +0000 (20:51 +0200)]
ITS#8156 Fix MDB_MAXKEYSIZE doc

9 years agoITS#8157 mdb_txn_renew0(): init after error checks
Hallvard Furuseth [Wed, 27 May 2015 20:26:54 +0000 (22:26 +0200)]
ITS#8157 mdb_txn_renew0(): init after error checks

9 years agomdb_txn_renew(): Drop pointless diff from mdb.RE.
Hallvard Furuseth [Wed, 27 May 2015 20:23:50 +0000 (22:23 +0200)]
mdb_txn_renew(): Drop pointless diff from mdb.RE.

Makes the code friendlier to "git cherry-pick".

9 years agoSet/clear mp_pad, md_pad (MDB_DUPFIXED data size).
Hallvard Furuseth [Wed, 20 May 2015 02:04:38 +0000 (04:04 +0200)]
Set/clear mp_pad, md_pad (MDB_DUPFIXED data size).

mdb_xcursor_init1(): md_pad is only used when MDB_DUPFIXED.
mdb_page_split():    Copy mp_pad too. Used by mdb_page_list().

9 years agomtest*.c: Fix MDB_NOOVERWRITE, plug cursor leak
Hallvard Furuseth [Wed, 20 May 2015 01:17:47 +0000 (03:17 +0200)]
mtest*.c: Fix MDB_NOOVERWRITE, plug cursor leak

9 years agoITS#8117 Fix MDB_INTEGERDUP keysize doc + md_dcmp
Hallvard Furuseth [Tue, 19 May 2015 18:33:35 +0000 (20:33 +0200)]
ITS#8117 Fix MDB_INTEGERDUP keysize doc + md_dcmp

9 years agoITS#8117 better fix
Howard Chu [Sun, 3 May 2015 06:52:47 +0000 (07:52 +0100)]
ITS#8117 better fix

Don't change mc_dbx because we would need to undo the change if
the txn aborts. Make the fix (for get) match existing code for put.

9 years agoRevert "ITS#8117 cleanup prev commit"
Howard Chu [Sun, 3 May 2015 06:43:11 +0000 (07:43 +0100)]
Revert "ITS#8117 cleanup prev commit"

This reverts commit ce7ba0ceb69fd2cd56d557c1a877d046ec9f246c.

Revert "ITS#8117 fix INTEGERDUP compare"

This reverts commit ed13d4aa59cf06a1bb6b096fe19af63fc6f8737a.

9 years agoITS#8117 cleanup prev commit
Howard Chu [Wed, 29 Apr 2015 16:28:21 +0000 (17:28 +0100)]
ITS#8117 cleanup prev commit

9 years agoITS#8117 fix INTEGERDUP compare
Howard Chu [Wed, 29 Apr 2015 16:12:40 +0000 (17:12 +0100)]
ITS#8117 fix INTEGERDUP compare

9 years agoITS#8109 fix mdb_cursor_del0 on empty DB
Howard Chu [Thu, 23 Apr 2015 04:49:56 +0000 (05:49 +0100)]
ITS#8109 fix mdb_cursor_del0 on empty DB

9 years agoITS#8106 retry writes on EINTR
Howard Chu [Fri, 17 Apr 2015 17:32:54 +0000 (18:32 +0100)]
ITS#8106 retry writes on EINTR

9 years agoITS#8062 also handle subcursors
Howard Chu [Wed, 15 Apr 2015 23:19:40 +0000 (00:19 +0100)]
ITS#8062 also handle subcursors

9 years agoITS#8062 fix rebalance
Howard Chu [Wed, 15 Apr 2015 22:20:55 +0000 (23:20 +0100)]
ITS#8062 fix rebalance

(Probably fixes the ITS, definitely fixes a bug) when collapsing
the root page, fixups of other cursors was incomplete.

9 years agoCleanup mtest* and sample-*.
Hallvard Furuseth [Tue, 14 Apr 2015 18:25:51 +0000 (20:25 +0200)]
Cleanup mtest* and sample-*.

Fix mdb_txn_begin(&read-only txn) calls. Test mdb_env_set_maxreaders().
Rename DBI open/close functions. Move mdb_dbi_close() out of txn.

9 years agoReformat mdb_dbi_open() doc for clarity
Hallvard Furuseth [Tue, 14 Apr 2015 18:24:30 +0000 (20:24 +0200)]
Reformat mdb_dbi_open() doc for clarity

9 years agoCleanup MDB_env.me_txn0.
Hallvard Furuseth [Wed, 8 Apr 2015 19:52:05 +0000 (21:52 +0200)]
Cleanup MDB_env.me_txn0.

More fallout from 4d02c741b120786df1b87ee9ed49c1d3f9bc7522.

9 years agoFix per-txn MDB_NOMETASYNC, MDB_NOSYNC.
Hallvard Furuseth [Wed, 8 Apr 2015 19:51:50 +0000 (21:51 +0200)]
Fix per-txn MDB_NOMETASYNC, MDB_NOSYNC.

Fallout from 4d02c741b120786df1b87ee9ed49c1d3f9bc7522. The flags
were ignored: mdb_txn_renew0/begin cleared and/or did not set them.

9 years agoRenumber MDB_TXN_* flags, simplify flag code
Hallvard Furuseth [Wed, 8 Apr 2015 19:51:16 +0000 (21:51 +0200)]
Renumber MDB_TXN_* flags, simplify flag code

9 years agomdb_txn_renew(): Clear error from previous txn
Hallvard Furuseth [Wed, 8 Apr 2015 19:47:24 +0000 (21:47 +0200)]
mdb_txn_renew(): Clear error from previous txn

9 years agoITS#8062 fix uninit'd cursor index
Howard Chu [Wed, 18 Mar 2015 19:26:21 +0000 (19:26 +0000)]
ITS#8062 fix uninit'd cursor index

9 years agoITS#8066 fix mdb_load with large values
Howard Chu [Thu, 26 Feb 2015 21:36:04 +0000 (21:36 +0000)]
ITS#8066 fix mdb_load with large values

9 years agoHappy New Year
Quanah Gibson-Mount [Thu, 12 Feb 2015 17:17:59 +0000 (11:17 -0600)]
Happy New Year

9 years agoHappy New Year
Quanah Gibson-Mount [Thu, 12 Feb 2015 16:46:33 +0000 (10:46 -0600)]
Happy New Year

9 years agoAlso support NOMETASYNC on txn_begin
Howard Chu [Mon, 2 Feb 2015 10:33:41 +0000 (10:33 +0000)]
Also support NOMETASYNC on txn_begin

9 years agoSupport MDB_NOSYNC on mdb_txn_begin()
Howard Chu [Fri, 30 Jan 2015 09:21:05 +0000 (09:21 +0000)]
Support MDB_NOSYNC on mdb_txn_begin()

9 years agoFix EACCES description
Hallvard Furuseth [Tue, 27 Jan 2015 05:10:57 +0000 (06:10 +0100)]
Fix EACCES description

9 years agoITS#7971 Fix reader allocation and me_numreaders
Hallvard Furuseth [Sat, 17 Jan 2015 05:32:12 +0000 (06:32 +0100)]
ITS#7971 Fix reader allocation and me_numreaders

9 years agomdb_env_set_flags(): Reject CHANGELESS flags.
Hallvard Furuseth [Wed, 14 Jan 2015 07:12:50 +0000 (08:12 +0100)]
mdb_env_set_flags(): Reject CHANGELESS flags.

Reverts part of a2ac10107e2fb845c4a38a339239063ec4407d84.
MDB_ROBUST needed to be accepted, but that flag is gone.

9 years agoFix potential null deref (coverity)
Howard Chu [Tue, 13 Jan 2015 18:47:18 +0000 (18:47 +0000)]
Fix potential null deref (coverity)

9 years agoWhitespace (align with mdb.RE)
Hallvard Furuseth [Mon, 12 Jan 2015 20:02:29 +0000 (21:02 +0100)]
Whitespace (align with mdb.RE)

9 years agoMake SysV semaphores robust. Cleanup MDB_ROBUST.
Hallvard Furuseth [Mon, 12 Jan 2015 20:02:29 +0000 (21:02 +0100)]
Make SysV semaphores robust. Cleanup MDB_ROBUST.

9 years agoITS#8021 doc: Don't mix MDB_WRITEMAP + non-WRITEMAP
Hallvard Furuseth [Mon, 12 Jan 2015 11:19:51 +0000 (12:19 +0100)]
ITS#8021 doc: Don't mix MDB_WRITEMAP + non-WRITEMAP

9 years agoMore cleanup for fdatasync hack
Howard Chu [Mon, 12 Jan 2015 10:38:14 +0000 (10:38 +0000)]
More cleanup for fdatasync hack

9 years agoTweak conditionals for fdatasync hack
Howard Chu [Sun, 11 Jan 2015 11:37:37 +0000 (11:37 +0000)]
Tweak conditionals for fdatasync hack

9 years agoITS#8021 env_sync is invalid in RDONLY env
Howard Chu [Fri, 9 Jan 2015 11:25:07 +0000 (11:25 +0000)]
ITS#8021 env_sync is invalid in RDONLY env

9 years agofdatasync hack, again
Howard Chu [Thu, 8 Jan 2015 12:54:14 +0000 (12:54 +0000)]
fdatasync hack, again

Check for ext3/ext4 fs, then check kernel version.

9 years agoRevert "Note MDB_SAFE_FDATASYNC"
Howard Chu [Thu, 8 Jan 2015 12:17:29 +0000 (12:17 +0000)]
Revert "Note MDB_SAFE_FDATASYNC"

This reverts commit 293d6bb47f7f0d54a45d57ce2be3a9595e806dc0.

Revert "Simpler fdatasync hack"

This reverts commit 9585c012335b2a28fbfdd267bcdeeeea91dc0f08.

9 years agoNote MDB_SAFE_FDATASYNC
Howard Chu [Thu, 8 Jan 2015 11:43:57 +0000 (11:43 +0000)]
Note MDB_SAFE_FDATASYNC

9 years agoSimpler fdatasync hack
Howard Chu [Thu, 8 Jan 2015 11:42:08 +0000 (11:42 +0000)]
Simpler fdatasync hack

9 years agoRevert "Fix prev commit for env_sync0"
Howard Chu [Thu, 8 Jan 2015 11:28:33 +0000 (11:28 +0000)]
Revert "Fix prev commit for env_sync0"

This reverts commit 985bbbbdd5d64e57f55249ffdeb7c08035b240b2.

Revert "Hack for potential ext3/ext4 corruption issue"

This reverts commit 0018eeb2c3b2239c30def9d47c9d194a4ebf35fe.

9 years agoFix prev commit for env_sync0
Howard Chu [Sun, 21 Dec 2014 00:13:50 +0000 (00:13 +0000)]
Fix prev commit for env_sync0

9 years agoHack for potential ext3/ext4 corruption issue
Howard Chu [Thu, 18 Dec 2014 04:38:53 +0000 (04:38 +0000)]
Hack for potential ext3/ext4 corruption issue

Use regular fsync() if we think this commit grew the DB file.

9 years agoFix MDB_APPEND doc
Howard Chu [Mon, 15 Dec 2014 20:40:59 +0000 (20:40 +0000)]
Fix MDB_APPEND doc

We actually compare the new key against the last key, to prevent
corruption.

9 years agomake clean: remove *.lo
Hallvard Furuseth [Sat, 13 Dec 2014 19:35:08 +0000 (20:35 +0100)]
make clean: remove *.lo

9 years agoTry to avoid an invalid datafile after failed init
Hallvard Furuseth [Mon, 8 Dec 2014 08:56:36 +0000 (09:56 +0100)]
Try to avoid an invalid datafile after failed init

9 years agoClarify mdb_dbi_open doc
Howard Chu [Mon, 8 Dec 2014 03:21:09 +0000 (03:21 +0000)]
Clarify mdb_dbi_open doc

The concurrency restriction is on threads within a single process.
Multiple processes can use mdb_dbi_open without affecting each other.

9 years agoC90-compatible code for SysV semaphores
Hallvard Furuseth [Fri, 5 Dec 2014 20:00:21 +0000 (21:00 +0100)]
C90-compatible code for SysV semaphores

9 years agoITS#7987 fix excessive space for single write txn
Leo Yuriev [Fri, 5 Dec 2014 19:30:31 +0000 (19:30 +0000)]
ITS#7987 fix excessive space for single write txn

9 years agoITS#7994 fix prev commit
Howard Chu [Fri, 5 Dec 2014 19:15:41 +0000 (19:15 +0000)]
ITS#7994 fix prev commit

Strip docs promising behaviors that we don't promise to hold.
Strip MDB_txnid_t typedef.