View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003997 | mantisbt | sql | public | 2004-07-02 10:48 | 2004-09-12 08:28 |
Reporter | nuclearspike | Assigned To | Narcissus | ||
Priority | normal | Severity | minor | Reproducibility | random |
Status | closed | Resolution | fixed | ||
Product Version | git trunk | ||||
Fixed in Version | 0.19.0rc1 | ||||
Summary | 0003997: CVS: SQL error on View Bugs with certain filters | ||||
Description | User did a series of steps, got an SQL error, & she can no longer use View Bugs page. | ||||
Steps To Reproduce | One of our internal users was playing with filters and had gone into the Summary page and clicked on one of the numbers to go to view related bugs. It worked, then she navigated to another site. She used the Back button and was on the screen to select the project to open (with the "Set as default" option). From that page she clicked on View Bugs and got the error shown. You'll notice that there is a " AND () AND " in the middle of the where. | ||||
Additional Information | APPLICATION ERROR 0000401 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 | ||||
Tags | No tags attached. | ||||
be sure to "view advanced" to see the steps to reproduce. |
|
that should say (without linking to another bug) : (oddly enough, bug 0000401 is the request to add support for automatic hyperlinking when you enter in a bug number into the report.) |
|
Confirmed in alpha release 0.19.0a1, here, on the "live" mantis bug tracker. Just tried to search for some text. -- Database query failed. Error received from database was # 1064: You have an error in your SQL syntax near '(mantis_bug_table LEFT JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id ' at line 1 for the query: SELECT COUNT( DISTINCT mantis_bug_table.id ) as count FROM mantis_bug_text_table, mantis_project_table ,(mantis_bug_table LEFT JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id = mantis_bug_table.id) LEFT 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='1') AND (mantis_bug_table.view_state='10' OR mantis_bug_table.reporter_id='4953') AND ((mantis_bug_table.status='10') OR (mantis_bug_table.status='20') OR (mantis_bug_table.status='30') OR (mantis_bug_table.status='40') OR (mantis_bug_table.status='50') OR (mantis_bug_table.status='80')) AND ((summary LIKE '%test%') 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. |
|
It lookes like the brackets in the FROM part of the query (around the first LEFT JOIN) are causing the grief core/filter_api.php: line 395 should look like instead of: edited on: 07-08-04 01:14 edited on: 07-08-04 01:21 |
|
I do not get that error on my server. Wonder if Victor did all the SQL updates when he updated today? Victor? |
|
This issue doesn't seem to be the same as the text search one. Looking at the broken SQL, there's a problem with the filter somewhere between reporter and status. The fields that are filtered between reporter and status are:
If there is still a problem, I would guess that it's in amongst these three filter values. Paul: Is there any chance of getting more information, as I can't replicate this issue at the moment. |
|
We have seen the error once since this report, but cannot seem to reliably reproduce it. It's always able to be worked around by just going to another page and coming back. We'll keep our eye out for it. |
|
Is this already a reproducable issue? |
|
To reproduce. Is this the same issue? You have to have several projects in Mantis.
It is very common used to view all bugs assigned to a person in all projects. Edit: Mantis Version 0.19.0a2 from sf.net Complete Error Message: APPLICATION ERROR # 401 Database query failed. Error received from database was # 1064: 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 ') AND ((mantis_bug_table.build=''))' at line 1 for the query: SELECT COUNT( DISTINCT mantis_bug_table.id ) as count 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='16') OR (mantis_bug_table.project_id='21') OR (mantis_bug_table.project_id='5') OR (mantis_bug_table.project_id='13') OR (mantis_bug_table.project_id='4') OR (mantis_bug_table.project_id='7') OR (mantis_bug_table.project_id='8') OR (mantis_bug_table.project_id='1') OR (mantis_bug_table.project_id='2') OR (mantis_bug_table.project_id='10')) AND (mantis_bug_table.view_state='10' OR mantis_bug_table.reporter_id='5') AND () AND ((mantis_bug_table.build='')) edited on: 08-17-04 08:49 edited on: 08-17-04 08:49 |
|
I tried these steps and it did not cause an error for me. I'm not using the official .19 release but a CVS version from about a week ago. |
|
I think this issue has been fixed in cvs - The SQL statement of "AND () AND " might not be valid. For this to occur, one of the itesm in the $t_where_clause arrays needs to be an empty string. The only places where_clause is set are: array_push( $t_where_clauses, "($t_bug_text_table.id = $t_bug_table.bug_text_id)" ); etc etc etc... none of which would produce an empty string Are you still able to get this issue to occur? |
|
This problem no longer appears in version 0.19.0rc1. |
|