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
|