From: Aleš Křenek Date: Tue, 11 Dec 2007 16:54:45 +0000 (+0000) Subject: handle empty notif conditions when looking for indices X-Git-Tag: merge_313_3_dst~24 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=64b78a5da4f249018171f440965e52461be782b1;p=jra1mw.git handle empty notif conditions when looking for indices --- 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) {