Project

General

Profile

Actions

Defect #32404

open

Group results is different between MySQL and PostgreSQL

Added by Simon Hori over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues filter
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Recently we've migrated a huge DB from MySQL to PostgreSQL. And noticed a small difference with Group results by function.

As you see the screenshot below, MySQL shows (blank) group first but PostgreSQL shows (blank) group last.

I guess it is because `NULLS LAST` is the default for ASC order in PostgreSQL.
Can you enforce `NULLS FIRST` in the SQL query to postgres?
https://www.postgresql.org/docs/8.3/queries-order.html

We believe that it would be very much appreciated since many of our users want to group issues by assignee to find unassigned issues. Also it would be nice if Redmine works consistently irrespective of db engines.

  Redmine version                3.4.11.stable
  Ruby version                   2.4.6-p354 (2019-04-01) [x86_64-linux]
  Rails version                  4.2.11.1
  Database adapter               PostgreSQL

Thank you.


Files

PostgreSQL-MySQL-NULL.png (94.8 KB) PostgreSQL-MySQL-NULL.png Simon Hori, 2019-11-04 15:28

Related issues

Related to Redmine - Patch #25066: Sort order with null placement (NULLS FIRST, NULLS LAST)New

Actions
Actions #1

Updated by Simon Hori over 4 years ago

I found a patch #25066 which is for a similar point but it is doing more than fixing the diff.

Actions #2

Updated by Marius BÄ‚LTEANU over 4 years ago

  • Related to Patch #25066: Sort order with null placement (NULLS FIRST, NULLS LAST) added
Actions #3

Updated by Yuichi HARADA over 4 years ago

https://www.redmine.org/builds/logs/build_trunk_postgresql_ruby-2.6_803.html
I think the reason why the test failed with TimelogControllerTest#test_index_grouped_by_issue is the same.

Actions

Also available in: Atom PDF