# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1462235199 -7200 # Node ID d4e337567960056da04c6bce9f08c2c33d43201a # Parent 27e6288524018aa2aae8bd51eb8cb77df0694251 Add some debug statements and fix a bug in SQL execution. diff -r 27e628852401 -r d4e337567960 SqliteDBLink.cpp --- a/SqliteDBLink.cpp Tue May 03 02:23:14 2016 +0200 +++ b/SqliteDBLink.cpp Tue May 03 02:26:39 2016 +0200 @@ -318,6 +318,7 @@ bool infoQuery; switch (operation) { case Add: + qDebug() << "Add"; query = preparedTryAddQuery; infoQuery = true; break; @@ -333,12 +334,17 @@ assert(paths.size() == 0); return; } - query->bindValue("path", paths); + if (operation != Update) + query->bindValue("path", paths); if (infoQuery) { query->bindValue("size", sizes); query->bindValue("mtime", mtimes); query->bindValue("checksum", checksums); } + //Because QT for some reason expect the parameters to be given in sequence + if (operation == Update) + query->bindValue("path", paths); + if (!query->execBatch()) throw SQLException(*query); @@ -376,11 +382,16 @@ while (operation) { if (operation->type() != last) { + qDebug() << "Execute Operation first" << typeString(last); + foreach(QVariant path, paths) { + qDebug() << path.toString(); + } if (!preparedBeginQuery->exec()) throw SQLException(*preparedBeginQuery); executeOperation(paths, sizes, mtimes, hashes, last); if (!preparedEndQuery->exec()) throw SQLException(*preparedEndQuery); + qDebug() << "Execute Operation Done"; } switch (operation->type()) {