https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292023-03-01T14:28:55ZRedmineRedmine - Feature #38301: Multiple issue ids in "Related to" filterhttps://www.redmine.org/issues/38301?journal_id=1094232023-03-01T14:28:55ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul> Redmine - Feature #38301: Multiple issue ids in "Related to" filterhttps://www.redmine.org/issues/38301?journal_id=1095012023-03-13T08:26:51ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>5.1.0</i></li></ul><p>Setting the target version to 5.1.0.</p> Redmine - Feature #38301: Multiple issue ids in "Related to" filterhttps://www.redmine.org/issues/38301?journal_id=1095732023-03-25T06:27:53ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li></ul><p>Committed the patch. Thank you for improving Redmine.</p> Redmine - Feature #38301: Multiple issue ids in "Related to" filterhttps://www.redmine.org/issues/38301?journal_id=1095962023-03-28T00:39:50ZGo MAEDA
<ul><li><strong>Tracker</strong> changed from <i>Patch</i> to <i>Feature</i></li></ul> Redmine - Feature #38301: Multiple issue ids in "Related to" filterhttps://www.redmine.org/issues/38301?journal_id=1102112023-06-12T05:43:33ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/30639">38301-fix-sql-error-when-invalid-value-is-passed.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/30639/38301-fix-sql-error-when-invalid-value-is-passed.patch">38301-fix-sql-error-when-invalid-value-is-passed.patch</a> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>After <a class="changeset" title="Multiple issue ids in "Related to" filter (#38301). Patch by Tomoko Shimizu, Ko Nagase, and Taka..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/22156">r22156</a>, the filter raises an exception when an invalid value like 'ABC' is passed (<code>[Related to] [is] [ABC]</code>). This problem is caused by the generation of IN clauses that do not contain values like this: <code>IN ()</code></p>
<pre>
(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
</pre>
<p>The attached patch fixes the issue by returning no results when the value contains no issue number. This is the same behavior as before <a class="changeset" title="Multiple issue ids in "Related to" filter (#38301). Patch by Tomoko Shimizu, Ko Nagase, and Taka..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/22156">r22156</a>.</p> Redmine - Feature #38301: Multiple issue ids in "Related to" filterhttps://www.redmine.org/issues/38301?journal_id=1102852023-06-21T06:05:54ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Fixed the issue described in <a href="#note-6">#note-6</a> in <a class="changeset" title="Fix SQL error when passing invalid value to "Related to" filter (#38301)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/22256">r22256</a>.</p>