[tracker/tracker-0.8] libtracker-data: Bugfix NB#172652, comparing NULL isn't reliable



commit 218e1b7e4b324e637cdbd190eebb25929884d446
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Jun 7 17:15:18 2010 +0300

    libtracker-data: Bugfix NB#172652, comparing NULL isn't reliable

 src/libtracker-data/tracker-sparql-expression.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 95b70c4..827bb7c 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -778,7 +778,7 @@ class Tracker.Sparql.Expression : Object {
 			return result;
 		} else {
 			// resource
-			sql.append ("(SELECT ID FROM Resource WHERE Uri = ?)");
+			sql.append ("COALESCE((SELECT ID FROM Resource WHERE Uri = ?), 0)");
 			var binding = new LiteralBinding ();
 			binding.literal = uri;
 			query.bindings.append (binding);



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