New upstream version 0.9.24
Ondřej Surý
4 years ago
0 | 0 | LMDB 0.9 Change Log |
1 | 1 | |
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) | |
3 | 16 | Fix MDB_DUPSORT alignment bug (ITS#8819) |
4 | 17 | Fix regression with new db from 0.9.19 (ITS#8760) |
5 | 18 | Fix liblmdb to build on Solaris (ITS#8612) |
0 | Copyright 2011-2018 Howard Chu, Symas Corp. | |
0 | Copyright 2011-2019 Howard Chu, Symas Corp. | |
1 | 1 | All rights reserved. |
2 | 2 | |
3 | 3 | Redistribution and use in source and binary forms, with or without |
134 | 134 | * |
135 | 135 | * @author Howard Chu, Symas Corporation. |
136 | 136 | * |
137 | * @copyright Copyright 2011-2018 Howard Chu, Symas Corp. All rights reserved. | |
137 | * @copyright Copyright 2011-2019 Howard Chu, Symas Corp. All rights reserved. | |
138 | 138 | * |
139 | 139 | * Redistribution and use in source and binary forms, with or without |
140 | 140 | * modification, are permitted only as authorized by the OpenLDAP |
199 | 199 | /** Library minor version */ |
200 | 200 | #define MDB_VERSION_MINOR 9 |
201 | 201 | /** Library patch version */ |
202 | #define MDB_VERSION_PATCH 22 | |
202 | #define MDB_VERSION_PATCH 24 | |
203 | 203 | |
204 | 204 | /** Combine args a,b,c into a single integer for easy version comparisons */ |
205 | 205 | #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) |
209 | 209 | MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH) |
210 | 210 | |
211 | 211 | /** The release date of this library version */ |
212 | #define MDB_VERSION_DATE "March 21, 2018" | |
212 | #define MDB_VERSION_DATE "July 24, 2019" | |
213 | 213 | |
214 | 214 | /** A stringifier for the version info */ |
215 | 215 | #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")" |
369 | 369 | MDB_GET_BOTH, /**< Position at key/data pair. Only for #MDB_DUPSORT */ |
370 | 370 | MDB_GET_BOTH_RANGE, /**< position at key, nearest data. Only for #MDB_DUPSORT */ |
371 | 371 | 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 | |
373 | 373 | from current cursor position. Move cursor to prepare |
374 | 374 | for #MDB_NEXT_MULTIPLE. Only for #MDB_DUPFIXED */ |
375 | 375 | MDB_LAST, /**< Position at last key/data item */ |
378 | 378 | MDB_NEXT, /**< Position at next data item */ |
379 | 379 | MDB_NEXT_DUP, /**< Position at next data item of current key. |
380 | 380 | 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 | |
382 | 382 | from next cursor position. Move cursor to prepare |
383 | 383 | for #MDB_NEXT_MULTIPLE. Only for #MDB_DUPFIXED */ |
384 | 384 | MDB_NEXT_NODUP, /**< Position at first data item of next key */ |
389 | 389 | MDB_SET, /**< Position at specified key */ |
390 | 390 | MDB_SET_KEY, /**< Position at specified key, return key + data */ |
391 | 391 | 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 | |
393 | 393 | a page of duplicate data items. Only for #MDB_DUPFIXED */ |
394 | 394 | } MDB_cursor_op; |
395 | 395 | |
1509 | 1509 | /** @brief Delete current key/data pair |
1510 | 1510 | * |
1511 | 1511 | * 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. | |
1512 | 1516 | * @param[in] cursor A cursor handle returned by #mdb_cursor_open() |
1513 | 1517 | * @param[in] flags Options for this operation. This parameter |
1514 | 1518 | * must be set to 0 or one of the values described here. |
4 | 4 | * BerkeleyDB API, but much simplified. |
5 | 5 | */ |
6 | 6 | /* |
7 | * Copyright 2011-2018 Howard Chu, Symas Corp. | |
7 | * Copyright 2011-2019 Howard Chu, Symas Corp. | |
8 | 8 | * All rights reserved. |
9 | 9 | * |
10 | 10 | * Redistribution and use in source and binary forms, with or without |
3093 | 3093 | * we may be unable to return them to me_pghead. |
3094 | 3094 | */ |
3095 | 3095 | MDB_page *mp = txn->mt_loose_pgs; |
3096 | MDB_ID2 *dl = txn->mt_u.dirty_list; | |
3097 | unsigned x; | |
3096 | 3098 | if ((rc = mdb_midl_need(&txn->mt_free_pgs, txn->mt_loose_count)) != 0) |
3097 | 3099 | return rc; |
3098 | for (; mp; mp = NEXT_LOOSE_PAGE(mp)) | |
3100 | for (; mp; mp = NEXT_LOOSE_PAGE(mp)) { | |
3099 | 3101 | 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 | } | |
3100 | 3131 | txn->mt_loose_pgs = NULL; |
3101 | 3132 | txn->mt_loose_count = 0; |
3102 | 3133 | } |
3959 | 3990 | * and won't map more than the file size. |
3960 | 3991 | * Just set the maxsize right now. |
3961 | 3992 | */ |
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 | |
3963 | 3994 | || !SetEndOfFile(env->me_fd) |
3964 | || SetFilePointer(env->me_fd, 0, NULL, 0) != 0) | |
3995 | || SetFilePointer(env->me_fd, 0, NULL, 0) != 0)) | |
3965 | 3996 | return ErrCode(); |
3966 | 3997 | } |
3967 | 3998 | |
5062 | 5093 | if (env->me_fd != INVALID_HANDLE_VALUE) |
5063 | 5094 | (void) close(env->me_fd); |
5064 | 5095 | if (env->me_txns) { |
5065 | MDB_PID_T pid = env->me_pid; | |
5096 | MDB_PID_T pid = getpid(); | |
5066 | 5097 | /* Clearing readers is done in this function because |
5067 | 5098 | * me_txkey with its destructor must be disabled first. |
5068 | 5099 | * |
8717 | 8748 | * the split so the new page is emptier than the old page. |
8718 | 8749 | * This yields better packing during sequential inserts. |
8719 | 8750 | */ |
8720 | if (nkeys < 20 || nsize > pmax/16 || newindx >= nkeys) { | |
8751 | if (nkeys < 32 || nsize > pmax/16 || newindx >= nkeys) { | |
8721 | 8752 | /* Find split point */ |
8722 | 8753 | psize = 0; |
8723 | 8754 | if (newindx <= split_indx || newindx >= nkeys) { |
67 | 67 | { |
68 | 68 | char *ptr; |
69 | 69 | |
70 | flags = 0; | |
70 | 71 | while (fgets(dbuf.mv_data, dbuf.mv_size, stdin) != NULL) { |
71 | 72 | lineno++; |
72 | 73 | if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) { |
373 | 374 | while(!Eof) { |
374 | 375 | MDB_val key, data; |
375 | 376 | int batch = 0; |
376 | flags = 0; | |
377 | 377 | |
378 | 378 | if (!dohdr) { |
379 | 379 | dohdr = 1; |
2 | 2 | /* $OpenLDAP$ */ |
3 | 3 | /* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
4 | 4 | * |
5 | * Copyright 2000-2018 The OpenLDAP Foundation. | |
5 | * Copyright 2000-2019 The OpenLDAP Foundation. | |
6 | 6 | * Portions Copyright 2001-2018 Howard Chu, Symas Corp. |
7 | 7 | * All rights reserved. |
8 | 8 | * |