Codebase list lmdb / upstream/0.9.24
New upstream version 0.9.24 Ondřej Surý 4 years ago
7 changed file(s) with 65 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
00 LMDB 0.9 Change Log
11
2 LMDB 0.9.22 Release (2018-03-22)
2 LMDB 0.9.24 Release (2019/07/24)
3 ITS#8969 Tweak mdb_page_split
4 ITS#8975 WIN32 fix writemap set_mapsize crash
5 ITS#9007 Fix loose pages in WRITEMAP
6
7 LMDB 0.9.23 Release (2018/12/19)
8 ITS#8756 Fix loose pages in dirty list
9 ITS#8831 Fix mdb_load flag init
10 ITS#8844 Fix mdb_env_close in forked process
11 Documentation
12 ITS#8857 mdb_cursor_del doesn't invalidate cursor
13 ITS#8908 GET_MULTIPLE etc don't change passed in key
14
15 LMDB 0.9.22 Release (2018/03/22)
316 Fix MDB_DUPSORT alignment bug (ITS#8819)
417 Fix regression with new db from 0.9.19 (ITS#8760)
518 Fix liblmdb to build on Solaris (ITS#8612)
0 Copyright 2011-2018 Howard Chu, Symas Corp.
0 Copyright 2011-2019 Howard Chu, Symas Corp.
11 All rights reserved.
22
33 Redistribution and use in source and binary forms, with or without
134134 *
135135 * @author Howard Chu, Symas Corporation.
136136 *
137 * @copyright Copyright 2011-2018 Howard Chu, Symas Corp. All rights reserved.
137 * @copyright Copyright 2011-2019 Howard Chu, Symas Corp. All rights reserved.
138138 *
139139 * Redistribution and use in source and binary forms, with or without
140140 * modification, are permitted only as authorized by the OpenLDAP
199199 /** Library minor version */
200200 #define MDB_VERSION_MINOR 9
201201 /** Library patch version */
202 #define MDB_VERSION_PATCH 22
202 #define MDB_VERSION_PATCH 24
203203
204204 /** Combine args a,b,c into a single integer for easy version comparisons */
205205 #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c))
209209 MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH)
210210
211211 /** The release date of this library version */
212 #define MDB_VERSION_DATE "March 21, 2018"
212 #define MDB_VERSION_DATE "July 24, 2019"
213213
214214 /** A stringifier for the version info */
215215 #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")"
369369 MDB_GET_BOTH, /**< Position at key/data pair. Only for #MDB_DUPSORT */
370370 MDB_GET_BOTH_RANGE, /**< position at key, nearest data. Only for #MDB_DUPSORT */
371371 MDB_GET_CURRENT, /**< Return key/data at current cursor position */
372 MDB_GET_MULTIPLE, /**< Return key and up to a page of duplicate data items
372 MDB_GET_MULTIPLE, /**< Return up to a page of duplicate data items
373373 from current cursor position. Move cursor to prepare
374374 for #MDB_NEXT_MULTIPLE. Only for #MDB_DUPFIXED */
375375 MDB_LAST, /**< Position at last key/data item */
378378 MDB_NEXT, /**< Position at next data item */
379379 MDB_NEXT_DUP, /**< Position at next data item of current key.
380380 Only for #MDB_DUPSORT */
381 MDB_NEXT_MULTIPLE, /**< Return key and up to a page of duplicate data items
381 MDB_NEXT_MULTIPLE, /**< Return up to a page of duplicate data items
382382 from next cursor position. Move cursor to prepare
383383 for #MDB_NEXT_MULTIPLE. Only for #MDB_DUPFIXED */
384384 MDB_NEXT_NODUP, /**< Position at first data item of next key */
389389 MDB_SET, /**< Position at specified key */
390390 MDB_SET_KEY, /**< Position at specified key, return key + data */
391391 MDB_SET_RANGE, /**< Position at first key greater than or equal to specified key. */
392 MDB_PREV_MULTIPLE /**< Position at previous page and return key and up to
392 MDB_PREV_MULTIPLE /**< Position at previous page and return up to
393393 a page of duplicate data items. Only for #MDB_DUPFIXED */
394394 } MDB_cursor_op;
395395
15091509 /** @brief Delete current key/data pair
15101510 *
15111511 * This function deletes the key/data pair to which the cursor refers.
1512 * This does not invalidate the cursor, so operations such as MDB_NEXT
1513 * can still be used on it.
1514 * Both MDB_NEXT and MDB_GET_CURRENT will return the same record after
1515 * this operation.
15121516 * @param[in] cursor A cursor handle returned by #mdb_cursor_open()
15131517 * @param[in] flags Options for this operation. This parameter
15141518 * must be set to 0 or one of the values described here.
44 * BerkeleyDB API, but much simplified.
55 */
66 /*
7 * Copyright 2011-2018 Howard Chu, Symas Corp.
7 * Copyright 2011-2019 Howard Chu, Symas Corp.
88 * All rights reserved.
99 *
1010 * Redistribution and use in source and binary forms, with or without
30933093 * we may be unable to return them to me_pghead.
30943094 */
30953095 MDB_page *mp = txn->mt_loose_pgs;
3096 MDB_ID2 *dl = txn->mt_u.dirty_list;
3097 unsigned x;
30963098 if ((rc = mdb_midl_need(&txn->mt_free_pgs, txn->mt_loose_count)) != 0)
30973099 return rc;
3098 for (; mp; mp = NEXT_LOOSE_PAGE(mp))
3100 for (; mp; mp = NEXT_LOOSE_PAGE(mp)) {
30993101 mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno);
3102 /* must also remove from dirty list */
3103 if (txn->mt_flags & MDB_TXN_WRITEMAP) {
3104 for (x=1; x<=dl[0].mid; x++)
3105 if (dl[x].mid == mp->mp_pgno)
3106 break;
3107 mdb_tassert(txn, x <= dl[0].mid);
3108 } else {
3109 x = mdb_mid2l_search(dl, mp->mp_pgno);
3110 mdb_tassert(txn, dl[x].mid == mp->mp_pgno);
3111 mdb_dpage_free(env, mp);
3112 }
3113 dl[x].mptr = NULL;
3114 }
3115 {
3116 /* squash freed slots out of the dirty list */
3117 unsigned y;
3118 for (y=1; dl[y].mptr && y <= dl[0].mid; y++);
3119 if (y <= dl[0].mid) {
3120 for(x=y, y++;;) {
3121 while (!dl[y].mptr && y <= dl[0].mid) y++;
3122 if (y > dl[0].mid) break;
3123 dl[x++] = dl[y++];
3124 }
3125 dl[0].mid = x-1;
3126 } else {
3127 /* all slots freed */
3128 dl[0].mid = 0;
3129 }
3130 }
31003131 txn->mt_loose_pgs = NULL;
31013132 txn->mt_loose_count = 0;
31023133 }
39593990 * and won't map more than the file size.
39603991 * Just set the maxsize right now.
39613992 */
3962 if (SetFilePointer(env->me_fd, sizelo, &sizehi, 0) != (DWORD)sizelo
3993 if (!(flags & MDB_WRITEMAP) && (SetFilePointer(env->me_fd, sizelo, &sizehi, 0) != (DWORD)sizelo
39633994 || !SetEndOfFile(env->me_fd)
3964 || SetFilePointer(env->me_fd, 0, NULL, 0) != 0)
3995 || SetFilePointer(env->me_fd, 0, NULL, 0) != 0))
39653996 return ErrCode();
39663997 }
39673998
50625093 if (env->me_fd != INVALID_HANDLE_VALUE)
50635094 (void) close(env->me_fd);
50645095 if (env->me_txns) {
5065 MDB_PID_T pid = env->me_pid;
5096 MDB_PID_T pid = getpid();
50665097 /* Clearing readers is done in this function because
50675098 * me_txkey with its destructor must be disabled first.
50685099 *
87178748 * the split so the new page is emptier than the old page.
87188749 * This yields better packing during sequential inserts.
87198750 */
8720 if (nkeys < 20 || nsize > pmax/16 || newindx >= nkeys) {
8751 if (nkeys < 32 || nsize > pmax/16 || newindx >= nkeys) {
87218752 /* Find split point */
87228753 psize = 0;
87238754 if (newindx <= split_indx || newindx >= nkeys) {
6767 {
6868 char *ptr;
6969
70 flags = 0;
7071 while (fgets(dbuf.mv_data, dbuf.mv_size, stdin) != NULL) {
7172 lineno++;
7273 if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) {
373374 while(!Eof) {
374375 MDB_val key, data;
375376 int batch = 0;
376 flags = 0;
377377
378378 if (!dohdr) {
379379 dohdr = 1;
22 /* $OpenLDAP$ */
33 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
44 *
5 * Copyright 2000-2018 The OpenLDAP Foundation.
5 * Copyright 2000-2019 The OpenLDAP Foundation.
66 * Portions Copyright 2001-2018 Howard Chu, Symas Corp.
77 * All rights reserved.
88 *
1010 /* $OpenLDAP$ */
1111 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
1212 *
13 * Copyright 2000-2018 The OpenLDAP Foundation.
13 * Copyright 2000-2019 The OpenLDAP Foundation.
1414 * Portions Copyright 2001-2018 Howard Chu, Symas Corp.
1515 * All rights reserved.
1616 *