Skip to content

Commit

Permalink
I'm working on cleaning up the 8000+ queries that is the view_all_bug…
Browse files Browse the repository at this point in the history
…_page but in case I don't get it finished tonight (likely), I thought I'd commit this which at least gets rid of 4000 or so unecessary joins.

* core/print_api.php
  (print_reporter_option_list): remove useless table joins


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1940 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Julian Fitzell committed Feb 19, 2003
1 parent f413a96 commit cddfcdf
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions core/print_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: print_api.php,v 1.43 2003-02-18 02:18:02 jfitzell Exp $
# $Id: print_api.php,v 1.44 2003-02-19 07:36:28 jfitzell Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -198,11 +198,9 @@ function print_reporter_option_list( $p_user_id ) {
$t_project_view_state = project_get_field( $g_project_cookie_val, 'view_state' );
if ( PUBLIC == $t_project_view_state ) {
$query = "SELECT l.access_level
FROM $g_mantis_project_user_list_table l,
$g_mantis_project_table p
WHERE l.project_id='$g_project_cookie_val' AND
p.id=l.project_id AND
l.user_id='$v_id'";
FROM $g_mantis_project_user_list_table
WHERE project_id='$g_project_cookie_val' AND
user_id='$v_id'";
$result = db_query( $query );
$count = db_num_rows( $result );
if ( $count > 0 ){
Expand All @@ -214,12 +212,10 @@ function print_reporter_option_list( $p_user_id ) {

} else {
$query = "SELECT COUNT(*)
FROM $g_mantis_project_user_list_table l,
$g_mantis_project_table p
WHERE l.project_id='$g_project_cookie_val' AND
p.id=l.project_id AND
l.user_id='$v_id' AND
l.access_level>='$t_rep'";
FROM $g_mantis_project_user_list_table
WHERE project_id='$g_project_cookie_val' AND
user_id='$v_id' AND
access_level>='$t_rep'";
$result = db_query( $query );
$count = db_result( $result, 0, 0 );
if ( $count > 0 ) {
Expand Down

0 comments on commit cddfcdf

Please sign in to comment.