https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292015-04-12T09:45:10ZRedmineRedmine - Defect #19544: Malformed SQL query with SQLServer when grouping issueshttps://www.redmine.org/issues/19544?journal_id=630302015-04-12T09:45:10ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Malformed SQL query with MS SQL and Rails 4.2 when grouping issues</i> to <i>Malformed SQL query with SQLServer when grouping issues</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> set to <i>3.0.2</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>That should be fixed by <a class="changeset" title="SQL error with SQLServer when grouping+sorting issues (#19544)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/14165">r14165</a>.</p> Redmine - Defect #19544: Malformed SQL query with SQLServer when grouping issueshttps://www.redmine.org/issues/19544?journal_id=630402015-04-13T08:17:37ZOlivier Houdas
<ul></ul><p>I removed my changes and applied <a class="changeset" title="SQL error with SQLServer when grouping+sorting issues (#19544)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/14165">r14165</a>, and the filtering now works fine.</p> Redmine - Defect #19544: Malformed SQL query with SQLServer when grouping issueshttps://www.redmine.org/issues/19544?journal_id=633472015-04-25T07:37:51ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul> Redmine - Defect #19544: Malformed SQL query with SQLServer when grouping issueshttps://www.redmine.org/issues/19544?journal_id=705542016-04-26T18:38:48ZSilvio Fernandes
<ul><li><strong>File</strong> <a href="/attachments/15873">issue_query.rb</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/15873/issue_query.rb">issue_query.rb</a> added</li></ul><p>Hi guys,</p>
<p>I had the same problem of this issue, but my was with the fixed version column, in version 3.2.1 with SQL Server 2012, and this review 14207 did not solve my problem.</p>
<p>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.</p>
<p>code modified in /app/models/issue_query.rb<br /><pre><code class="ruby syntaxhl"> <span class="c1"># Returns the issues</span>
<span class="c1"># Valid options are :order, :offset, :limit, :include, :conditions</span>
<span class="k">def</span> <span class="nf">issues</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="p">{})</span>
<span class="k">if</span> <span class="n">group_by_sort_order</span><span class="p">.</span><span class="nf">is_a?</span><span class="p">(</span><span class="no">String</span><span class="p">)</span>
<span class="c1"># convert String in Array</span>
<span class="n">order_option</span> <span class="o">=</span> <span class="p">[</span><span class="n">group_by_sort_order</span><span class="p">.</span><span class="nf">split</span><span class="p">(</span><span class="s1">','</span><span class="p">),</span> <span class="n">options</span><span class="p">[</span><span class="ss">:order</span><span class="p">]].</span><span class="nf">flatten</span><span class="p">.</span><span class="nf">reject</span><span class="p">(</span><span class="o">&</span><span class="ss">:blank?</span><span class="p">)</span>
<span class="k">else</span>
<span class="n">order_option</span> <span class="o">=</span> <span class="p">[</span><span class="n">group_by_sort_order</span><span class="p">,</span> <span class="n">options</span><span class="p">[</span><span class="ss">:order</span><span class="p">]].</span><span class="nf">flatten</span><span class="p">.</span><span class="nf">reject</span><span class="p">(</span><span class="o">&</span><span class="ss">:blank?</span><span class="p">)</span>
<span class="k">end</span>
<span class="o">...</span>
</code></pre></p> Redmine - Defect #19544: Malformed SQL query with SQLServer when grouping issueshttps://www.redmine.org/issues/19544?journal_id=705552016-04-27T04:14:19ZToshi MARUYAMA
<ul></ul><p>Silvio Fernandes wrote:</p>
<blockquote>
<p>Hi guys,<br />...</p>
</blockquote>
<p>Please create new issue.</p>