From: Glenn H. <thr...@us...> - 2004-09-10 00:30:01
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20769/core Modified Files: graph_api.php Log Message: updated category by percentage query to be mssql friendly Index: graph_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/graph_api.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- graph_api.php 9 Sep 2004 17:56:37 -0000 1.19 +++ graph_api.php 10 Sep 2004 00:29:50 -0000 1.20 @@ -360,11 +360,11 @@ if ( ALL_PROJECTS == $t_project_id ) { $specific_where = '1=1'; } else { - $specific_where = " $t_cat_table.project_id='$t_project_id'"; + $specific_where = " t.project_id='$t_project_id'"; } $query = "SELECT COUNT(*) - FROM $t_bug_table + FROM $t_bug_table as t WHERE $specific_where"; $result = db_query( $query ); $total = db_result( $result, 0 ); @@ -372,9 +372,9 @@ return; } - $query = "SELECT $t_cat_table.category, $t_cat_table.project_id, count($t_bug_table.id) as bugs - FROM $t_cat_table LEFT JOIN $t_bug_table - USING (category, project_id) + $query = "SELECT t.category, t.project_id, count(b.id) as bugs + FROM $t_cat_table as t LEFT JOIN $t_bug_table as b + ON t.category = b.category AND t.project_id = b.project_id WHERE $specific_where GROUP BY project_id, category ORDER BY project_id, category"; |