generated code (RT#92300)
- Skip dumping unique indexes with expressions (RT#93613)
- Fix dumping unique indexes with DBD::Pg < 1.50
+ - Fix inconsistent naming of duplicate unique constraints
0.07039 2014-01-06
- Fix table listing with DBD::DB2 >= 1.85 (RT#91764)
$sth->finish;
my @retval;
- foreach my $index_name (keys %indices) {
+ foreach my $index_name (sort keys %indices) {
my (undef, @cols) = @{$indices{$index_name}};
# skip indexes with missing column names (e.g. expression indexes)
next unless @cols == grep $_, @cols;
my ($col, $constname, $seq) = @$row;
push(@{$keydata{$constname}}, [ $seq, $self->_lc($col) ]);
}
- foreach my $keyname (keys %keydata) {
+ foreach my $keyname (sort keys %keydata) {
my @ordered_cols = map { $_->[1] } sort { $a->[0] <=> $b->[0] }
@{$keydata{$keyname}};
push(@uniqs, [ $keyname => \@ordered_cols ]);
my $constraints = $self->_constraints_for($table, 'U');
- my @uniqs = map { [ $_ => $constraints->{$_} ] } keys %$constraints;
- return \@uniqs;
+ return [ map { [ $_ => $constraints->{$_} ] } sort keys %$constraints ];
}
sub _table_fk_info {
push @{$constraints->{$constraint_name}}, $self->_lc($column);
}
- my @uniqs = map { [ $_ => $constraints->{$_} ] } keys %$constraints;
- return \@uniqs;
+ return [ map { [ $_ => $constraints->{$_} ] } sort keys %$constraints ];
}
sub _columns_info_for {
push @{ $uniq{$constr} }, $self->_lc($col);
}
- return [ map [ $_ => $uniq{$_} ], keys %uniq ];
+ return [ map [ $_ => $uniq{$_} ], sort keys %uniq ];
}
sub _columns_info_for {
push @{$constr_names{$constr_name}}, $constr_col;
}
- my @uniqs = map { [ $_ => $constr_names{$_} ] } keys %constr_names;
- return \@uniqs;
+ return [ map { [ $_ => $constr_names{$_} ] } sort keys %constr_names ];
}
sub _table_comment {
c.relkind = 'r' AND
i.relkind = 'i' AND
n.nspname = ? AND
- c.relname = ?}
+ c.relname = ?
+ ORDER BY i.relname}
);
$uniq_sth->execute($table->schema, $table->name);
push @{$constraints->{$constraint_name}}, $self->_lc($column);
}
- my @uniqs = map { [ $_ => $constraints->{$_} ] } keys %$constraints;
- return \@uniqs;
+ return [ map { [ $_ => $constraints->{$_} ] } sort keys %$constraints ];
}
=head1 SEE ALSO
push @uniqs, [ $name => \@cols ];
}
$sth->finish;
- return \@uniqs;
+ return [ sort { $a->[0] cmp $b->[0] } @uniqs ];
}
sub _tables_list {
}
}
- my @uniqs = map { [ $_ => $uniqs{$_} ] } keys %uniqs;
-
$self->dbh->do("USE [$current_db]");
- return \@uniqs;
+ return [ map { [ $_ => $uniqs{$_} ] } sort keys %uniqs ];
}
sub _columns_info_for {
my @uniqs;
my $keydata = $self->_mysql_table_get_keys($table);
- foreach my $keyname (keys %$keydata) {
+ foreach my $keyname (sort keys %$keydata) {
next if $keyname eq 'PRIMARY';
push(@uniqs, [ $keyname => $keydata->{$keyname} ]);
}