Commit fbce5906 authored by Yoni Fogel's avatar Yoni Fogel

Addresses 2037 refs[t:2037] Merged from 2037-fileops branch.

git-svn-id: file:///svn/toku/tokudb@15565 c7de825b-a66e-492c-adef-691d508d4ae1
parent 580f5caa
......@@ -31,7 +31,7 @@ test_main (int argc, char *argv[]) {
r = db_env_create(&env, 0); assert(r==0);
env->set_errfile(env,0); // Turn off those annoying errors
r = env->open(env, ENVDIR, -1, 0644);
assert(r==EINVAL);
CKERR2(r, EINVAL);
assert(n_handle_error==0);
r = env->close(env, 0); assert(r==0);
}
......
......@@ -105,7 +105,7 @@ int toku_ydb_lock_ctr(void);
RAISE_COND_EXCEPTION(((txn) && db_txn_struct_i(txn)->child), \
toku_ydb_do_error((env), \
EINVAL, \
"%s: Transaction cannot do work when child exists", __FUNCTION__))
"%s: Transaction cannot do work when child exists\n", __FUNCTION__))
#define HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn) \
HANDLE_ILLEGAL_WORKING_PARENT_TXN((db)->dbenv, txn)
......@@ -113,6 +113,13 @@ int toku_ydb_lock_ctr(void);
#define HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c) \
HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN((c)->dbp, dbc_struct_i(c)->txn)
#define HANDLE_EXTRA_FLAGS(env, flags_to_function, allowed_flags) \
RAISE_COND_EXCEPTION((env) && ((flags_to_function) & ~(allowed_flags)), \
toku_ydb_do_error((env), \
EINVAL, \
"Unknown flags (%"PRIu32") in "__FILE__ ":%s(): %d\n", (flags_to_function) & ~(allowed_flags), __FUNCTION__, __LINE__))
/* */
void toku_ydb_error_all_cases(const DB_ENV * env,
int error,
......
......@@ -419,6 +419,10 @@ static int toku_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mo
return toku_ydb_do_error(env, EINVAL, "The environment is already open\n");
}
HANDLE_EXTRA_FLAGS(env, flags,
DB_CREATE|DB_PRIVATE|DB_INIT_LOG|DB_INIT_TXN|DB_RECOVER|DB_INIT_MPOOL|DB_INIT_LOCK|DB_THREAD);
// DB_CREATE means create if env does not exist, and Tokudb requires it because
// Tokudb requries DB_PRIVATE.
if ((flags & DB_PRIVATE) && !(flags & DB_CREATE)) {
......
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