Fri Oct 26 11:22:28 PDT 2007
- Previous message: [Slony1-commit] slony1-engine/tests/testmergeset README gen_ddl_slonik.sh generate_dml.sh
- Next message: [Slony1-commit] slony1-engine/tools/altperl slonik_build_env.pl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /home/cvsd/slony1/slony1-engine/tools/altperl
In directory main.slony.info:/tmp/cvs-serv28350
Modified Files:
Tag: REL_1_2_STABLE
slonik_build_env.pl
Log Message:
From: Bernd Helmle <mailings at oopsware.de>
--On Donnerstag, Oktober 25, 2007 13:11:49 -0700 slony at estrider.com wrote:
> There is a flaw in the slonik_build_env.pl script. The print test
> should be >=1 and not > 1. It currently will not print databases where
> there are only single tables or sequences.
>
You're right. I've created a patch with your changes plus a fix to
repair the -schema option, which was broken, too, and cc'ed
slony1-patches so someone can review and apply it.
Note that slonik_build_environment is called slonik_build_env only,
the former was removed.
--
Thanks
Bernd
-------------------------------------------------
Looks good to me - applied to 1.2 branch...
Index: slonik_build_env.pl
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tools/altperl/slonik_build_env.pl,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -C2 -d -r1.1.4.1 -r1.1.4.2
*** slonik_build_env.pl 13 Dec 2006 22:18:50 -0000 1.1.4.1
--- slonik_build_env.pl 26 Oct 2007 18:22:25 -0000 1.1.4.2
***************
*** 25,29 ****
Default schema is \"public\"\n";
! &usage if(!GetOptions('node=s@'=>\@nodes));
die "At least one node is required" if ( scalar(@nodes) < 1 );
--- 25,29 ----
Default schema is \"public\"\n";
! &usage if(!GetOptions('node=s@'=>\@nodes, 'schema=s' => \$schema));
die "At least one node is required" if ( scalar(@nodes) < 1 );
***************
*** 69,72 ****
--- 69,73 ----
die "prepare(tableQuery): $DBI::errstr" if ( !defined($tableQuery) || $DBI::err );
die "execute(tableQuery): $DBI::errstr" if ( !$tableQuery->execute() );
+ die "No objects to replicate found in schema \"$schema\"\n" if ($tableQuery->rows <= 0);
my @tablesWithIndexes;
***************
*** 84,88 ****
$dbh->disconnect();
! if ( scalar(@tablesWithIndexes) > 1 ) {
print '@KEYEDTABLES=(' . "\n";
foreach my $table (sort @tablesWithIndexes) {
--- 85,89 ----
$dbh->disconnect();
! if ( scalar(@tablesWithIndexes) >= 1 ) {
print '@KEYEDTABLES=(' . "\n";
foreach my $table (sort @tablesWithIndexes) {
***************
*** 91,95 ****
print ");\n";
}
! if ( scalar(@tablesWithoutIndexes) > 1 ) {
print '@SERIALTABLES=(' . "\n";
foreach my $table (sort @tablesWithoutIndexes) {
--- 92,96 ----
print ");\n";
}
! if ( scalar(@tablesWithoutIndexes) >= 1 ) {
print '@SERIALTABLES=(' . "\n";
foreach my $table (sort @tablesWithoutIndexes) {
***************
*** 98,102 ****
print ");\n";
}
! if ( scalar(@sequences) > 1 ) {
print '@SEQUENCES=(' . "\n";
foreach my $table (sort @sequences) {
--- 99,103 ----
print ");\n";
}
! if ( scalar(@sequences) >= 1 ) {
print '@SEQUENCES=(' . "\n";
foreach my $table (sort @sequences) {
- Previous message: [Slony1-commit] slony1-engine/tests/testmergeset README gen_ddl_slonik.sh generate_dml.sh
- Next message: [Slony1-commit] slony1-engine/tools/altperl slonik_build_env.pl
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list