Commit 84ae16a3 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Make {{{test_set_lk_max_locks}}} run again. Refs #2952. [t:2952]

git-svn-id: file:///svn/toku/tokudb@24987 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5857ef0c
...@@ -26,9 +26,10 @@ static void make_db (int n_locks) { ...@@ -26,9 +26,10 @@ static void make_db (int n_locks) {
CKERR(r); CKERR(r);
r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0); r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_env_create(&env, 0); assert(r==0); r=db_env_create(&env, 0); assert(r==0);
r = env->set_redzone(env, 0); assert(r == 0);
env->set_errfile(env, 0); env->set_errfile(env, 0);
if (n_locks>0) { if (n_locks>0) {
r=env->set_lk_max_locks(env, n_locks); CKERR(r); r=env->set_lk_max_locks(env, n_locks+2); CKERR(r);
/* test the get_lk_max_locks method */ /* test the get_lk_max_locks method */
u_int32_t set_locks; u_int32_t set_locks;
#ifdef TOKUDB #ifdef TOKUDB
...@@ -37,7 +38,7 @@ static void make_db (int n_locks) { ...@@ -37,7 +38,7 @@ static void make_db (int n_locks) {
assert(r == EINVAL); assert(r == EINVAL);
#endif #endif
r=env->get_lk_max_locks(env, &set_locks); r=env->get_lk_max_locks(env, &set_locks);
assert(r == 0 && set_locks == (u_int32_t)n_locks); assert(r == 0 && set_locks == (u_int32_t)n_locks+2);
} }
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r=db_create(&db, env, 0); CKERR(r); r=db_create(&db, env, 0); CKERR(r);
...@@ -52,7 +53,7 @@ static void make_db (int n_locks) { ...@@ -52,7 +53,7 @@ static void make_db (int n_locks) {
#else #else
u_int32_t datasize = 1; u_int32_t datasize = 1;
#endif #endif
int effective_n_locks = (n_locks<0) ? 1000 : n_locks; int effective_n_locks = (n_locks<0) ? 998 : n_locks;
// create even numbered keys 0 2 4 ... (effective_n_locks*32-2) // create even numbered keys 0 2 4 ... (effective_n_locks*32-2)
r=env->txn_begin(env, 0, &tid, 0); CKERR(r); r=env->txn_begin(env, 0, &tid, 0); CKERR(r);
......
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