Commit 19555377 authored by Rich Prohaska's avatar Rich Prohaska

dump some header flags. addresses #333

git-svn-id: file:///svn/tokudb@2101 c7de825b-a66e-492c-adef-691d508d4ae1
parent f605c1ad
...@@ -30,6 +30,18 @@ int dbdump(char *dbfile, char *dbname) { ...@@ -30,6 +30,18 @@ int dbdump(char *dbfile, char *dbname) {
return 1; return 1;
} }
u_int32_t dbflags;
r = db.get_flags(&dbflags); assert(r == 0);
if (dbflags & DB_DUP)
printf("duplicates=1\n");
if (dbflags & DB_DUPSORT)
printf("dupsort=1\n");
#if 0
u_int32_t nodesize;
r = db.get_nodesize(&nodesize); assert(r == 0);
printf("nodesize=%d\n", nodesize);
#endif
Dbc *cursor; Dbc *cursor;
r = db.cursor(0, &cursor, 0); assert(r == 0); r = db.cursor(0, &cursor, 0); assert(r == 0);
...@@ -60,25 +72,24 @@ int usage() { ...@@ -60,25 +72,24 @@ int usage() {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
int i;
char *dbname = 0; char *dbname = 0;
int i;
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
char *arg = argv[i]; char *arg = argv[i];
if (0 == strcmp(arg, "-h") || 0 == strcmp(arg, "--help")) if (0 == strcmp(arg, "-h") || 0 == strcmp(arg, "--help"))
return usage(); return usage();
if (0 == strcmp(arg, "-s")) { if (0 == strcmp(arg, "-s")) {
i++; if (i+1 >= argc)
if (i >= argc)
return usage(); return usage();
dbname = argv[i]; dbname = argv[++i];
continue; continue;
} }
break; break;
} }
if (i >= argc) if (i >= argc)
return usage(); return usage();
return dbdump(argv[i], dbname); return dbdump(argv[i], dbname);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment