Browse Source

ckdb - fix exits in keysummary code

master
kanoi 8 years ago
parent
commit
e51e667d95
  1. 4
      src/ckdb.h
  2. 8
      src/ckdb_dbio.c

4
src/ckdb.h

@ -52,7 +52,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.201" #define CKDB_VERSION DB_VERSION"-2.202"
#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__
@ -3475,7 +3475,7 @@ extern bool markersummary_add(PGconn *conn, K_ITEM *ms_item, char *by, char *cod
char *inet, tv_t *cd, K_TREE *trf_root); char *inet, tv_t *cd, K_TREE *trf_root);
extern bool markersummary_fill(PGconn *conn); extern bool markersummary_fill(PGconn *conn);
extern bool keysummary_add(PGconn *conn, K_ITEM *ks_item, char *by, char *code, extern bool keysummary_add(PGconn *conn, K_ITEM *ks_item, char *by, char *code,
char *inet, tv_t *cd, K_TREE *trf_root); char *inet, tv_t *cd);
#define workmarkers_process(_conn, _already, _add, _markerid, _poolinstance, \ #define workmarkers_process(_conn, _already, _add, _markerid, _poolinstance, \
_workinfoidend, _workinfoidstart, _description, \ _workinfoidend, _workinfoidstart, _description, \
_status, _by, _code, _inet, _cd, _trf_root) \ _status, _by, _code, _inet, _cd, _trf_root) \

8
src/ckdb_dbio.c

@ -4661,6 +4661,8 @@ bool sharesummaries_to_markersummaries(PGconn *conn, WORKMARKERS *workmarkers,
setnow(&add_fin); setnow(&add_fin);
setnow(&kadd_stt); setnow(&kadd_stt);
INIT_KEYSUMMARY(&ks_look);
ks_item = NULL; ks_item = NULL;
lookkeysharesummary.workinfoid = workmarkers->workinfoidend; lookkeysharesummary.workinfoid = workmarkers->workinfoidend;
@ -4790,8 +4792,7 @@ bool sharesummaries_to_markersummaries(PGconn *conn, WORKMARKERS *workmarkers,
setnow(&kdb_stt); setnow(&kdb_stt);
ks_item = STORE_HEAD_NOLOCK(new_keysummary_store); ks_item = STORE_HEAD_NOLOCK(new_keysummary_store);
while (ks_item) { while (ks_item) {
if (!(keysummary_add(conn, ks_item, by, code, inet, if (!(keysummary_add(conn, ks_item, by, code, inet, cd))) {
cd, trf_root))) {
reason = "db error"; reason = "db error";
setnow(&kdb_fin); setnow(&kdb_fin);
goto rollback; goto rollback;
@ -8489,7 +8490,7 @@ flail:
} }
bool keysummary_add(PGconn *conn, K_ITEM *ks_item, char *by, char *code, bool keysummary_add(PGconn *conn, K_ITEM *ks_item, char *by, char *code,
char *inet, tv_t *cd, K_TREE *trf_root) char *inet, tv_t *cd)
{ {
ExecStatusType rescode; ExecStatusType rescode;
bool conned = false; bool conned = false;
@ -8506,7 +8507,6 @@ bool keysummary_add(PGconn *conn, K_ITEM *ks_item, char *by, char *code,
DATA_KEYSUMMARY(row, ks_item); DATA_KEYSUMMARY(row, ks_item);
SIMPLEDATEPOINTERS(markersummary_free, row, cd, by, code, inet); SIMPLEDATEPOINTERS(markersummary_free, row, cd, by, code, inet);
SIMPLEDATEPTRTRANSFER(markersummary_free, trf_root, row);
par = 0; par = 0;
params[par++] = bigint_to_buf(row->markerid, NULL, 0); params[par++] = bigint_to_buf(row->markerid, NULL, 0);

Loading…
Cancel
Save