Various fixes.
This commit is contained in:
parent
1f7ca0c189
commit
d0c587bdec
4 changed files with 11 additions and 13 deletions
|
@ -321,9 +321,8 @@ DRIVER_INIT(bdberl_drv)
|
||||||
// cleanup and set the environment to zero. Attempts to open ports will
|
// cleanup and set the environment to zero. Attempts to open ports will
|
||||||
// fail and the user will have to sort out how to resolve the issue.
|
// fail and the user will have to sort out how to resolve the issue.
|
||||||
DBG("G_DB_ENV->close(%p, 0);", &G_DB_ENV);
|
DBG("G_DB_ENV->close(%p, 0);", &G_DB_ENV);
|
||||||
G_DB_ENV_ERROR = G_DB_ENV->close(G_DB_ENV, 0);
|
G_DB_ENV->close(G_DB_ENV, 0);
|
||||||
G_DB_ENV = 0;
|
G_DB_ENV = 0;
|
||||||
DBG(" = %d\n", G_DB_ENV_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ void bdberl_tpool_thread_id(DB_ENV *env, pid_t *pid, db_threadid_t *tid)
|
||||||
|
|
||||||
char *bdberl_tpool_thread_id_string(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, char *buf)
|
char *bdberl_tpool_thread_id_string(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, char *buf)
|
||||||
{
|
{
|
||||||
snprintf(buf, DB_THREADID_STRLEN, "%d/%p", pid, tid);
|
snprintf(buf, DB_THREADID_STRLEN, "%d/%p", (unsigned int)pid, (void *)tid);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
cd $1/build_unix && \
|
cd $1/build_unix && \
|
||||||
../dist/configure --disable-shared --enable-static --with-pic \
|
../dist/configure --disable-shared --enable-static --with-pic \
|
||||||
--disable-heap --disable-queue \
|
--disable-heap --disable-queue --disable-replication \
|
||||||
--disable-partition --disable-replication \
|
--enable-o_direct --enable-o_direct \
|
||||||
--enable-o_direct \
|
--enable-debug --enable-diagnostics \
|
||||||
|
--enable-dtrace \
|
||||||
--prefix=$2
|
--prefix=$2
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
%% @spec open(Name, Type) -> {ok, Db} | {error, Error}
|
%% @spec open(Name, Type) -> {ok, Db} | {error, Error}
|
||||||
%% where
|
%% where
|
||||||
%% Name = string()
|
%% Name = string()
|
||||||
%% Type = btree | hash
|
%% Type = btree | hash | queue
|
||||||
%% Db = integer()
|
%% Db = integer()
|
||||||
%%
|
%%
|
||||||
%% @equiv open(Name, Type, [create])
|
%% @equiv open(Name, Type, [create])
|
||||||
|
@ -273,7 +273,7 @@ close(Db, Opts) ->
|
||||||
-spec txn_begin() -> ok | db_error().
|
-spec txn_begin() -> ok | db_error().
|
||||||
|
|
||||||
txn_begin() ->
|
txn_begin() ->
|
||||||
txn_begin([txn_snapshot]).
|
txn_begin([]).
|
||||||
|
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -596,7 +596,7 @@ transaction(Fun, Retries, TimeLeft, Opts) ->
|
||||||
transaction(Fun, R, T, Opts);
|
transaction(Fun, R, T, Opts);
|
||||||
|
|
||||||
_ : Reason ->
|
_ : Reason ->
|
||||||
lager:info("function threw non-lock error - ~p", [Reason]),
|
lager:info("function threw non-lock error - ~p", [{Reason, erlang:get_stacktrace()}]),
|
||||||
ok = txn_abort(),
|
ok = txn_abort(),
|
||||||
{error, {transaction_failed, Reason}}
|
{error, {transaction_failed, Reason}}
|
||||||
end;
|
end;
|
||||||
|
@ -834,7 +834,7 @@ put_commit_r(Db, Key, Value, Opts) ->
|
||||||
%% @end
|
%% @end
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-spec get(Db :: db(), Key :: db_key()) ->
|
-spec get(Db :: db(), Key :: db_key()) ->
|
||||||
not_found | {ok, db_ret_value()} | db_error().
|
not_found | {ok, db_ret_value()} | {error, db_error()}.
|
||||||
|
|
||||||
get(Db, Key) ->
|
get(Db, Key) ->
|
||||||
get(Db, Key, []).
|
get(Db, Key, []).
|
||||||
|
@ -885,7 +885,7 @@ get(Db, Key) ->
|
||||||
%% @end
|
%% @end
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-spec get(Db :: db(), Key :: db_key(), Opts :: db_flags()) ->
|
-spec get(Db :: db(), Key :: db_key(), Opts :: db_flags()) ->
|
||||||
not_found | {ok, db_ret_value()} | db_error().
|
not_found | {ok, db_ret_value()} | {error, db_error()}.
|
||||||
|
|
||||||
get(Db, Key, Opts) ->
|
get(Db, Key, Opts) ->
|
||||||
{KeyLen, KeyBin} = to_binary(Key),
|
{KeyLen, KeyBin} = to_binary(Key),
|
||||||
|
@ -964,8 +964,6 @@ get_r(Db, Key, Opts) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% @doc
|
%% @doc
|
||||||
%% Delete a value based on key.
|
%% Delete a value based on key.
|
||||||
|
|
Loading…
Reference in a new issue