lmdb 0.6 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/ext/lmdb_ext/extconf.rb +7 -3
  3. data/ext/lmdb_ext/lmdb_ext.c +120 -110
  4. data/lib/lmdb/version.rb +1 -1
  5. data/lmdb.gemspec +4 -4
  6. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/.gitignore +8 -0
  7. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/COPYRIGHT +1 -1
  8. data/vendor/libraries/liblmdb/Doxyfile +1631 -0
  9. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/LICENSE +0 -0
  10. data/vendor/libraries/liblmdb/Makefile +118 -0
  11. data/vendor/libraries/liblmdb/intro.doc +192 -0
  12. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/lmdb.h +161 -61
  13. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/mdb.c +3244 -1302
  14. data/vendor/libraries/liblmdb/mdb_copy.1 +61 -0
  15. data/vendor/libraries/liblmdb/mdb_copy.c +84 -0
  16. data/vendor/libraries/liblmdb/mdb_drop.1 +40 -0
  17. data/vendor/libraries/liblmdb/mdb_drop.c +135 -0
  18. data/vendor/libraries/liblmdb/mdb_dump.1 +81 -0
  19. data/vendor/libraries/liblmdb/mdb_dump.c +319 -0
  20. data/vendor/libraries/liblmdb/mdb_load.1 +84 -0
  21. data/vendor/libraries/liblmdb/mdb_load.c +492 -0
  22. data/vendor/libraries/liblmdb/mdb_stat.1 +70 -0
  23. data/vendor/libraries/liblmdb/mdb_stat.c +264 -0
  24. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/midl.c +66 -5
  25. data/{ext/lmdb_ext → vendor/libraries}/liblmdb/midl.h +19 -5
  26. data/vendor/libraries/liblmdb/mtest.c +177 -0
  27. data/vendor/libraries/liblmdb/mtest2.c +124 -0
  28. data/vendor/libraries/liblmdb/mtest3.c +133 -0
  29. data/vendor/libraries/liblmdb/mtest4.c +168 -0
  30. data/vendor/libraries/liblmdb/mtest5.c +135 -0
  31. data/vendor/libraries/liblmdb/mtest6.c +141 -0
  32. data/vendor/libraries/liblmdb/sample-bdb.txt +73 -0
  33. data/vendor/libraries/liblmdb/sample-mdb.txt +62 -0
  34. data/vendor/libraries/liblmdb/tooltag +27 -0
  35. metadata +34 -14
  36. data/.gitignore +0 -15
  37. data/.travis.yml +0 -14
  38. data/ext/lmdb_ext/liblmdb/CHANGES +0 -112
@@ -0,0 +1,73 @@
1
+ /* sample-bdb.txt - BerkeleyDB toy/sample
2
+ *
3
+ * Do a line-by-line comparison of this and sample-mdb.txt
4
+ */
5
+ /*
6
+ * Copyright 2012-2021 Howard Chu, Symas Corp.
7
+ * All rights reserved.
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted only as authorized by the OpenLDAP
11
+ * Public License.
12
+ *
13
+ * A copy of this license is available in the file LICENSE in the
14
+ * top-level directory of the distribution or, alternatively, at
15
+ * <http://www.OpenLDAP.org/license.html>.
16
+ */
17
+ #include <stdio.h>
18
+ #include <string.h>
19
+ #include <db.h>
20
+
21
+ int main(int argc,char * argv[])
22
+ {
23
+ int rc;
24
+ DB_ENV *env;
25
+ DB *dbi;
26
+ DBT key, data;
27
+ DB_TXN *txn;
28
+ DBC *cursor;
29
+ char sval[32], kval[32];
30
+
31
+ /* Note: Most error checking omitted for simplicity */
32
+
33
+ #define FLAGS (DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_INIT_MPOOL|DB_CREATE|DB_THREAD)
34
+ rc = db_env_create(&env, 0);
35
+ rc = env->open(env, "./testdb", FLAGS, 0664);
36
+ rc = db_create(&dbi, env, 0);
37
+ rc = env->txn_begin(env, NULL, &txn, 0);
38
+ rc = dbi->open(dbi, txn, "test.bdb", NULL, DB_BTREE, DB_CREATE, 0664);
39
+
40
+ memset(&key, 0, sizeof(DBT));
41
+ memset(&data, 0, sizeof(DBT));
42
+ key.size = sizeof(int);
43
+ key.data = sval;
44
+ data.size = sizeof(sval);
45
+ data.data = sval;
46
+
47
+ sprintf(sval, "%03x %d foo bar", 32, 3141592);
48
+ rc = dbi->put(dbi, txn, &key, &data, 0);
49
+ rc = txn->commit(txn, 0);
50
+ if (rc) {
51
+ fprintf(stderr, "txn->commit: (%d) %s\n", rc, db_strerror(rc));
52
+ goto leave;
53
+ }
54
+ rc = env->txn_begin(env, NULL, &txn, 0);
55
+ rc = dbi->cursor(dbi, txn, &cursor, 0);
56
+ key.flags = DB_DBT_USERMEM;
57
+ key.data = kval;
58
+ key.ulen = sizeof(kval);
59
+ data.flags = DB_DBT_USERMEM;
60
+ data.data = sval;
61
+ data.ulen = sizeof(sval);
62
+ while ((rc = cursor->c_get(cursor, &key, &data, DB_NEXT)) == 0) {
63
+ printf("key: %p %.*s, data: %p %.*s\n",
64
+ key.data, (int) key.size, (char *) key.data,
65
+ data.data, (int) data.size, (char *) data.data);
66
+ }
67
+ rc = cursor->c_close(cursor);
68
+ rc = txn->abort(txn);
69
+ leave:
70
+ rc = dbi->close(dbi, 0);
71
+ rc = env->close(env, 0);
72
+ return rc;
73
+ }
@@ -0,0 +1,62 @@
1
+ /* sample-mdb.txt - MDB toy/sample
2
+ *
3
+ * Do a line-by-line comparison of this and sample-bdb.txt
4
+ */
5
+ /*
6
+ * Copyright 2012-2021 Howard Chu, Symas Corp.
7
+ * All rights reserved.
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted only as authorized by the OpenLDAP
11
+ * Public License.
12
+ *
13
+ * A copy of this license is available in the file LICENSE in the
14
+ * top-level directory of the distribution or, alternatively, at
15
+ * <http://www.OpenLDAP.org/license.html>.
16
+ */
17
+ #include <stdio.h>
18
+ #include "lmdb.h"
19
+
20
+ int main(int argc,char * argv[])
21
+ {
22
+ int rc;
23
+ MDB_env *env;
24
+ MDB_dbi dbi;
25
+ MDB_val key, data;
26
+ MDB_txn *txn;
27
+ MDB_cursor *cursor;
28
+ char sval[32];
29
+
30
+ /* Note: Most error checking omitted for simplicity */
31
+
32
+ rc = mdb_env_create(&env);
33
+ rc = mdb_env_open(env, "./testdb", 0, 0664);
34
+ rc = mdb_txn_begin(env, NULL, 0, &txn);
35
+ rc = mdb_dbi_open(txn, NULL, 0, &dbi);
36
+
37
+ key.mv_size = sizeof(int);
38
+ key.mv_data = sval;
39
+ data.mv_size = sizeof(sval);
40
+ data.mv_data = sval;
41
+
42
+ sprintf(sval, "%03x %d foo bar", 32, 3141592);
43
+ rc = mdb_put(txn, dbi, &key, &data, 0);
44
+ rc = mdb_txn_commit(txn);
45
+ if (rc) {
46
+ fprintf(stderr, "mdb_txn_commit: (%d) %s\n", rc, mdb_strerror(rc));
47
+ goto leave;
48
+ }
49
+ rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
50
+ rc = mdb_cursor_open(txn, dbi, &cursor);
51
+ while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) {
52
+ printf("key: %p %.*s, data: %p %.*s\n",
53
+ key.mv_data, (int) key.mv_size, (char *) key.mv_data,
54
+ data.mv_data, (int) data.mv_size, (char *) data.mv_data);
55
+ }
56
+ mdb_cursor_close(cursor);
57
+ mdb_txn_abort(txn);
58
+ leave:
59
+ mdb_dbi_close(env, dbi);
60
+ mdb_env_close(env);
61
+ return 0;
62
+ }
@@ -0,0 +1,27 @@
1
+ <tagfile>
2
+ <compound kind="page">
3
+ <name>mdb_copy_1</name>
4
+ <title>mdb_copy - environment copy tool</title>
5
+ <filename>mdb_copy.1</filename>
6
+ </compound>
7
+ <compound kind="page">
8
+ <name>mdb_drop_1</name>
9
+ <title>mdb_drop - database delete tool</title>
10
+ <filename>mdb_drop.1</filename>
11
+ </compound>
12
+ <compound kind="page">
13
+ <name>mdb_dump_1</name>
14
+ <title>mdb_dump - environment export tool</title>
15
+ <filename>mdb_dump.1</filename>
16
+ </compound>
17
+ <compound kind="page">
18
+ <name>mdb_load_1</name>
19
+ <title>mdb_load - environment import tool</title>
20
+ <filename>mdb_load.1</filename>
21
+ </compound>
22
+ <compound kind="page">
23
+ <name>mdb_stat_1</name>
24
+ <title>mdb_stat - environment status tool</title>
25
+ <filename>mdb_stat.1</filename>
26
+ </compound>
27
+ </tagfile>
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lmdb
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mendler
8
+ - Dorian Taylor
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2022-05-27 00:00:00.000000000 Z
12
+ date: 2022-06-09 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
@@ -67,14 +68,12 @@ dependencies:
67
68
  - !ruby/object:Gem::Version
68
69
  version: '1.0'
69
70
  description: lmdb is a Ruby binding to OpenLDAP Lightning MDB.
70
- email: mail@daniel-mendler.de
71
+ email: code@doriantaylor.com
71
72
  executables: []
72
73
  extensions:
73
74
  - ext/lmdb_ext/extconf.rb
74
75
  extra_rdoc_files: []
75
76
  files:
76
- - ".gitignore"
77
- - ".travis.yml"
78
77
  - CHANGES
79
78
  - CONTRIBUTORS
80
79
  - Gemfile
@@ -88,14 +87,6 @@ files:
88
87
  - ext/lmdb_ext/errors.h
89
88
  - ext/lmdb_ext/extconf.rb
90
89
  - ext/lmdb_ext/flag_parser.h
91
- - ext/lmdb_ext/liblmdb/.gitignore
92
- - ext/lmdb_ext/liblmdb/CHANGES
93
- - ext/lmdb_ext/liblmdb/COPYRIGHT
94
- - ext/lmdb_ext/liblmdb/LICENSE
95
- - ext/lmdb_ext/liblmdb/lmdb.h
96
- - ext/lmdb_ext/liblmdb/mdb.c
97
- - ext/lmdb_ext/liblmdb/midl.c
98
- - ext/lmdb_ext/liblmdb/midl.h
99
90
  - ext/lmdb_ext/lmdb_ext.c
100
91
  - ext/lmdb_ext/lmdb_ext.h
101
92
  - ext/lmdb_ext/prototypes.sh
@@ -106,7 +97,36 @@ files:
106
97
  - lmdb.gemspec
107
98
  - spec/helper.rb
108
99
  - spec/lmdb_spec.rb
109
- homepage: https://github.com/minad/lmdb
100
+ - vendor/libraries/liblmdb/.gitignore
101
+ - vendor/libraries/liblmdb/COPYRIGHT
102
+ - vendor/libraries/liblmdb/Doxyfile
103
+ - vendor/libraries/liblmdb/LICENSE
104
+ - vendor/libraries/liblmdb/Makefile
105
+ - vendor/libraries/liblmdb/intro.doc
106
+ - vendor/libraries/liblmdb/lmdb.h
107
+ - vendor/libraries/liblmdb/mdb.c
108
+ - vendor/libraries/liblmdb/mdb_copy.1
109
+ - vendor/libraries/liblmdb/mdb_copy.c
110
+ - vendor/libraries/liblmdb/mdb_drop.1
111
+ - vendor/libraries/liblmdb/mdb_drop.c
112
+ - vendor/libraries/liblmdb/mdb_dump.1
113
+ - vendor/libraries/liblmdb/mdb_dump.c
114
+ - vendor/libraries/liblmdb/mdb_load.1
115
+ - vendor/libraries/liblmdb/mdb_load.c
116
+ - vendor/libraries/liblmdb/mdb_stat.1
117
+ - vendor/libraries/liblmdb/mdb_stat.c
118
+ - vendor/libraries/liblmdb/midl.c
119
+ - vendor/libraries/liblmdb/midl.h
120
+ - vendor/libraries/liblmdb/mtest.c
121
+ - vendor/libraries/liblmdb/mtest2.c
122
+ - vendor/libraries/liblmdb/mtest3.c
123
+ - vendor/libraries/liblmdb/mtest4.c
124
+ - vendor/libraries/liblmdb/mtest5.c
125
+ - vendor/libraries/liblmdb/mtest6.c
126
+ - vendor/libraries/liblmdb/sample-bdb.txt
127
+ - vendor/libraries/liblmdb/sample-mdb.txt
128
+ - vendor/libraries/liblmdb/tooltag
129
+ homepage: https://github.com/doriantaylor/rb-lmdb
110
130
  licenses:
111
131
  - MIT
112
132
  metadata: {}
data/.gitignore DELETED
@@ -1,15 +0,0 @@
1
- *.o
2
- *.so
3
- *.bundle
4
- .#*
5
- *.log
6
- *.mdb
7
- Makefile
8
- tmp/
9
- Gemfile.lock
10
- doc/
11
- .yardoc/
12
- *.gem
13
- dtrace/
14
- \#*\#
15
- .\#*
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.8
4
- - 2.4.9
5
- - 2.5.7
6
- - 2.6.3
7
- - 2.7.0
8
- - ruby-head
9
- - rbx
10
- matrix:
11
- allow_failures:
12
- - rvm: ruby-head
13
- - rvm: 2.3.8
14
- - rvm: rbx
@@ -1,112 +0,0 @@
1
- LMDB 0.9 Change Log
2
-
3
- LMDB 0.9.14 Release (2014/09/15)
4
- Fix to support 64K page size (ITS#7713)
5
- Fix to persist decreased as well as increased mapsizes (ITS#7789)
6
- Fix cursor bug when deleting last node of a DUPSORT key
7
- Fix mdb_env_info to return FIXEDMAP address
8
- Fix ambiguous error code from writing to closed DBI (ITS#7825)
9
- Fix mdb_copy copying past end of file (ITS#7886)
10
- Fix cursor bugs from page_merge/rebalance
11
- Fix to dirty fewer pages in deletes (mdb_page_loose())
12
- Fix mdb_dbi_open creating subDBs (ITS#7917)
13
- Fix mdb_cursor_get(_DUP) with single value (ITS#7913)
14
- Fix Windows compat issues in mtests (ITS#7879)
15
- Add compacting variant of mdb_copy
16
- Add BigEndian integer key compare code
17
- Add mdb_dump/mdb_load utilities
18
-
19
- LMDB 0.9.13 Release (2014/06/18)
20
- Fix mdb_page_alloc unlimited overflow page search
21
- Documentation
22
- Re-fix MDB_CURRENT doc (ITS#7793)
23
- Fix MDB_GET_MULTIPLE/MDB_NEXT_MULTIPLE doc
24
-
25
- LMDB 0.9.12 Release (2014/06/13)
26
- Fix MDB_GET_BOTH regression (ITS#7875,#7681)
27
- Fix MDB_MULTIPLE writing multiple keys (ITS#7834)
28
- Fix mdb_rebalance (ITS#7829)
29
- Fix mdb_page_split (ITS#7815)
30
- Fix md_entries count (ITS#7861,#7828,#7793)
31
- Fix MDB_CURRENT (ITS#7793)
32
- Fix possible crash on Windows DLL detach
33
- Misc code cleanup
34
- Documentation
35
- mdb_cursor_put: cursor moves on error (ITS#7771)
36
-
37
-
38
- LMDB 0.9.11 Release (2014/01/15)
39
- Add mdb_env_set_assert() (ITS#7775)
40
- Fix: invalidate txn on page allocation errors (ITS#7377)
41
- Fix xcursor tracking in mdb_cursor_del0() (ITS#7771)
42
- Fix corruption from deletes (ITS#7756)
43
- Fix Windows/MSVC build issues
44
- Raise safe limit of max MDB_MAXKEYSIZE
45
- Misc code cleanup
46
- Documentation
47
- Remove spurious note about non-overlapping flags (ITS#7665)
48
-
49
- LMDB 0.9.10 Release (2013/11/12)
50
- Add MDB_NOMEMINIT option
51
- Fix mdb_page_split() again (ITS#7589)
52
- Fix MDB_NORDAHEAD definition (ITS#7734)
53
- Fix mdb_cursor_del() positioning (ITS#7733)
54
- Partial fix for larger page sizes (ITS#7713)
55
- Fix Windows64/MSVC build issues
56
-
57
- LMDB 0.9.9 Release (2013/10/24)
58
- Add mdb_env_get_fd()
59
- Add MDB_NORDAHEAD option
60
- Add MDB_NOLOCK option
61
- Avoid wasting space in mdb_page_split() (ITS#7589)
62
- Fix mdb_page_merge() cursor fixup (ITS#7722)
63
- Fix mdb_cursor_del() on last delete (ITS#7718)
64
- Fix adding WRITEMAP on existing env (ITS#7715)
65
- Fix nested txns (ITS#7515)
66
- Fix mdb_env_copy() O_DIRECT bug (ITS#7682)
67
- Fix mdb_cursor_set(SET_RANGE) return code (ITS#7681)
68
- Fix mdb_rebalance() cursor fixup (ITS#7701)
69
- Misc code cleanup
70
- Documentation
71
- Note that by default, readers need write access
72
-
73
-
74
- LMDB 0.9.8 Release (2013/09/09)
75
- Allow mdb_env_set_mapsize() on an open environment
76
- Fix mdb_dbi_flags() (ITS#7672)
77
- Fix mdb_page_unspill() in nested txns
78
- Fix mdb_cursor_get(CURRENT|NEXT) after a delete
79
- Fix mdb_cursor_get(DUP) to always return key (ITS#7671)
80
- Fix mdb_cursor_del() to always advance to next item (ITS#7670)
81
- Fix mdb_cursor_set(SET_RANGE) for tree with single page (ITS#7681)
82
- Fix mdb_env_copy() retry open if O_DIRECT fails (ITS#7682)
83
- Tweak mdb_page_spill() to be less aggressive
84
- Documentation
85
- Update caveats since mdb_reader_check() added in 0.9.7
86
-
87
- LMDB 0.9.7 Release (2013/08/17)
88
- Don't leave stale lockfile on failed RDONLY open (ITS#7664)
89
- Fix mdb_page_split() ref beyond cursor depth
90
- Fix read txn data race (ITS#7635)
91
- Fix mdb_rebalance (ITS#7536, #7538)
92
- Fix mdb_drop() (ITS#7561)
93
- Misc DEBUG macro fixes
94
- Add MDB_NOTLS envflag
95
- Add mdb_env_copyfd()
96
- Add mdb_txn_env() (ITS#7660)
97
- Add mdb_dbi_flags() (ITS#7661)
98
- Add mdb_env_get_maxkeysize()
99
- Add mdb_env_reader_list()/mdb_env_reader_check()
100
- Add mdb_page_spill/unspill, remove hard txn size limit
101
- Use shorter names for semaphores (ITS#7615)
102
- Build
103
- Fix install target (ITS#7656)
104
- Documentation
105
- Misc updates for cursors, DB handles, data lifetime
106
-
107
- LMDB 0.9.6 Release (2013/02/25)
108
- Many fixes/enhancements
109
-
110
- LMDB 0.9.5 Release (2012/11/30)
111
- Renamed from libmdb to liblmdb
112
- Many fixes/enhancements