From: Miloš Mulač Date: Mon, 14 Nov 2005 16:50:46 +0000 (+0000) Subject: get only unique jobids from DB X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=036911a44a56ea02799fda1b3751adc785624267;p=jra1mw.git get only unique jobids from DB --- diff --git a/org.glite.jp.index/src/soap_ops.c b/org.glite.jp.index/src/soap_ops.c index a37a614..baa60b2 100644 --- a/org.glite.jp.index/src/soap_ops.c +++ b/org.glite.jp.index/src/soap_ops.c @@ -292,10 +292,10 @@ static int get_jobids(struct soap *soap, glite_jpis_context_t ctx, struct _jpele } if (ctx->conf->no_auth) { - trio_asprintf(&query, "SELECT dg_jobid,ps FROM jobs%s WHERE %s;", qa, qwhere); + trio_asprintf(&query, "SELECT DISTINCT dg_jobid,ps FROM jobs%s WHERE %s;", qa, qwhere); } else { - trio_asprintf(&query, "SELECT dg_jobid,ps FROM jobs,users%s WHERE (jobs.ownerid = users.userid AND users.cert_subj='%s') AND %s;", qa, ctx->jpctx->peer, qwhere); + trio_asprintf(&query, "SELECT DISTINCT dg_jobid,ps FROM jobs,users%s WHERE (jobs.ownerid = users.userid AND users.cert_subj='%s') AND %s;", qa, ctx->jpctx->peer, qwhere); } printf("Incomming QUERY:\n %s\n", query); free(qwhere);