diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-04-22 03:48:38 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-04-22 03:48:38 +0000 |
commit | a4d9d3e028b8baea16521ad928f824796bf56bc8 (patch) | |
tree | c0af9783098be083c69ad825e36f62eaec3c5627 | |
parent | 914042fe5f7901d0b1ce1a0fceb743deaf5f91dc (diff) |
Attached is are a few small fixes for dbmirror.
1. Fixed bug where sequences were being mirrored incorrectly if they
exceeded 127
2. Fixed a bug in the perl script with mirroring sequences(John
Burtenshaw sent an email to patches describing the bug in March but I
htink he forgot to attach his patch)
3. The dates/times in the transaction files will always use 2 digits.
Steven Singer
-rwxr-xr-x | contrib/dbmirror/DBMirror.pl | 6 | ||||
-rw-r--r-- | contrib/dbmirror/pending.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/contrib/dbmirror/DBMirror.pl b/contrib/dbmirror/DBMirror.pl index 1eb917bf180..98592c66201 100755 --- a/contrib/dbmirror/DBMirror.pl +++ b/contrib/dbmirror/DBMirror.pl @@ -33,7 +33,7 @@ # # ############################################################################## -# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.8 2004/02/17 03:34:35 momjian Exp $ +# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.9 2004/04/22 03:48:38 momjian Exp $ # ############################################################################## @@ -660,7 +660,7 @@ sub mirrorSequence($$$$$) { my $query; my $sequenceValue = $pendingResult->getvalue($currentTuple,4); - $query = sprintf("select setval(%s,%s)",$sequenceName,$sequenceValue); + $query = sprintf("select setval('%s',%s)",$sequenceName,$sequenceValue); sendQueryToSlaves($transId,$query); return $currentTuple; @@ -960,7 +960,7 @@ sub openTransactionFile($$) my $nowisdst; ($nowsec,$nowmin,$nowhour,$nowmday,$nowmon,$nowyear,$nowwday,$nowyday,$nowisdst) = localtime; - my $fileName=sprintf(">%s/%s_%d-%d-%d_%d:%d:%dXID%d.sql", $::slaveInfo->{'TransactionFileDirectory'}, + my $fileName=sprintf(">%s/%s_%02d-%02d-%02d_%02d:%02d:%dXID%d.sql", $::slaveInfo->{'TransactionFileDirectory'}, $::slaveInfo->{"MirrorHostId"},($nowyear+1900),($nowmon+1),$nowmday,$nowhour,$nowmin, $nowsec,$XID); diff --git a/contrib/dbmirror/pending.c b/contrib/dbmirror/pending.c index 24fb71b9e2d..7e6ac651f04 100644 --- a/contrib/dbmirror/pending.c +++ b/contrib/dbmirror/pending.c @@ -1,7 +1,7 @@ /**************************************************************************** * pending.c - * $Id: pending.c,v 1.16 2004/02/17 03:34:35 momjian Exp $ - * $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.16 2004/02/17 03:34:35 momjian Exp $ + * $Id: pending.c,v 1.17 2004/04/22 03:48:38 momjian Exp $ + * $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.17 2004/04/22 03:48:38 momjian Exp $ * * This file contains a trigger for Postgresql-7.x to record changes to tables * to a pending table for mirroring. @@ -701,7 +701,7 @@ nextval(PG_FUNCTION_ARGS) debug_msg("dbmirror:nextval Set resTuple"); - nextSequenceValue =*(DatumGetPointer(SPI_getbinval(resTuple, + nextSequenceValue =* (unsigned int *)(DatumGetPointer(SPI_getbinval(resTuple, SPI_tuptable->tupdesc, 1,&isNull))); |