[tracker] libtracker-data: Improve error reporting when trying to set WAL journal mode fails



commit 6d54c904e2bba1b65d3c476f6b787db54b896e63
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Nov 22 21:17:36 2010 +0100

    libtracker-data: Improve error reporting when trying to set WAL journal mode fails

 src/libtracker-data/tracker-db-manager.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 92d8d48..6d3b900 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -224,6 +224,7 @@ db_set_params (TrackerDBInterface *iface,
 		}
 		g_free (queries);
 	} else {
+		GError *error = NULL;
 		TrackerDBResultSet *result_set;
 
 		tracker_db_interface_execute_query (iface, NULL, "PRAGMA synchronous = OFF;");
@@ -232,10 +233,12 @@ db_set_params (TrackerDBInterface *iface,
 		tracker_db_interface_execute_query (iface, NULL, "PRAGMA encoding = \"UTF-8\"");
 		tracker_db_interface_execute_query (iface, NULL, "PRAGMA auto_vacuum = 0;");
 
-		result_set = tracker_db_interface_execute_query (iface, NULL, "PRAGMA journal_mode = WAL;");
+		result_set = tracker_db_interface_execute_query (iface, &error, "PRAGMA journal_mode = WAL;");
 		if (result_set == NULL) {
 			/* Don't just silence the problem. This pragma must return 'WAL' */
-			g_message ("Can't set journal mode to WAL");
+			g_message ("Can't set journal mode to WAL: '%s'",
+			           error ? error->message : "unknown error");
+			g_clear_error (&error);
 		} else {
 			g_object_unref (result_set);
 		}



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