Browse Source

ckdb - remaining begin statements

master
kanoi 8 years ago
parent
commit
11bbc5970d
  1. 2
      src/ckdb.h
  2. 23
      src/ckdb_dbio.c

2
src/ckdb.h

@ -58,7 +58,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.7" #define DB_VERSION "1.0.7"
#define CKDB_VERSION DB_VERSION"-2.600" #define CKDB_VERSION DB_VERSION"-2.601"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

23
src/ckdb_dbio.c

@ -615,14 +615,8 @@ bool users_update(PGconn *conn, K_ITEM *u_item, char *oldhash,
PARCHKVAL(par, 3, params); PARCHKVAL(par, 3, params);
conned = CKPQConn(&conn); conned = CKPQConn(&conn);
// Beginning of a write txn if (!CKPQBegin(conn))
res = CKPQExec(conn, "Begin", CKPQ_WRITE);
rescode = CKPQResultStatus(res);
CKPQClear(res);
if (!PGOK(rescode)) {
PGLOGERR("Begin", rescode, conn);
goto unparam; goto unparam;
}
res = CKPQExecParams(conn, upd, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_WRITE); res = CKPQExecParams(conn, upd, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_WRITE);
rescode = CKPQResultStatus(res); rescode = CKPQResultStatus(res);
@ -873,14 +867,8 @@ bool users_replace(PGconn *conn, K_ITEM *u_item, K_ITEM *old_u_item, char *by,
PARCHKVAL(par, 3, params); PARCHKVAL(par, 3, params);
conned = CKPQConn(&conn); conned = CKPQConn(&conn);
// Beginning of a write txn if (!CKPQBegin(conn))
res = CKPQExec(conn, "Begin", CKPQ_WRITE);
rescode = CKPQResultStatus(res);
CKPQClear(res);
if (!PGOK(rescode)) {
PGLOGERR("Begin", rescode, conn);
goto unparam; goto unparam;
}
res = CKPQExecParams(conn, upd, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_WRITE); res = CKPQExecParams(conn, upd, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_WRITE);
rescode = CKPQResultStatus(res); rescode = CKPQResultStatus(res);
@ -1687,13 +1675,8 @@ bool workers_update(PGconn *conn, K_ITEM *item, char *difficultydefault,
PARCHKVAL(par, 3, params); PARCHKVAL(par, 3, params);
conned = CKPQConn(&conn); conned = CKPQConn(&conn);
res = CKPQExec(conn, "Begin", CKPQ_WRITE); if (!CKPQBegin(conn))
rescode = CKPQResultStatus(res);
CKPQClear(res);
if (!PGOK(rescode)) {
PGLOGERR("Begin", rescode, conn);
goto unparam; goto unparam;
}
res = CKPQExecParams(conn, upd, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_WRITE); res = CKPQExecParams(conn, upd, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_WRITE);
rescode = CKPQResultStatus(res); rescode = CKPQResultStatus(res);

Loading…
Cancel
Save