From 64b78a5da4f249018171f440965e52461be782b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 11 Dec 2007 16:54:45 +0000 Subject: [PATCH] handle empty notif conditions when looking for indices --- org.glite.lb.server/src/notification.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.server/src/notification.c b/org.glite.lb.server/src/notification.c index b26e9b4..7a49c38 100644 --- a/org.glite.lb.server/src/notification.c +++ b/org.glite.lb.server/src/notification.c @@ -118,7 +118,7 @@ int edg_wll_NotifNewServer( goto cleanup; if (get_indexed_cols(ctx,nid_s,nconds,&add_index) || - edg_wll_ExecSQL(ctx,add_index,NULL) < 0 + (add_index && edg_wll_ExecSQL(ctx,add_index,NULL) < 0) ) goto cleanup; @@ -680,7 +680,7 @@ static int get_indexed_cols(edg_wll_Context ctx,char const *notif,edg_wll_QueryR edg_wll_IColumnRec * notif_cols = ctx->notif_index_cols; char *cols = NULL,*aux; - for (i=0; conds[i]; i++) { + for (i=0; conds && conds[i]; i++) { for (j=0; notif_cols[j].qrec.attr && notif_cols[j].qrec.attr != conds[i]->attr; j++); if (notif_cols[j].qrec.attr) { if (conds[i][1].attr && conds[i][0].op != EDG_WLL_QUERY_OP_EQUAL) { -- 1.8.2.3