View Issue Details

IDProjectCategoryView StatusLast Update
0004774mantisbtfilterspublic2004-11-06 05:59
ReporterGregDeToulouse Assigned Tomasc  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.0 
Fixed in Version0.19.1 
Summary0004774: Problem with Simple Text Search and Bug ID
Description

In the file filter_api.php, the function filter_get_bug_rows creates a request like :

SELECT COUNT( DISTINCT mantis_bug_table.id ) as count FROM mantis_bug_text_table, mantis_project_table, mantis_bug_table
WHERE ... (mantis_bug_table.id LIKE '%002%')) ...

if 002 is the value written in the filter text field.

The problem is that in the database the id value is '2' not '002' nor '0000002' (as presented in the bug list)
So the SQL comparison " mantis_bug_table.id LIKE '%002%' " doesn't match and no result is returned...

Additional Information

The solution I have is :

In filter_api.php line 460 (after the comment "# Simple Text Search") I have created a new variable :
$i_search = db_prepare_int( $t_filter['search'] );

And then, in the array_push I have now :
... OR ($t_bug_table.id LIKE '%$i_search%'))" );

TagsNo tags attached.

Activities

masc

masc

2004-10-25 08:32

reporter   ~0008162

It's better to search directly for whole id:

...($t_bug_table.id = '$i_search'))" );

Otherwise we get a record for every issue containing '2' in the id...

I will commit the patch to CVS.

masc

masc

2004-10-25 14:52

reporter   ~0008169

Fixed in CVS