Defect #22808

Malformed SQL query with SQLServer when grouping and sorting by fixed version

Added by Silvio Fernandes over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues filter
Target version:3.1.6
Resolution:Fixed Affected version:3.2.1

Description

Hi guys,

I had the same problem of issue #19544, but my was with the fixed version column, in version 3.2.1 with SQL Server 2012, and this r14207 did not solve my problem.

making a debug in the code, I found that the part where it should make a flatten between two Array, the variable group_by_sort_order comes as String, so I did a treatment to make this String into Array, and solved my problem.

code modified in /app/models/issue_query.rb

  # Returns the issues
  # Valid options are :order, :offset, :limit, :include, :conditions
  def issues(options={})
    if group_by_sort_order.is_a?(String)
      # convert String in Array
      order_option = [group_by_sort_order.split(','), options[:order]].flatten.reject(&:blank?)
    else
      order_option = [group_by_sort_order, options[:order]].flatten.reject(&:blank?)
    end

...

issue_query.rb Magnifier - file modified (23.5 KB) Silvio Fernandes, 2016-05-12 18:28

Associated revisions

Revision 15416
Added by Jean-Philippe Lang over 1 year ago

Malformed SQL query with SQLServer when grouping and sorting by fixed version (#22808).

History

#1 Updated by Toshi MARUYAMA over 1 year ago

  • Target version set to 3.1.6

#2 Updated by Toshi MARUYAMA over 1 year ago

  • Description updated (diff)

#3 Updated by Jean-Philippe Lang over 1 year ago

  • Subject changed from Malformed SQL query with SQLServer when grouping fixed versions to Malformed SQL query with SQLServer when grouping and sorting by fixed version
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r15416.

#4 Updated by Jean-Philippe Lang over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF