Commit 5bd644ed authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

upgrade-test-2.c:32: warning: ‘r’ may be used uninitialized in this function

git-svn-id: file:///svn/toku/tokudb@20800 c7de825b-a66e-492c-adef-691d508d4ae1
parent 578d290f
...@@ -20,6 +20,7 @@ enum { old_default_cachesize=1024 }; // MB ...@@ -20,6 +20,7 @@ enum { old_default_cachesize=1024 }; // MB
int CACHESIZE=old_default_cachesize; int CACHESIZE=old_default_cachesize;
int ALLOW_DUPS=0; int ALLOW_DUPS=0;
enum {MAGIC=311}; enum {MAGIC=311};
char *datadir = NULL;
// //
// Functions to create unique key/value pairs, row generators, checkers, ... for each of NUM_DBS // Functions to create unique key/value pairs, row generators, checkers, ... for each of NUM_DBS
...@@ -344,6 +345,9 @@ static void run_test(void) ...@@ -344,6 +345,9 @@ static void run_test(void)
r = env->set_default_dup_compare(env, uint_dbt_cmp); CKERR(r); r = env->set_default_dup_compare(env, uint_dbt_cmp); CKERR(r);
if ( verbose ) printf("CACHESIZE = %d MB\n", CACHESIZE); if ( verbose ) printf("CACHESIZE = %d MB\n", CACHESIZE);
r = env->set_cachesize(env, CACHESIZE / 1024, (CACHESIZE % 1024)*1024*1024, 1); CKERR(r); r = env->set_cachesize(env, CACHESIZE / 1024, (CACHESIZE % 1024)*1024*1024, 1); CKERR(r);
if (datadir) {
r = env->set_data_dir(env, datadir); CKERR(r);
}
r = env->set_generate_row_callback_for_put(env, put_multiple_generate); r = env->set_generate_row_callback_for_put(env, put_multiple_generate);
CKERR(r); CKERR(r);
int envflags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE | DB_PRIVATE; int envflags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE | DB_PRIVATE;
...@@ -472,6 +476,9 @@ static void do_args(int argc, char * const argv[]) { ...@@ -472,6 +476,9 @@ static void do_args(int argc, char * const argv[]) {
bomb_after_poll_count = strtoll(argv[0], &end, 10); bomb_after_poll_count = strtoll(argv[0], &end, 10);
assert(errno==0); assert(errno==0);
assert(*end==0); // make sure we consumed the whole integer. assert(*end==0); // make sure we consumed the whole integer.
} else if (strcmp(argv[0], "--datadir") == 0 && argc > 1) {
argc--; argv++;
datadir = argv[0];
} else { } else {
fprintf(stderr, "Unknown arg: %s\n", argv[0]); fprintf(stderr, "Unknown arg: %s\n", argv[0]);
resultcode=1; resultcode=1;
......
...@@ -29,7 +29,7 @@ char *env_dir = ENVDIR; // the default env_dir. ...@@ -29,7 +29,7 @@ char *env_dir = ENVDIR; // the default env_dir.
int SRC_VERSION = 4; int SRC_VERSION = 4;
static void upgrade_test_2(DB **dbs) { static void upgrade_test_2(DB **dbs) {
int r; int r = 0;
// open the DBS // open the DBS
{ {
DBT desc; DBT desc;
......
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