mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 19:24:13 +08:00
lmdb: made mdb_load compatible with mdb_dump.
Ignores 'duplicates=' and 'db_pagesize=', drops 'duplicates=' from mdb_dump and mdb_chk. Change-Id: I295d19c8382fee1d5779b047aec5220788e5dd9c
This commit is contained in:
parent
55cbf745ff
commit
e955d64ebf
@ -366,8 +366,6 @@ static int process_db(MDB_dbi dbi, char *name, visitor *handler, int silent)
|
|||||||
if (! flags)
|
if (! flags)
|
||||||
print(" none");
|
print(" none");
|
||||||
else {
|
else {
|
||||||
/* if (flags & MDB_DUPSORT)
|
|
||||||
print(" duplicates"); */
|
|
||||||
for (i=0; dbflags[i].bit; i++)
|
for (i=0; dbflags[i].bit; i++)
|
||||||
if (flags & dbflags[i].bit)
|
if (flags & dbflags[i].bit)
|
||||||
print(" %s", dbflags[i].name);
|
print(" %s", dbflags[i].name);
|
||||||
|
@ -120,9 +120,6 @@ static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name)
|
|||||||
printf("mapaddr=%p\n", info.me_mapaddr);
|
printf("mapaddr=%p\n", info.me_mapaddr);
|
||||||
printf("maxreaders=%u\n", info.me_maxreaders);
|
printf("maxreaders=%u\n", info.me_maxreaders);
|
||||||
|
|
||||||
if (flags & MDB_DUPSORT)
|
|
||||||
printf("duplicates=1\n");
|
|
||||||
|
|
||||||
for (i=0; dbflags[i].bit; i++)
|
for (i=0; dbflags[i].bit; i++)
|
||||||
if (flags & dbflags[i].bit)
|
if (flags & dbflags[i].bit)
|
||||||
printf("%s=1\n", dbflags[i].name);
|
printf("%s=1\n", dbflags[i].name);
|
||||||
|
@ -70,7 +70,11 @@ static void readhdr(void)
|
|||||||
|
|
||||||
while (fgets(dbuf.mv_data, dbuf.mv_size, stdin) != NULL) {
|
while (fgets(dbuf.mv_data, dbuf.mv_size, stdin) != NULL) {
|
||||||
lineno++;
|
lineno++;
|
||||||
if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) {
|
if (!strncmp(dbuf.mv_data, "db_pagesize=", STRLENOF("db_pagesize="))
|
||||||
|
|| !strncmp(dbuf.mv_data, "duplicates=", STRLENOF("duplicates="))) {
|
||||||
|
/* LY: silently ignore information fields. */
|
||||||
|
continue;
|
||||||
|
} else if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) {
|
||||||
version=atoi((char *)dbuf.mv_data+STRLENOF("VERSION="));
|
version=atoi((char *)dbuf.mv_data+STRLENOF("VERSION="));
|
||||||
if (version > 3) {
|
if (version > 3) {
|
||||||
fprintf(stderr, "%s: line %" Z "d: unsupported VERSION %d\n",
|
fprintf(stderr, "%s: line %" Z "d: unsupported VERSION %d\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user