View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016259 | mantisbt | bugtracker | public | 2013-08-11 09:53 | 2017-08-23 16:54 |
Reporter | maschneider | Assigned To | dregad | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.15 | ||||
Target Version | 1.2.16 | Fixed in Version | 1.2.16 | ||
Summary | 0016259: When sorting issues by due_date, unset values should be listed at the end | ||||
Description | If you have enable due_date and you want to sort than to see the bugs with the first due_date you get the bugs without due_date instead. | ||||
Additional Information | due_date is a int field and undefied is 1 and 1 is alway bevor current timestamp | ||||
Tags | No tags attached. | ||||
I fix the bug, and create a pull request: https://github.com/mantisbt/mantisbt/pull/92 please review and merged |
|
I just tested your patch, and while it works fine with MySQL, it breaks PostgreSQL when sorting by due_date ASC - APPLICATION ERROR 401 Database query failed. Error received from database was #-1: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list So the fix you propose can't be applied as it is. A possible solution/workaround for this issue could be to add '(due_date = 1)' to the list of selected columns, but I think the real question is, why are we doing a SELECT DISTINCT here ? It does not make much sense to me to do so, as it would appear that a normal SELECT should do the job just fine. But then again messing with the filter_api always feels like opening a can of worms... |
|
Also a bit strange at this place |
|
@atrol, yeah I saw that, this useless code will be removed eventually ==> see commits: master 5c4f817a, master-1.2.x 017eca50 |
|
We can not remove "DISTINCT" in the SELECT may be it will break some plugins with JOINS (i dont know it it is ever used) The DISTINCT is not necessary for the JOIN with the mantis_bug_table and not with the LEFT JOIN of customer fields Maybe adding "(due_date = 1) as has_due_date" to the select? |
|
In my opinion, the best option in the long term is to get rid of the DISTINCT. However, it is also potentially a more hazardous approach; therefore to minimize the risk of introducing a regression in 1.2 branch, I'll follow the more conservative approach of adding an additional column to the select for the sort. For 1.3 branch, I'll remove the DISTINCT instead, and we can see down the line if that breaks something. |
|
It turns out @maschneider was right... I did some testing on the master branch today, and without the distinct we do get multiple rows, e.g. when filtering bugs having more than one bugnote with text matching the search filter. I'll revert the 1.3 fix and port the 1.2 commit. |
|
MantisBT: master-1.2.x 7a375d64 2013-07-12 00:00 Committer: dregad Details Diff |
When sorting by due_date, display undefined values last Markus' original patch was modified to simplify the code and reduce duplication, fix a couple typos in comment text and reword the commit message. Fixes 0016259 |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master 044133b3 2013-07-12 00:00 Committer: dregad Details Diff |
When sorting by due_date, display undefined values last Markus' original patch was modified to simplify the code and reduce duplication, fix a couple typos in comment text and reword the commit message. Fixes 0016259 |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master-1.2.x 017eca50 2013-08-20 06:28 Details Diff |
Remove useless code |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master 5c4f817a 2013-08-20 06:28 Details Diff |
Remove useless code |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master-1.2.x fa52c994 2013-08-20 13:46 Details Diff |
due_date ASC sort: pgsql fix Fix 0016259: adding order by expression to select list to avoid error. |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master 174878c3 2013-08-20 13:46 Details Diff |
due_date ASC sort: pgsql fix Fix 0016259: adding order by expression to select list to avoid error. |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master 9c57416c 2013-08-20 13:48 Details Diff |
Remove DISTINCT clause from filter_get_bug_rows query Fixes 0016259 PostgreSQL error when filtering by due_date ASC |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master a451d135 2013-10-12 13:04 Details Diff |
Revert "Remove DISTINCT clause from filter_get_bug_rows query" This reverts commit 9c57416cc20d82cb6af1ff6852011e33f988981b. Issue 0016259 |
Affected Issues 0016259 |
|
mod - core/filter_api.php | Diff File |