Merge remote-tracking branch 'origin/master'

This commit is contained in:
Gregory Burd 2011-12-03 09:51:44 -05:00
commit 9021359752
2 changed files with 8 additions and 1 deletions

View file

@ -1169,6 +1169,8 @@ static int open_database(const char* name, DBTYPE type, unsigned int flags, Port
}
}
flags |= DB_AUTO_COMMIT;
// Attempt to open our database
DBGCMD(data, "db->open(%p, 0, '%s', 0, %x, %08x, 0);", db, name, type, flags);
rc = db->open(db, 0, name, 0, type, flags, 0);

View file

@ -1374,7 +1374,12 @@ cursor_get(Key) ->
not_found | {ok, db_key(), db_value()} | db_error().
cursor_get(Key, Opts) ->
{KeyLen, KeyBin} = to_binary(Key),
case Key of
undefined ->
{KeyLen, KeyBin} = {0, <<>>};
_ ->
{KeyLen, KeyBin} = to_binary(Key)
end,
Flags = process_flags(Opts),
Cmd = <<Flags:32/native, KeyLen:32/native, KeyBin/bytes>>,
<<Result:32/signed-native>> = erlang:port_control(get_port(), ?CMD_CURSOR_GET, Cmd),