[Pkg-owncloud-commits] [owncloud-client] 306/470: SyncJournalDb: Only close the db if the return code is not SQLITE_DONE

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 868edb1f0d2be5b855633ef0916f489451b27b35
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Apr 11 17:38:16 2016 +0200

    SyncJournalDb: Only close the db if the return code is not SQLITE_DONE
    
    SQLITE_DONE is the indicator for not more query results, which is a legal
    thing and not an error condition.
    
    Also, check _getFileRecordQuery for null pointer, as close() wipes it.
---
 src/libsync/syncjournaldb.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/libsync/syncjournaldb.cpp b/src/libsync/syncjournaldb.cpp
index 00f2f26..a14c1a6 100644
--- a/src/libsync/syncjournaldb.cpp
+++ b/src/libsync/syncjournaldb.cpp
@@ -807,13 +807,18 @@ SyncJournalFileRecord SyncJournalDb::getFileRecord(const QString& filename)
                 rec._contentChecksumType = _getFileRecordQuery->baValue(13);
             }
         } else {
-            QString err = _getFileRecordQuery->error();
-            qDebug() << "No journal entry found for " << filename << "Error: " << err;
-            locker.unlock();
-            close();
-            locker.relock();
+            int errId = _getFileRecordQuery->errorId();
+            if( errId != SQLITE_DONE ) { // only do this if the problem is different from SQLITE_DONE
+                QString err = _getFileRecordQuery->error();
+                qDebug() << "No journal entry found for " << filename << "Error: " << err;
+                locker.unlock();
+                close();
+                locker.relock();
+            }
+        }
+        if (_getFileRecordQuery) {
+            _getFileRecordQuery->reset_and_clear_bindings();
         }
-        _getFileRecordQuery->reset_and_clear_bindings();
     }
     return rec;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list