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:
Leo Yuriev 2015-08-31 23:19:35 +03:00
parent 55cbf745ff
commit e955d64ebf
3 changed files with 5 additions and 6 deletions

View File

@ -366,8 +366,6 @@ static int process_db(MDB_dbi dbi, char *name, visitor *handler, int silent)
if (! flags)
print(" none");
else {
/* if (flags & MDB_DUPSORT)
print(" duplicates"); */
for (i=0; dbflags[i].bit; i++)
if (flags & dbflags[i].bit)
print(" %s", dbflags[i].name);

View File

@ -120,9 +120,6 @@ static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name)
printf("mapaddr=%p\n", info.me_mapaddr);
printf("maxreaders=%u\n", info.me_maxreaders);
if (flags & MDB_DUPSORT)
printf("duplicates=1\n");
for (i=0; dbflags[i].bit; i++)
if (flags & dbflags[i].bit)
printf("%s=1\n", dbflags[i].name);

View File

@ -70,7 +70,11 @@ static void readhdr(void)
while (fgets(dbuf.mv_data, dbuf.mv_size, stdin) != NULL) {
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="));
if (version > 3) {
fprintf(stderr, "%s: line %" Z "d: unsupported VERSION %d\n",