From: dpavlin Date: Fri, 26 Aug 2005 17:18:27 +0000 (+0000) Subject: fixed found_in_db to prevent duplicate file insertion when restarting from X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=b59baa0780b6b354ac5a940ec179d702178af680;p=BackupPC.git fixed found_in_db to prevent duplicate file insertion when restarting from non-empty database. git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@74 8392b6e1-25fa-0310-8288-cc32f8e212ea --- diff --git a/bin/BackupPC_updatedb b/bin/BackupPC_updatedb index 6a5479f..ae14d63 100755 --- a/bin/BackupPC_updatedb +++ b/bin/BackupPC_updatedb @@ -330,7 +330,7 @@ sub found_in_db { my @data = @_; shift @data; - my ($key, $shareID,undef,$name,$path,undef,$date,undef,$size) = @_; + my ($key, $shareID,undef,$name,$path,$date,undef,$size) = @_; return $beenThere->{$key} if (defined($beenThere->{$key})); @@ -340,12 +340,13 @@ sub found_in_db { path = ? and date = ? and size = ? + LIMIT 1 }); my @param = ($shareID,$path,$date,$size); $sth->{file_in_db}->execute(@param); my $rows = $sth->{file_in_db}->rows; - print STDERR "## found_in_db ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3); + print STDERR "## found_in_db($shareID,$path,$date,$size) ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3); $beenThere->{$key}++;