bug
avatar brianteeman
brianteeman
30 Nov 2014

What is the logic on this filter? I only ever get one page - sure there should be more than that

avatar brianteeman brianteeman - open - 30 Nov 2014
avatar b2z
b2z - comment - 1 Dec 2014

Hmm it is the same logic as for all filters and there is no limit in this query. I will try to ensure that query is correct.

avatar b2z
b2z - assign - 1 Dec 2014
Assigned to b2z
avatar b2z
b2z - comment - 1 Dec 2014

The query by itself is correct. The problem is in COUNT query which should return the total number of rows:

SELECT COUNT(*)
FROM `jtr_issues` AS `a`
LEFT JOIN jtr_status AS s ON a.status = s.id
LEFT JOIN `jtr_issues_tests` AS `it`ON a.id = it.item_id
WHERE `a`.`project_id` = 1 
AND `a`.`status` = 1 
AND `s`.`closed` = 0 
AND `a`.`has_code` = 1 
AND `it`.`result` = 1
GROUP BY a.issue_number
HAVING COUNT(it.item_id) = 1

We are using GROUP BY so the count returns the count of unique values for the group by clause. But the result should be the row count. I was searching for the answer, but have not found it yet. If someone can help in this case it would be great, because I am not so good in SQL queries :(

avatar b2z b2z - change - 2 Dec 2014
Labels Added: bug
avatar b2z b2z - close - 3 Dec 2014
avatar b2z b2z - close - 3 Dec 2014
avatar b2z b2z - change - 3 Dec 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-12-03 18:32:19
avatar elkuku
elkuku - comment - 4 Dec 2014

GW @b2z :wink:

Add a Comment

Login with GitHub to post a comment