Added unknown db type for opening existing databases.
This commit is contained in:
parent
553ed4eda1
commit
2c6277bdf4
2 changed files with 9 additions and 9 deletions
|
@ -193,11 +193,17 @@ static TPool* G_TPOOL_TXNS = NULL;
|
|||
}}
|
||||
|
||||
#define FAIL_IF_TXN_OPEN(d, outbuf) { \
|
||||
if (d->txn) \
|
||||
if (NULL != d->txn) \
|
||||
{ \
|
||||
send_rc(d->port, d->port_owner, ERROR_TXN_OPEN); \
|
||||
RETURN_INT(0, outbuf); \
|
||||
}}
|
||||
#define FAIL_IF_NO_TXN(d, outbuf) { \
|
||||
if (NULL == d->txn) \
|
||||
{ \
|
||||
send_rc(d->port, d->port_owner, ERROR_NO_TXN); \
|
||||
RETURN_INT(0, outbuf); \
|
||||
}}
|
||||
|
||||
#ifdef DEBUG
|
||||
# define DBG printf
|
||||
|
@ -554,13 +560,7 @@ static int bdberl_drv_control(ErlDrvData handle, unsigned int cmd,
|
|||
case CMD_TXN_ABORT:
|
||||
{
|
||||
FAIL_IF_ASYNC_PENDING(d, outbuf);
|
||||
|
||||
// If we don't already have a txn open, fail
|
||||
if (d->txn == 0)
|
||||
{
|
||||
send_rc(d->port, d->port_owner, ERROR_NO_TXN);
|
||||
RETURN_INT(0, outbuf);
|
||||
}
|
||||
FAIL_IF_NO_TXN(d, outbuf);
|
||||
|
||||
// Setup async command and schedule it on the txns threadpool
|
||||
d->async_op = cmd;
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
-define(CMD_TXN_STAT, 29).
|
||||
-define(CMD_TXN_STAT_PRINT, 30).
|
||||
|
||||
-define(DB_TYPE_UNKNOWN, 0).
|
||||
-define(DB_TYPE_BTREE, 1).
|
||||
-define(DB_TYPE_HASH, 2).
|
||||
-define(DB_TYPE_UNKNOWN, 5).
|
||||
|
||||
-define(SYSP_CACHESIZE_GET, 1).
|
||||
-define(SYSP_TXN_TIMEOUT_GET, 2).
|
||||
|
|
Loading…
Reference in a new issue