View Issue Details

IDProjectCategoryView StatusLast Update
0007933mantisbtfilterspublic2008-08-12 09:17
Reporteredwardgao Assigned Tograngeway  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionno change required 
Product Version1.1.0a2 
Summary0007933: Filter does not work as expected
Description

When we "Apply Filter" on a key word, it looks like Mantis is calculating the total number correctly, but it won't show all the issues with the keyword.

it always hide some issues.

In this way, the search function is not useful at all, because you can not guarantee what you get is what you need.

Steps To Reproduce
  1. click the "View Issues" link
  2. in the filter input field, input any keyword, e.g. "test",
  3. mantis will return a list, but only part of all the issues are visible:

    Viewing Issues (1 - 3 / 6) [ Print Reports ] [ CSV Export ]

In this case, there is no way to see the 4~6 issues.

Additional Information

This was reported in the wrong category, but I could not move it myself.

Some sql output looks fine:
12 0.0147 SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_bug_text_table, mantis_project_table, mantis_bug_table WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id in (2, 3, 4, 5, 6, 7, 1) ) AND ( mantis_bug_table.status in (10, 20, 30, 40, 50, 60, 80) ) AND (mantis_bug_text_table.id = mantis_bug_table.bug_text_id) AND ((summary LIKE '%test%') OR (mantis_bug_text_table.description LIKE '%test%') OR (mantis_bug_text_table.steps_to_reproduce LIKE '%test%') OR (mantis_bug_text_table.additional_information LIKE '%test%') OR (mantis_bug_table.id = '0'))

13 0.0249 SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_bug_text_table, mantis_project_table, mantis_bug_table INNER JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id = mantis_bug_table.id INNER JOIN mantis_bugnote_text_table ON mantis_bugnote_text_table.id = mantis_bugnote_table.bugnote_text_id WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id in (2, 3, 4, 5, 6, 7, 1) ) AND ( mantis_bug_table.status in (10, 20, 30, 40, 50, 60, 80) ) AND (mantis_bug_text_table.id = mantis_bug_table.bug_text_id) AND ((summary LIKE '%test%') OR (mantis_bug_text_table.description LIKE '%test%') OR (mantis_bug_text_table.steps_to_reproduce LIKE '%test%') OR (mantis_bug_text_table.additional_information LIKE '%test%') OR (mantis_bug_table.id LIKE '%test%') OR (mantis_bugnote_text_table.note LIKE '%test%'))

14 0.1050 SELECT DISTINCT mantis_bug_table.* FROM mantis_bug_table WHERE mantis_bug_table.id in (SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_bug_text_table, mantis_project_table, mantis_bug_table INNER JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id = mantis_bug_table.id INNER JOIN mantis_bugnote_text_table ON mantis_bugnote_text_table.id = mantis_bugnote_table.bugnote_text_id WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id in (2, 3, 4, 5, 6, 7, 1) ) AND ( mantis_bug_table.status in (10, 20, 30, 40, 50, 60, 80) ) AND (mantis_bug_text_table.id = mantis_bug_table.bug_text_id) AND ((summary LIKE '%test%') OR (mantis_bug_text_table.description LIKE '%test%') OR (mantis_bug_text_table.steps_to_reproduce LIKE '%test%') OR (mantis_bug_text_table.additional_information LIKE '%test%') OR (mantis_bug_table.id LIKE '%test%') OR (mantis_bugnote_text_table.note LIKE '%test%'))) ORDER BY sticky DESC, last_updated DESC, date_submitted DESC

15 0.1198 SELECT DISTINCT bug_id,MAX(last_modified) as last_modified, COUNT(last_modified) as count FROM mantis_bugnote_table WHERE mantis_bugnote_table.bug_id in (SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_bug_text_table, mantis_project_table, mantis_bug_table INNER JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id = mantis_bug_table.id INNER JOIN mantis_bugnote_text_table ON mantis_bugnote_text_table.id = mantis_bugnote_table.bugnote_text_id WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id in (2, 3, 4, 5, 6, 7, 1) ) AND ( mantis_bug_table.status in (10, 20, 30, 40, 50, 60, 80) ) AND (mantis_bug_text_table.id = mantis_bug_table.bug_text_id) AND ((summary LIKE '%test%') OR (mantis_bug_text_table.description LIKE '%test%') OR (mantis_bug_text_table.steps_to_reproduce LIKE '%test%') OR (mantis_bug_text_table.additional_information LIKE '%test%') OR (mantis_bug_table.id LIKE '%test%') OR (mantis_bugnote_text_table.note LIKE '%test%'))) GROUP BY bug_id

TagsNo tags attached.

Relationships

related to 0007516 closedgiallu My mssql performance tweaks 
has duplicate 0007929 closedgiallu Filter does not work well 

Activities

edwardgao

edwardgao

2007-05-02 15:12

reporter   ~0014420

I find out the reason, but still need help.

The reason is that I changed the filter.php for MSSQL performance issue when there are more than 3000 records. If I do not change, Mantis won't return anything for me, but after I change these, Mantis can not filter well.

What do you think it is to cause the trouble, the changes are:

  1. Line 812:

$t_where = "WHERE $t_bug_table.id in (" . implode( ", ", $t_id_array ) . ")";

$t_where = "WHERE $t_bug_table.id in (" .$query. ")";

  1. Line 910:

    Added DISTINCT

    ##      $query2  = "SELECT $t_select
    $query2  = "SELECT DISTINCT $t_select
                $t_from
                $t_join
                $t_where
                $t_order";
  2. Line 947:

    $t_where = "WHERE $t_bugnote_table.bug_id in (" . implode( ", ", $t_id_array_lastmod ) . ")";

    $t_where = "WHERE $t_bugnote_table.bug_id in (" . $query . ")";
    $query3 = "SELECT DISTINCT bug_id,MAX(last_modified) as last_modified, COUNT(last_modified) as count FROM $t_bugnote_table $t_where GROUP BY bug_id";
edwardgao

edwardgao

2007-05-02 15:22

reporter   ~0014422

Please add a relationship between this and issue 7516.

http://bugs.mantisbt.org/view.php?id=7516

If I remove the 3 changes, the filter works well.

edwardgao

edwardgao

2007-05-02 16:13

reporter   ~0014423

It was the first change that caused the trouble:

  1. Line 812:

$t_where = "WHERE $t_bug_table.id in (" . implode( ", ", $t_id_array ) . ")";

$t_where = "WHERE $t_bug_table.id in (" .$query. ")";

Do not know what the other two changes will cause yet.

rzg

rzg

2007-05-03 00:16

reporter   ~0014427

(See note on other bug for resolution)

giallu

giallu

2007-09-15 18:39

reporter   ~0015642

Am I correctly interpreting that this bug was raised by the modifications suggested in 0007516, so I can close this as it is nowhere to be found in any official release (let alone the stated 1.1.0a2) ?

rzg

rzg

2007-09-17 09:34

reporter   ~0015649

Indeed, this is a defect in no official release, but in an unofficial patch that I made. That being said, many people who use Mantis on mssql are using my unofficial patch, because the performace is terriable without it.

Feel free to close this issue.

grangeway

grangeway

2008-07-31 15:39

reporter   ~0018972

MArking as resolved, as I believe the logic changes in trunk for 1.2.x (see other bug) deal with this.