View Issue Details

IDProjectCategoryView StatusLast Update
0003853mantisbtfilterspublic2004-08-29 01:52
Reportervboctor Assigned Tovboctor  
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Product Versiongit trunk 
Fixed in Version0.19.0rc1 
Summary0003853: Filters sometime generate an invalid query
Description

When I try to view all the reports I wrote, the system will return the attached error message:

APPLICATION ERROR 0000401
Database query failed. Error received from database was 0001064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 0,20' at line 4 for the query: SELECT DISTINCT mantis_bug_table.*
FROM mantis_bug_table, mantis_project_table

WHERE mantis_project_table.enabled = 1 AND mantis_project_table.id = mantis_bug_table.project_id AND ((mantis_bug_table.project_id='6') OR (mantis_bug_table.project_id='4') OR (mantis_bug_table.project_id='13') OR (mantis_bug_table.project_id='2') OR (mantis_bug_table.project_id='21') OR (mantis_bug_table.project_id='1') OR (mantis_bug_table.project_id='10') OR (mantis_bug_table.project_id='12') OR (mantis_bug_table.project_id='9') OR (mantis_bug_table.project_id='18') OR (mantis_bug_table.project_id='3') OR (mantis_bug_table.project_id='19') OR (mantis_bug_table.project_id='17') OR (mantis_bug_table.project_id='11') OR (mantis_bug_table.project_id='8') OR (mantis_bug_table.project_id='5')) AND (mantis_bug_table.reporter_id='17') ORDER BY ASC

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

TagsNo tags attached.

Relationships

child of 0003987 closedvboctor Mantis 0.19.0 Release 

Activities

vboctor

vboctor

2004-05-18 08:54

manager   ~0005538

I forgot to highlight the problem. Note the "ORDER BY ASC". This happens when the "sort" attribute is passed as blank.

I fixed the SQL error in CVS. The fix will be included in 0.19.0.

The fix I applied sets the sort field to "last_updated" and the order to "desc" if the sort field was found to be blank.

The root problem still has to be fixed, but this fixes the symptoms. This is also needed to avoid SQL errors for filters saved in user dbs.

vboctor

vboctor

2004-05-18 08:55

manager   ~0005539

Reminder sent to Narcissus

Narcissus, what do you think about this one?

jlatour

jlatour

2004-08-06 11:47

reporter   ~0006724

What still needs to be done to resolve this?