From 7e1d5f960c004468cb726c8f058ea13efb5ad1e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Filipovi=C4=8D?= Date: Thu, 19 Feb 2009 10:57:05 +0000 Subject: [PATCH] Queried jobs are implicitly ordered by jobid, the 'greater' operation on jobid is implemented in query. --- org.glite.lb.server/src/query.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/org.glite.lb.server/src/query.c b/org.glite.lb.server/src/query.c index 6459c02..ae3b197 100644 --- a/org.glite.lb.server/src/query.c +++ b/org.glite.lb.server/src/query.c @@ -376,14 +376,15 @@ int edg_wll_QueryJobsServer( if ( (where_flags & FL_SEL_STATUS) ) trio_asprintf(&qbase,"SELECT DISTINCT j.dg_jobid,j.userid " - "FROM jobs j, states s WHERE j.jobid=s.jobid %s %s %s %s", + "FROM jobs j, states s WHERE j.jobid=s.jobid %s %s %s %s ORDER BY j.jobid", (job_where) ? "AND" : "", (job_where) ? job_where : "", - (job_where) ? "AND" : "", + (ctx->isProxy) ? "AND" : "", (ctx->isProxy) ? "j.proxy='1'" : "j.server='1'"); else trio_asprintf(&qbase,"SELECT DISTINCT j.dg_jobid,j.userid " - "FROM jobs j WHERE %s %s %s", + "FROM jobs j WHERE %s %s %s " + "ORDER BY j.jobid", (job_where) ? job_where : "", (job_where) ? "AND" : "", (ctx->isProxy) ? "j.proxy='1'" : "j.server='1'"); @@ -958,9 +959,9 @@ static char *jc_to_head_where( { case EDG_WLL_QUERY_ATTR_JOBID: ct++; - if ( jc[m][n].op != EDG_WLL_QUERY_OP_EQUAL && jc[m][n].op != EDG_WLL_QUERY_OP_UNEQUAL ) + if ( jc[m][n].op != EDG_WLL_QUERY_OP_EQUAL && jc[m][n].op != EDG_WLL_QUERY_OP_UNEQUAL && jc[m][n].op != EDG_WLL_QUERY_OP_GREATER) { - edg_wll_SetError(ctx, EINVAL, "only `=' and '!=' supported with jobid"); + edg_wll_SetError(ctx, EINVAL, "only `=', '>' and '!=' supported with jobid"); return NULL; } break; -- 1.8.2.3