lib/Odin.pm: Alter `redir_query' to break ties by local part.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 4 Aug 2015 16:15:14 +0000 (17:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 4 Aug 2015 16:15:14 +0000 (17:15 +0100)
Otherwise the order is unstable across database modifications, at least
with PostgreSQL.

lib/Odin.pm

index b91eb96..a742839 100644 (file)
@@ -501,7 +501,7 @@ sub redir_query ($$$;$@) {
             ("SELECT lpart, expire, recip, comment
               FROM odin_mailredir WHERE dom = ? AND owner = ?" .
               (defined $cond ? " AND $cond" : "") . " " .
-             "ORDER BY expire", undef, $dom, $owner, @args)};
+             "ORDER BY expire, lpart", undef, $dom, $owner, @args)};
 }
 
 sub clear_redir_reservations ($) {