tracker r2999 - in trunk: . src/libtracker-db
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2999 - in trunk: . src/libtracker-db
- Date: Mon, 2 Mar 2009 23:38:07 +0000 (UTC)
Author: mottela
Date: Mon Mar 2 23:38:07 2009
New Revision: 2999
URL: http://svn.gnome.org/viewvc/tracker?rev=2999&view=rev
Log:
More proper handling of NULLs in aggregates
Modified:
trunk/ChangeLog
trunk/src/libtracker-db/tracker-db-interface-sqlite.c
trunk/src/libtracker-db/tracker-db-manager.c
Modified: trunk/src/libtracker-db/tracker-db-interface-sqlite.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-interface-sqlite.c (original)
+++ trunk/src/libtracker-db/tracker-db-interface-sqlite.c Mon Mar 2 23:38:07 2009
@@ -404,6 +404,10 @@
break;
}
+ case SQLITE_NULL: {
+ /* Ignore NULLs and let the function handle missing values */
+ break;
+ }
default:
g_critical ("Unknown sqlite3 database value type:%d",
sqlite3_value_type (argv[i]));
@@ -417,7 +421,10 @@
/* Now free all this mess */
for (i = 0; i < argc; i++) {
- g_value_unset (&values[i]);
+ /* Don't free NULLs */
+ if (G_VALUE_TYPE (&values[i]) != G_TYPE_INVALID) {
+ g_value_unset (&values[i]);
+ }
}
g_free (values);
Modified: trunk/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-manager.c (original)
+++ trunk/src/libtracker-db/tracker-db-manager.c Mon Mar 2 23:38:07 2009
@@ -1344,8 +1344,10 @@
} else {
p->string = g_string_append (p->string, "|");
}
-
- p->string = g_string_append (p->string, g_value_get_string (&values[0]));
+
+ if (G_VALUE_HOLDS_STRING (&values[0])) {
+ p->string = g_string_append (p->string, g_value_get_string (&values[0]));
+ }
}
static GValue
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]