View Issue Details

IDProjectCategoryView StatusLast Update
0006725mantisbtfilterspublic2007-12-21 23:16
Reportermlovell Assigned Togiallu  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.0 
Target Version1.1.0Fixed in Version1.1.0a4 
Summary0006725: Filtering on "duplicate of" fails while "has duplicate" works
Description

In our issue database, Issue 57 has been marked as a duplicate of Issue 54 and closed. When viewing issues, if one sets up a filter of "has duplicate 57", the list correctly shows just Issue 54. However, if one uses the filter "duplicate of 54" and hide status "None", no issues then appear.

Additional Information

The working query for "has duplicate 57" is as follows:


SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_project_table, mantis_bug_table LEFT JOIN mantis_bug_relationship_table relationship ON relationship.destination_bug_id = mantis_bug_table.id WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id in (6, 10, 7, 1, 4, 3, 2, 9, 8, 5) ) AND (mantis_bug_table.view_state='10' OR mantis_bug_table.reporter_id='2') AND ( mantis_bug_table.status in (10, 20, 50, 60, 70, 80) ) AND ((relationship.relationship_type='0' AND relationship.source_bug_id='57'))

The symmetric query, for "duplicate of 54" is

SELECT DISTINCT mantis_bug_table.id AS id FROM mantis_project_table, mantis_bug_table LEFT JOIN mantis_bug_relationship_table relationship ON relationship.destination_bug_id = mantis_bug_table.id WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id in (6, 10, 7, 1, 4, 3, 2, 9, 8, 5) ) AND (mantis_bug_table.view_state='10' OR mantis_bug_table.reporter_id='2') AND ( mantis_bug_table.status in (10, 20, 50, 60, 70, 80) ) AND ((relationship.relationship_type='4' AND relationship.source_bug_id='54'))

I don't currently see any entries in mantis_bug_relationship_table with a relationship_type of 4. Offhand, unless I am misunderstanding the purpose of the filter/query, it seems to me like the relationship_type should be '0' and source_bug_id interchanged with destination_bug_id in the query currently returning the null set.

TagsNo tags attached.

Activities

mlovell

mlovell

2006-02-16 16:18

reporter   ~0012172

Nevermind. The queries are most likely fine.

I didn't realize that "has duplicate" is recorded in the table distinctly from "duplicate of". Still, I would think that, when filtering on "duplicate of 54", one would find both issues which have themselves been marked as a duplicate of 54 and those which issue 54 has marked as duplicates.

giallu

giallu

2007-07-20 19:19

reporter   ~0015121

I think this issue is real. In my test installation it seems I reproduced the wrong behaviour by:

  • resolve issue X as duplicate of issue Y
  • filter for "duplicate of Y": no hits
  • filter for "has duplicate X": Y shows up

I think this is caused by the filter query which is testing for a single condition while it should also test for the complementary one.

In other words, "duplicates of Y" should look in the relationships table issues with relationship="has duplicate" and source_id = Y (as it does now) but also issues with relationships="duplicate of" and destination_id="Y"

giallu

giallu

2007-07-21 18:13

reporter   ~0015142

Here is a test case: bug 0005157 in this very bug tracker is marked duplicate of 3126.

The following filter for "duplicate of 3126"
http://www.mantisbt.org/bugs/search.php?project_id=1&sticky_issues=on&sortby=last_updated&dir=DESC&hide_status_id=-2&relationship_type=0&relationship_bug=3126

Does not show any results while a filter for bugs that "has duplicate 5157"
http://www.mantisbt.org/bugs/search.php?project_id=1&sticky_issues=on&sortby=last_updated&dir=DESC&hide_status_id=-2&relationship_type=4&relationship_bug=5157

correctly shows 3126 as result

Related Changesets

MantisBT: master 69c23dfe

2007-07-22 16:58

giallu


Details Diff
Fix 6725: Filtering on "duplicate of" fails while "has duplicate" works

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4466 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0006725
mod - core/filter_api.php Diff File