IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27907


Ignore:
Timestamp:
May 10, 2010, 4:54:18 PM (16 years ago)
Author:
Paul Price
Message:

COUNT(expr) always returns the total number even if expr is false (because false is different from NULL). This means that the query would return stacks to do even if all the inputs aren't available. I've fixed this by recasting as SUM(IF(warpRun.state = 'full', 1, 0)).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/stacktool_tosum.sql

    r27679 r27907  
    1616    -- WHERE hook %s
    1717GROUP BY stack_id
    18 HAVING COUNT(warpRun.state = 'full') = COUNT(stackInputSkyfile.warp_id)
     18HAVING SUM(IF(warpRun.state = 'full', 1, 0)) = COUNT(stackInputSkyfile.warp_id)
Note: See TracChangeset for help on using the changeset viewer.