Index: branches/cnb_branch_20090113/ippTools/share/difftool_definebyquery_part2.sql
===================================================================
--- branches/eam_branch_20081230/ippTools/share/difftool_definebyquery_part2.sql	(revision 21072)
+++ branches/cnb_branch_20090113/ippTools/share/difftool_definebyquery_part2.sql	(revision 21120)
@@ -19,4 +19,5 @@
             FROM stackRun
             JOIN stackSumSkyfile USING(stack_id)
+            -- stacks where hook %s
             GROUP BY 
                 skycell_id,
@@ -31,3 +32,2 @@
         -- (good fraction test goes here for example also above)
         -- warp where hook %s
-        -- stacks where hook %s
Index: branches/cnb_branch_20090113/ippTools/share/difftool_skyfile.sql
===================================================================
--- branches/eam_branch_20081230/ippTools/share/difftool_skyfile.sql	(revision 21072)
+++ branches/cnb_branch_20090113/ippTools/share/difftool_skyfile.sql	(revision 21120)
@@ -11,5 +11,5 @@
     USING(diff_id)
 JOIN diffInputSkyfile
-    ON diffInputSkyfile.diff_id = diffRun.diff_id
+    USING (diff_id, skycell_id)
 JOIN warpRun
     ON warpRun.warp_id = diffInputSkyfile.warp1
Index: branches/cnb_branch_20090113/ippTools/share/magictool_toprocess_tree.sql
===================================================================
--- branches/eam_branch_20081230/ippTools/share/magictool_toprocess_tree.sql	(revision 21072)
+++ branches/cnb_branch_20090113/ippTools/share/magictool_toprocess_tree.sql	(revision 21120)
@@ -16,4 +16,5 @@
 WHERE
     magicRun.state = 'run'
+    -- where hook %s
 ORDER BY
     magicRun.magic_id
