logo       

mantisbt/core filter_api.php,1.124,1.125: msg#00001

Subject: mantisbt/core filter_api.php,1.124,1.125
Update of /cvsroot/mantisbt/mantisbt/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4912/core

Modified Files:
        filter_api.php 
Log Message:
further refinement to last fix to eliminate superfluous joins with custom date 
fields


Index: filter_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/filter_api.php,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- filter_api.php      2 Oct 2005 18:47:56 -0000       1.124
+++ filter_api.php      2 Oct 2005 21:27:44 -0000       1.125
@@ -625,27 +625,32 @@
                     # Each custom field will result in a exponential growth 
like Number_of_Issues^Number_of_Custom_Fields
                     # and only after this process ends (if it is able to) the 
result query will be filtered
                     # by the WHERE clause and by the DISTINCT clause
-                                       array_push( $t_join_clauses, "LEFT JOIN 
$t_custom_field_string_table $t_table_name ON $t_table_name.bug_id = 
$t_bug_table.id AND $t_table_name.field_id = $t_cfid " );
+                                       $t_cf_join_clause = "LEFT JOIN 
$t_custom_field_string_table $t_table_name ON $t_table_name.bug_id = 
$t_bug_table.id AND $t_table_name.field_id = $t_cfid ";
 
                                        if ($t_def['type'] == 
CUSTOM_FIELD_TYPE_DATE) {
                                                switch 
($t_filter['custom_fields'][$t_cfid][0]) {
                                                case CUSTOM_FIELD_DATE_ANY:
                                                        break ;
                                                case CUSTOM_FIELD_DATE_NONE:
+                                                       array_push( 
$t_join_clauses, $t_cf_join_clause );
                                                        $t_custom_where_clause 
= '(( ' . $t_table_name . '.bug_id is null) OR ( ' . $t_table_name . '.value = 
0)' ;
                                                        break ;
                                                case CUSTOM_FIELD_DATE_BEFORE:
+                                                       array_push( 
$t_join_clauses, $t_cf_join_clause );
                                                        $t_custom_where_clause 
= '(( ' . $t_table_name . '.value != 0 AND (' . $t_table_name . '.value+0) < ' 
. ($t_filter['custom_fields'][$t_cfid][2]) . ')' ;
                                                        break ;
                                                case CUSTOM_FIELD_DATE_AFTER:
+                                                       array_push( 
$t_join_clauses, $t_cf_join_clause );
                                                        $t_custom_where_clause 
= '(( ' . $t_table_name . '.field_id = ' . $t_cfid . ' AND (' . $t_table_name . 
'.value+0) > ' . ($t_filter['custom_fields'][$t_cfid][1]+1) . ')' ;
                                                        break ;
                                                default:
+                                                       array_push( 
$t_join_clauses, $t_cf_join_clause );
                                                        $t_custom_where_clause 
= '(( ' . $t_table_name . '.field_id = ' . $t_cfid . ' AND (' . $t_table_name . 
'.value+0) BETWEEN ' . $t_filter['custom_fields'][$t_cfid][1] . ' AND ' . 
$t_filter['custom_fields'][$t_cfid][2] . ')' ;
                                                        break ;
                                                }
                                        } else {
 
+                                               array_push( $t_join_clauses, 
$t_cf_join_clause );
                                                foreach( 
$t_filter['custom_fields'][$t_cfid] as $t_filter_member ) {
                                                        if ( isset( 
$t_filter_member ) &&
                                                                ( 
META_FILTER_ANY != strtolower( $t_filter_member ) ) ) {



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe