Defect #7656

MySQL SQL Syntax Error when filtering issues by Assignee's Group

Added by Dalibor Filus almost 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2011-02-18
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:1.1.2
Resolution:Fixed Affected version:1.1.1

Description

Redmine version: 1.1.1
MySQL 5.0.32-Debian_7etch6

how to reproduce:

  • create assignee's group in Administration -> Groups with no members
  • go to Issues in any project
  • add filter "Assignee's Group" with this blank group
  • press Filter and boom, blank screen appears and this is in production log:
Processing IssuesController#index (for 89.176.79.118 at 2011-02-18 17:55:36) [POST]
  Parameters: {"group_by"=>"", "set_filter"=>"1", "project_id"=>"truhlari", "action"=>"index", "authenticity_token"=>"oxyA9vxYzC6I8uCpmMC+L4fndyUYjOH9Pl6LOQxb1P4=", "fields"=>["status_id", "member_of_group", ""], "operators"=>{"start_date"=>"<t+", "assigned_to_role"=>"=", "watcher_id"=>"=", "estimated_hours"=>"=", "created_on"=>">t-", "priority_id"=>"=", "fixed_version_id"=>"=", "done_ratio"=>"=", "updated_on"=>">t-", "subject"=>"~", "assigned_to_id"=>"=", "tracker_id"=>"=", "due_date"=>"<t+", "author_id"=>"=", "status_id"=>"o", "member_of_group"=>"="}, "values"=>{"start_date"=>[""], "assigned_to_role"=>["3"], "watcher_id"=>["me"], "estimated_hours"=>[""], "created_on"=>[""], "priority_id"=>["3"], "fixed_version_id"=>["49"], "done_ratio"=>[""], "updated_on"=>[""], "subject"=>[""], "assigned_to_id"=>["me"], "tracker_id"=>["2"], "due_date"=>[""], "author_id"=>["me"], "status_id"=>["1"], "member_of_group"=>["39"]}, "controller"=>"issues", "_"=>"", "query"=>{"column_names"=>["tracker", "status", "subject", "assigned_to", "updated_on", "fixed_version", "estimated_hours", "done_ratio"]}}
Query::StatementInvalid: Mysql::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 ')) AND projects.id = 42 AND projects.status=1 AND projects.id IN (SELECT em.proj' at line 1: SELECT count(DISTINCT `issues`.id) AS count_all FROM `issues`  LEFT OUTER JOIN `issue_statuses` ON `issue_statuses`.id = `issues`.status_id  LEFT OUTER JOIN `projects` ON `projects`.id = `issues`.project_id WHERE ((issue_statuses.is_closed=0) AND (issues.assigned_to_id IN ()) AND projects.id = 42 AND projects.status=1 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) 

When I filter issues by assignee's group with any member, it works nicely :)

Associated revisions

Revision 4888
Added by Jean-Philippe Lang almost 7 years ago

Fixed: SQL error when filtering issues with an empty group or role (#7656).

History

#1 Updated by Dalibor Filus almost 7 years ago

additional information:

  1. gems
    mysql (2.8.1)
  1. ruby -v
    ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01

#2 Updated by Etienne Massip almost 7 years ago

Confirmed with PostgreSQL.

Strangely, does not produce a HTTP 500 (no exception thrown) and the main part of the screen remains totally blank.

#3 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from New to Resolved
  • Target version set to 1.1.2
  • Resolution set to Fixed

Applies to Assignee's role with an empty role too.
Both are fixed in r4888.

#4 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from Resolved to Closed

Merged in 1.1-stable.

Also available in: Atom PDF