diff options
author | Russ Allbery <eagle@eyrie.org> | 2020-05-17 22:14:58 -0700 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2020-05-17 22:14:58 -0700 |
commit | 47c722846ece5eb460d91c243e4358eb31e4614b (patch) | |
tree | ad13e5679ef0f4ec07cfa541b550f5b48a12889e /perl/lib/Wallet/ACL.pm | |
parent | c60d58ee05141b058fcb03381a3b34bb7d70c15a (diff) |
Sort ACL history by unique key after date
If multiple ACL changes were made in the same second, the order of
results could be unstable. Sort by unique key after date to avoid
this. Based on work by macrotex.
Diffstat (limited to 'perl/lib/Wallet/ACL.pm')
-rw-r--r-- | perl/lib/Wallet/ACL.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perl/lib/Wallet/ACL.pm b/perl/lib/Wallet/ACL.pm index 58e33b4..5b949e9 100644 --- a/perl/lib/Wallet/ACL.pm +++ b/perl/lib/Wallet/ACL.pm @@ -1,7 +1,7 @@ # Wallet::ACL -- Implementation of ACLs in the wallet system # # Written by Russ Allbery <eagle@eyrie.org> -# Copyright 2016 Russ Allbery <eagle@eyrie.org> +# Copyright 2016, 2020 Russ Allbery <eagle@eyrie.org> # Copyright 2007-2008, 2010, 2013-2015 # The Board of Trustees of the Leland Stanford Junior University # @@ -438,7 +438,7 @@ sub history { eval { my $guard = $self->{schema}->txn_scope_guard; my %search = (ah_acl => $self->{id}); - my %options = (order_by => 'ah_on'); + my %options = (order_by => { -asc => [qw/ah_on ah_id/] }); my @data = $self->{schema}->resultset('AclHistory') ->search (\%search, \%options); for my $data (@data) { |