[tracker/async-queries-cursor-review: 7/7] libtracker-db: Fixed a problem with sqlite3_interrupt usage for cursors



commit ab163e00fff1f4ba1cf68d47045a98ebca5f583d
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Apr 22 16:24:02 2010 +0200

    libtracker-db: Fixed a problem with sqlite3_interrupt usage for cursors

 src/libtracker-db/tracker-db-interface-sqlite.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index 46a5a63..b2324ab 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -1086,6 +1086,14 @@ tracker_db_cursor_sqlite_iter_next (TrackerDBCursor *cursor,
 			             TRACKER_DB_INTERFACE_ERROR,
 			             TRACKER_DB_INTERRUPTED,
 			             "Interrupted");
+
+			/* This is the same as the SQLITE_INTERRUPT handling in the
+			 * create_result_set_from_stmt above. */
+			while (result == SQLITE_INTERRUPT) {
+				sqlite3_reset (priv->stmt);
+				result = sqlite3_step (priv->stmt);
+			}
+
 		} else if (result != SQLITE_ROW && result != SQLITE_DONE) {
 			TrackerDBStatementSqlite *stmt = priv->ref_stmt;
 			TrackerDBStatementSqlitePrivate *stmt_priv = TRACKER_DB_STATEMENT_SQLITE_GET_PRIVATE (stmt);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]