﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9208	latest() does not behave as expected for equal timestamps	mstamat@…	nobody	"When applying latest() to a field where two or more entries have equal timestamps, the entry with the lowest id is returned. What one would assume is that in such a case the entry with the highest id is returned.

Real life example: I run a ticket system that has the requirement of only storing the date (and not the time) where the status of the ticket changes. When a ticket is opened it is marked as ""New"". There is a page in my ticket system that shows the ""New"" tickets: i.e. the tickets that have ""New"" as the status returned by latest(). However, those tickets that are processed within the same day will still appear in this page. This is caused because all the status change entries for each of these tickets are in the same day and latest() will return the one with the lowest id.

I attach a one-line patch that fixes the issue."		closed	Database layer (models, ORM)	dev		wontfix	latest		Unreviewed	1	0	0	0	0	0
