Index: branches/pap_magic/ippTools/src/magictool.c
===================================================================
--- branches/pap_magic/ippTools/src/magictool.c	(revision 24156)
+++ branches/pap_magic/ippTools/src/magictool.c	(revision 24161)
@@ -614,5 +614,4 @@
     psMetadata *templatesWhere = psMetadataAlloc(); // WHERE for selecting template
     psMetadata *magicWhere = psMetadataAlloc();     // WHERE for selecting magic runs
-    psMetadata *finalWhere = psMetadataAlloc();     // WHERE at end
 
     PXOPT_COPY_S64(config->args, templatesWhere, "-magic_id", "magicRun.magic_id", "==");
@@ -621,7 +620,4 @@
     PXOPT_COPY_S64(config->args, magicWhere, "-magic_id", "magicRun.magic_id", "==");
     PXOPT_COPY_STR(config->args, magicWhere, "-node", "magicTree.node", "==");
-
-    PXOPT_COPY_S64(config->args, finalWhere, "-magic_id", "magicRun.magic_id", "==");
-    PXOPT_COPY_STR(config->args, finalWhere, "-node", "magicInputs.node", "==");
 
     PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
@@ -650,11 +646,4 @@
     }
     psFree(magicWhere);
-
-    if (psListLength(finalWhere->list)) {
-        psString whereClause = psDBGenerateWhereConditionSQL(finalWhere, NULL);
-        psStringAppend(&query, "\nWHERE %s", whereClause);
-        psFree(whereClause);
-    }
-    psFree(finalWhere);
 
     // treat limit == 0 as "no limit"
