(RT#59619)
- Fixed t/54taint fails under local-lib
- Fixed SELECT ... FOR UPDATE with LIMIT regression (RT#58554)
+ - Fixed CDBICompat to preserve order of column-group additions,
+ so that test relying on the order of %{} will no longer fail
* Misc
- Refactored capability handling in Storage::DBI, allows for
use warnings;
use Sub::Name ();
use Storable 'dclone';
+use List::Util ();
use base qw/DBIx::Class::Row/;
$class->_add_column_group($group => @_) if @_;
return $class->all_columns if $group eq "All";
return $class->primary_column if $group eq "Primary";
- return keys %{$class->_column_groups->{$group}};
+
+ my $grp = $class->_column_groups->{$group};
+ my @grp_cols = sort { $grp->{$b} <=> $grp->{$a} } (keys %$grp);
+ return @grp_cols;
}
sub _add_column_group {
if ($group eq 'Primary') {
$class->set_primary_key(@cols);
- $groups->{'Essential'}{$_} ||= 1 for @cols;
+ delete $groups->{'Essential'}{$_} for @cols;
+ my $first = List::Util::max(values %{$groups->{'Essential'}});
+ $groups->{'Essential'}{$_} = ++$first for reverse @cols;
}
if ($group eq 'All') {
}
}
- $groups->{$group}{$_} ||= 1 for @cols;
+ delete $groups->{$group}{$_} for @cols;
+ my $first = List::Util::max(values %{$groups->{$group}});
+ $groups->{$group}{$_} = ++$first for reverse @cols;
$class->_column_groups($groups);
}