Feature #38301
closed
- Target version set to Candidate for next major release
- Target version changed from Candidate for next major release to 5.1.0
Setting the target version to 5.1.0.
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch. Thank you for improving Redmine.
- Tracker changed from Patch to Feature
After r22156, the filter raises an exception when an invalid value like 'ABC' is passed ([Related to] [is] [ABC]
). This problem is caused by the generation of IN clauses that do not contain values like this: IN ()
(0.3ms) SELECT COUNT(*) FROM `issues` INNER JOIN `projects` ON `projects`.`id` = `issues`.`project_id` INNER JOIN `issue_statuses` ON `issue_statuses`.`id` = `issues`.`status_id` WHERE (((projects.status <> 9 AND projects.status <> 10 AND EXISTS (SELECT 1 AS one FROM enabled_modules em WHERE em.project_id = projects.id AND em.name='issue_tracking')) AND (((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (6,13))) AND ((issues.is_private = FALSE)))))) AND ((issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=FALSE)) AND (issues.id IN (SELECT DISTINCT issue_relations.issue_from_id FROM issue_relations WHERE issue_relations.relation_type = 'relates' AND issue_relations.issue_to_id IN ()) OR (issues.id IN (SELECT DISTINCT issue_relations.issue_to_id FROM issue_relations WHERE issue_relations.relation_type = 'relates' AND issue_relations.issue_from_id IN ()))) AND projects.lft >= 1 AND projects.rgt <= 10)
↳ app/models/issue_query.rb:359:in `issue_count'
Query::StatementInvalid: Mysql2::Error: 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 ')) OR (issues.id IN (SELECT DISTINCT issue_relations.issue_to_id FROM issue_rela' at line 1
The attached patch fixes the issue by returning no results when the value contains no issue number. This is the same behavior as before r22156.
- Status changed from Reopened to Closed
Also available in: Atom
PDF