title: SELECTing from other table with LEFT JOIN makes filtering not working
body: <p>I have this query:</p>
  
  
  
  <pre><code>SELECT 
      r.*, 
      COUNT(rt.id) total_task, 
      IFNULL(SUM(IF(rt.status = 2, 1, 0)), 0) total_task_done
  FROM requests AS r
  LEFT JOIN request_participants AS rp ON rp.request_id = r.id
  LEFT JOIN request_tasks AS rt ON rt.request_id = r.id
  WHERE r.id = 10 AND rp.user_id = 3 AND rp.role = 1
  </code></pre>
  
  <p>These are the tables with the data:</p>
  
  <ul>
  <li><p><strong><code>requests</code></strong></p>
  
  <pre><code>+----+-----------------+--------+
  | id |      notes      | status |
  +----+-----------------+--------+
  | 10 | Some notes here |      1 |
  +----+-----------------+--------+
  </code></pre></li>
  <li><p><strong><code>request_participants</code></strong></p>
  
  <pre><code>+----+---------+------------+------+
  | id | user_id | request_id | role |
  +----+---------+------------+------+
  | 18 |       3 |         10 |    0 |
  | 19 |      17 |         10 |    1 |
  +----+---------+------------+------+
  </code></pre></li>
  </ul>
  
  <p>I want to filter out the <code>request</code> data by its <code>id</code>, participant's <code>user_id</code> and <code>role</code>.</p>
  
  <p>When I run the query as exactly the same as the example above, it returns one row (<code>request.id = 10</code>), but if I remove the <code>COUNT(rt.id) total_task, IFNULL(SUM(IF(rt.status = 2, 1, 0)), 0) total_task_done</code> line from the query, it returns zero row and this is what I wanted.</p>
  
  <p>Could you help me point out what is wrong with my query? Thank you.</p>