From: Zdeněk Šustr Date: Tue, 1 Jul 2008 13:42:31 +0000 (+0000) Subject: #32390 Bug Fix tuning X-Git-Tag: glite-lb-client_R_3_2_2_1~13 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=1e38a80e52e6815b8f6bf671c84459f8bbcc166a;p=jra1mw.git #32390 Bug Fix tuning - Fixed querying unit test (hopefully). - Removed unnecessary bits of code. - Additional testing done. --- diff --git a/org.glite.lb.server/src/query.c b/org.glite.lb.server/src/query.c index ffb2209..3d30c5b 100644 --- a/org.glite.lb.server/src/query.c +++ b/org.glite.lb.server/src/query.c @@ -47,8 +47,7 @@ int edg_wll_QueryEventsServer( const edg_wll_QueryRec **event_conditions, edg_wll_Event **events) { - char *job_where = NULL, - *event_where = NULL, + char *event_where = NULL, *qbase = NULL, *q = NULL, *res[11]; @@ -87,11 +86,6 @@ int edg_wll_QueryEventsServer( edg_wll_Error(ctx,NULL,NULL) != 0) goto cleanup; - if ( job_conditions && *job_conditions && (*job_conditions)->attr && - !(job_where = jc_to_head_where(ctx, job_conditions, &i)) && - edg_wll_Error(ctx,NULL,NULL) != 0 ) - goto cleanup; - if (ctx->peerName) peerid = strdup(strmd5(ctx->peerName,NULL)); can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0); if (can_peername) can_peerid = strdup(strmd5(can_peername,NULL)); @@ -112,11 +106,9 @@ int edg_wll_QueryEventsServer( "e.prog,e.host,u.cert_subj,e.time_stamp,e.usec,e.level,e.arrived " "FROM events e,users u,jobs j " "WHERE j.dg_jobid = '%s' AND e.jobid=j.jobid AND e.userid=u.userid AND e.code != %d " - "%s %s %s %s", + "%s %s", jobstr, EDG_WLL_EVENT_UNDEF, - job_where ? "AND" : "", - job_where ? job_where : "", event_where ? "AND" : "", event_where ? event_where : ""); @@ -251,7 +243,6 @@ cleanup: edg_wll_FreeEvent(out+i); free(out); } - free(job_where); free(event_where); free(peerid); free(can_peername); free(can_peerid); diff --git a/org.glite.lb.server/test/oneJob.qry b/org.glite.lb.server/test/oneJob.qry index 59be576..b46289d 100644 --- a/org.glite.lb.server/test/oneJob.qry +++ b/org.glite.lb.server/test/oneJob.qry @@ -19,14 +19,14 @@ FROM_HOST sending component hostname FROM_INSTANCE sending component instance LOCAL_JOBID new jobId (Condor Globus ...) SEQCODE UI=000002:NS=0000000001:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000 -SRC_INSTANCE +SRC_INSTANCE (nil) select name,value from long_fields where jobid = 'WrCEKje9QTXFiSOZuPMLtw' and event = 1 SELECT DISTINCT j.dg_jobid,j.userid FROM jobs j WHERE (j.jobid='WrCEKje9QTXFiSOZuPMLtw') https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw 294de3557d9d00b3d2d8a1e6aab028cf -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 FROM events e,users u,jobs j WHERE j.dg_jobid = 'https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw' AND e.jobid=j.jobid AND e.userid=u.userid AND e.code != 0 AND (j.jobid='WrCEKje9QTXFiSOZuPMLtw') +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 FROM events e,users u,jobs j WHERE j.dg_jobid = 'https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw' AND e.jobid=j.jobid AND e.userid=u.userid AND e.code != 0 0 294de3557d9d00b3d2d8a1e6aab028cf https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw 17 UserInterface lhun.ics.muni.cz anonymous 2003-08-07 11:08:40 432100 8 2003-08-07 11:08:40 1 294de3557d9d00b3d2d8a1e6aab028cf https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw 2 NetworkServer lhun.ics.muni.cz anonymous 2003-08-07 11:09:05 664600 8 2003-08-07 11:09:05