[Bps-public-commit] Prophet branch, master, updated. 0.69_01-56-gb6c7469

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Sep 4 08:37:00 EDT 2009


The branch, master has been updated
       via  b6c74691330bf14ace985963feb82644ca0725bd (commit)
      from  feef064a11deb8a034fd8606af4b40d17cb45b8e (commit)

Summary of changes:
 lib/Prophet/Replica/sqlite.pm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit b6c74691330bf14ace985963feb82644ca0725bd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Sep 4 20:36:53 2009 +0800

    fix sqlite replica: original_sequence_no can be 0

diff --git a/lib/Prophet/Replica/sqlite.pm b/lib/Prophet/Replica/sqlite.pm
index c6b329e..7a570f6 100644
--- a/lib/Prophet/Replica/sqlite.pm
+++ b/lib/Prophet/Replica/sqlite.pm
@@ -647,7 +647,10 @@ sub _write_changeset_to_db {
 
     my $local_id = $self->dbh->last_insert_id(undef, undef, 'changesets', 'sequence_no');
 
-    $self->dbh->do("UPDATE changesets set original_sequence_no = sequence_no WHERE sequence_no = ?", {}, $local_id) unless ($changeset->original_sequence_no);
+    $self->dbh->do(
+        "UPDATE changesets set original_sequence_no = sequence_no
+            WHERE sequence_no = ?", {}, $local_id
+    ) unless defined $changeset->original_sequence_no;
 
     for my $change (@{$changeset->changes}) {
         $self->_write_change_to_db($change, $local_id);

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list