[Bps-public-commit] r17255 - Prophet/branches/sqlite/lib/Prophet/Replica

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Dec 16 08:04:22 EST 2008


Author: sunnavy
Date: Tue Dec 16 08:04:21 2008
New Revision: 17255

Modified:
   Prophet/branches/sqlite/lib/Prophet/Replica/sqlite.pm

Log:
don't _delete_record_from_db if there's no record exist

Modified: Prophet/branches/sqlite/lib/Prophet/Replica/sqlite.pm
==============================================================================
--- Prophet/branches/sqlite/lib/Prophet/Replica/sqlite.pm	(original)
+++ Prophet/branches/sqlite/lib/Prophet/Replica/sqlite.pm	Tue Dec 16 08:04:21 2008
@@ -337,7 +337,8 @@
     }
 
     # We're in a transaction here, right?
-    $self->_delete_record_from_db( uuid => $args{uuid} );
+    $self->_delete_record_from_db( uuid => $args{uuid} ) if
+        $self->record_exists( uuid => $args{uuid}, type => $args{type} );
     $self->dbh->do( "INSERT INTO records (type, uuid) VALUES (?,?)", {},
         $args{type}, $args{uuid} );
     $self->dbh->do(



More information about the Bps-public-commit mailing list