*event_where = NULL,
*qbase = NULL,
*q = NULL,
- *res[11];
+ *res[12];
edg_wll_Event *out = NULL;
glite_lbu_Statement sh = NULL;
int i = 0,
* convert_event_head() called on the result
*/
trio_asprintf(&qbase,"SELECT e.event,j.userid,j.dg_jobid,e.code,"
- "e.prog,e.host,u.cert_subj,e.time_stamp,e.usec,e.level,e.arrived "
+ "e.prog,e.host,u.cert_subj,e.time_stamp,e.usec,e.level,e.arrived,e.seqcode "
"FROM events e,users u,jobs j%s "
"WHERE %se.jobid=j.jobid AND e.userid=u.userid AND e.code != %d "
"%s %s %s %s %s %s",
e->any.arrived.tv_usec = 0;
free(f[8]); f[8] = NULL;
+ e->any.seqcode = f[9];
+ f[9] = NULL;
+
return 0;
err:
/* check duplicity */
trio_asprintf(&stmt,
"select arrived from events where jobid='%|Ss' and code='%d'"
- " and prog='%|Ss' and host='%|Ss' and time_stamp='%s' and usec='%d'"
- " and level='%d' and userid='%|Ss' and seqcode='%|Ss') ",
+ " and prog='%|Ss' and host='%|Ss' and time_stamp=%s and usec='%d'"
+ " and level='%d' and userid='%|Ss' and seqcode='%|Ss'",
jobid, (int) e->any.type,
ssrc,e->any.host,
stamp,e->any.timestamp.tv_usec,
e->any.level,userid, e->any.seqcode);
- if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto clean;
+ if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0) goto clean;
nr = edg_wll_FetchRow(ctx,sh,1,NULL,&dummy);
if (sh) glite_lbu_FreeStmt(&sh);
free(stmt); stmt = NULL;
trio_asprintf(&q,"select proxy,server,grey from jobs where jobid='%|Ss' for update", event->any.jobId);
- if ( (nar = edg_wll_ExecSQL(ctx,q,&stmt)) < 0 ) {
+ nar = edg_wll_ExecSQL(ctx,q,&stmt);
+
+ if (nar < 0) goto err;
+ else if (nar == 0) {
/* Job not registered yet */
if (!( (event->any.type == EDG_WLL_EVENT_REGJOB) &&
}
err:
- free(res[0]); free(res[1]); free(res[3]);
+ free(res[0]); free(res[1]); free(res[2]);
if (stmt) glite_lbu_FreeStmt(&stmt);
free(subj);
free(userid);