Changeset 4201a420ec590bb2be00011f3d52f670320141e6

Show
Ignore:
Timestamp:
09/24/09 19:03:33 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1253819013 +0000
git-parent:

[660168eda62ae099b050dfe231af8d8e95287453]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1253819013 +0000
Message:

fixes #183

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_datastore.c

    rf6540ba r4201a42  
    7878  PGresult *res; \ 
    7979  int rv; \ 
     80  time_t whence; \ 
    8081  int nparams; \ 
    8182  int metric_type; \ 
     
    242243  if(d->rv != PGRES_COMMAND_OK && \ 
    243244     d->rv != PGRES_TUPLES_OK) { \ 
    244     noitL(noit_error, "stratcon datasource bad (%d): %s\n", \ 
    245           d->rv, PQresultErrorMessage(d->res)); \ 
     245    noitL(noit_error, "stratcon datasource bad (%d): %s\n'%s'\n", \ 
     246          d->rv, PQresultErrorMessage(d->res), cmd); \ 
    246247    PQclear(d->res); \ 
    247248    goto bad_row; \ 
     
    261262  if(d->rv != PGRES_COMMAND_OK && \ 
    262263     d->rv != PGRES_TUPLES_OK) { \ 
    263     noitL(noit_error, "stratcon datasource bad (%d): %s\n", \ 
    264           d->rv, PQresultErrorMessage(d->res)); \ 
     264    noitL(noit_error, "stratcon datasource bad (%d): %s\n'%s' time: %llu\n", \ 
     265          d->rv, PQresultErrorMessage(d->res), cmdbuf, \ 
     266          (long long unsigned)whence); \ 
    265267    PQclear(d->res); \ 
    266268    goto bad_row; \ 
     
    362364execute_outcome_t 
    363365stratcon_datastore_execute(conn_q *cq, struct sockaddr *r, ds_job_detail *d) { 
    364   time_t whence = 0; 
    365366  int type, len; 
    366367  char *final_buff; 
     
    416417        DECLARE_PARAM_STR("noitd",5); /* node_type */ 
    417418        PROCESS_NEXT_FIELD(token,len); 
    418         whence = (time_t)strtoul(token, NULL, 10); 
     419        d->whence = (time_t)strtoul(token, NULL, 10); 
    419420        DECLARE_PARAM_STR(token,len); /* timestamp */ 
    420421 
     
    456457        PROCESS_NEXT_FIELD(token,len); 
    457458        DECLARE_PARAM_STR(token,len); /* timestamp */ 
    458         whence = (time_t)strtoul(token, NULL, 10); 
     459        d->whence = (time_t)strtoul(token, NULL, 10); 
    459460        PROCESS_NEXT_FIELD(token, len); 
    460461        DECLARE_PARAM_STR(token,len); /* uuid */ 
     
    469470        PROCESS_NEXT_FIELD(token,len); 
    470471        DECLARE_PARAM_STR(token,len); /* timestamp */ 
    471         whence = (time_t)strtoul(token, NULL, 10); 
     472        d->whence = (time_t)strtoul(token, NULL, 10); 
    472473        PROCESS_NEXT_FIELD(token, len); 
    473474        DECLARE_PARAM_STR(token,len); /* uuid */ 
     
    482483        PROCESS_NEXT_FIELD(token,len); 
    483484        DECLARE_PARAM_STR(token,len); /* timestamp */ 
    484         whence = (time_t)strtoul(token, NULL, 10); 
     485        d->whence = (time_t)strtoul(token, NULL, 10); 
    485486        PROCESS_NEXT_FIELD(token, len); 
    486487        DECLARE_PARAM_STR(token,len); /* uuid */ 
     
    514515    case 'S': 
    515516      GET_QUERY(status_insert); 
    516       PG_TM_EXEC(status_insert, whence); 
     517      PG_TM_EXEC(status_insert, d->whence); 
    517518      PQclear(d->res); 
    518519      break; 
     
    525526        case METRIC_DOUBLE: 
    526527          GET_QUERY(metric_insert_numeric); 
    527           PG_TM_EXEC(metric_insert_numeric, whence); 
     528          PG_TM_EXEC(metric_insert_numeric, d->whence); 
    528529          PQclear(d->res); 
    529530          break; 
    530531        case METRIC_STRING: 
    531532          GET_QUERY(metric_insert_text); 
    532           PG_TM_EXEC(metric_insert_text, whence); 
     533          PG_TM_EXEC(metric_insert_text, d->whence); 
    533534          PQclear(d->res); 
    534535          break;