[tracker/rss-enclosures] libtracker-data: Fixes NB#174591, Throw error on undefined variable in expressions



commit 306c9bce33f8504ac6fa0040d4ccea4180dfa799
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Jun 15 11:43:32 2010 +0200

    libtracker-data: Fixes NB#174591, Throw error on undefined variable in expressions

 src/libtracker-data/tracker-sparql-expression.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index ea5052f..60e17de 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -870,7 +870,9 @@ class Tracker.Sparql.Expression : Object {
 			sql.append (variable.sql_expression);
 
 			if (variable.binding == null) {
-				return PropertyType.UNKNOWN;
+				// NB#174591, I replaced `return PropertyType.UNKNOWN` with throw
+				// make-test still works and the query now returns this error.
+				throw get_error ("use of undefined variable `%s'".printf (variable.name));
 			} else {
 				return variable.binding.data_type;
 			}



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