diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-09-09 18:11:13 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-09-09 18:11:13 +0200 |
commit | d361bb7806791b63702e55e3c86523c93436062f (patch) | |
tree | aa5ff6985ff3a6df6a127fcfffc30fa147253019 /lib | |
parent | 4d326930a84561f9ab4a530f67dafe042422435e (diff) | |
download | App-BorgRestore-d361bb7806791b63702e55e3c86523c93436062f.tar.gz App-BorgRestore-d361bb7806791b63702e55e3c86523c93436062f.tar.xz |
DB: Fix update_path_if_greater not working for existing rows
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/BorgRestore/DB.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/App/BorgRestore/DB.pm b/lib/App/BorgRestore/DB.pm index 010f916..3c9e0fb 100644 --- a/lib/App/BorgRestore/DB.pm +++ b/lib/App/BorgRestore/DB.pm @@ -171,7 +171,7 @@ method add_path($archive_id, $path, $time) { method update_path_if_greater($archive_id, $path, $time) { $self->_insert_path($archive_id, $path, $time); - my $st = $self->{dbh}->prepare_cached('update files set `'.$archive_id.'` = ? where `path` = ? and `'.$archive_id.'` < ?'); + my $st = $self->{dbh}->prepare_cached('update files set `'.$archive_id.'` = ? where `path` = ? and (`'.$archive_id.'` < ? or `'.$archive_id.'` is null)'); $st->execute($time, $path, $time); } |