Browse Source

Merge branch 'master' of bitbucket.org:ckolivas/ckpool

master
Con Kolivas 9 years ago
parent
commit
fa4ab34a9e
  1. 9
      src/ckdb.c
  2. 5
      src/ckdb.h
  3. 16
      src/ckdb_dbio.c

9
src/ckdb.c

@ -483,6 +483,9 @@ K_STORE *markersummary_store;
K_TREE *markersummary_pool_root;
K_STORE *markersummary_pool_store;
// The markerid load start for markersummary
char *mark_start = NULL;
// WORKMARKERS
K_TREE *workmarkers_root;
K_TREE *workmarkers_workinfoid_root;
@ -5639,6 +5642,7 @@ static struct option long_options[] = {
{ "loglevel", required_argument, 0, 'l' },
// marker = enable mark/workmarker/markersummary auto generation
{ "marker", no_argument, 0, 'm' },
{ "markstart", required_argument, 0, 'M' },
{ "name", required_argument, 0, 'n' },
{ "dbpass", required_argument, 0, 'p' },
{ "btc-pass", required_argument, 0, 'P' },
@ -5683,7 +5687,7 @@ int main(int argc, char **argv)
memset(&ckp, 0, sizeof(ckp));
ckp.loglevel = LOG_NOTICE;
while ((c = getopt_long(argc, argv, "c:d:ghkl:mn:p:P:r:R:s:S:t:u:U:vw:yY:", long_options, &i)) != -1) {
while ((c = getopt_long(argc, argv, "c:d:ghkl:mM:n:p:P:r:R:s:S:t:u:U:vw:yY:", long_options, &i)) != -1) {
switch(c) {
case 'c':
ckp.config = strdup(optarg);
@ -5742,6 +5746,9 @@ int main(int argc, char **argv)
case 'm':
markersummary_auto = true;
break;
case 'M':
mark_start = strdup(optarg);
break;
case 'n':
ckp.name = strdup(optarg);
break;

5
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1"
#define DB_VERSION "1.0.4"
#define CKDB_VERSION DB_VERSION"-1.612"
#define CKDB_VERSION DB_VERSION"-1.620"
#define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__
@ -1958,6 +1958,9 @@ extern K_STORE *markersummary_store;
extern K_TREE *markersummary_pool_root;
extern K_STORE *markersummary_pool_store;
// The markerid load start for markersummary
extern char *mark_start;
// WORKMARKERS
typedef struct workmarkers {
int64_t markerid;

16
src/ckdb_dbio.c

@ -6766,9 +6766,10 @@ bool markersummary_fill(PGconn *conn)
K_ITEM *item, *p_item;
int n, t, i, p_n;
MARKERSUMMARY *row, *p_row;
char *params[1];
char *field;
char *sel;
int fields = 20;
int fields = 20, par = 0;
bool ok = false;
LOGDEBUG("%s(): select", __func__);
@ -6783,7 +6784,16 @@ bool markersummary_fill(PGconn *conn)
"sharecount,errorcount,firstshare,lastshare,firstshareacc,"
"lastshareacc,lastdiffacc"
MODIFYDATECONTROL
" from markersummary";
" from markersummary where markerid>=$1";
par = 0;
if (mark_start)
params[par++] = mark_start;
else
params[par++] = "0";
PARCHK(par, params);
LOGWARNING("%s(): loading from markerid>=%s", __func__, params[0]);
res = PQexec(conn, "Begin", CKPQ_READ);
rescode = PQresultStatus(res);
PQclear(res);
@ -6792,7 +6802,7 @@ bool markersummary_fill(PGconn *conn)
return false;
}
res = PQexec(conn, sel, CKPQ_READ);
res = PQexecParams(conn, sel, par, NULL, (const char **)params, NULL, NULL, 0, CKPQ_READ);
rescode = PQresultStatus(res);
PQclear(res);
if (!PGOK(rescode)) {

Loading…
Cancel
Save