[tracker/cursor: 15/15] SPARQL: Do not use CAST to convert integers to strings



commit ed12a87b46c3d3c383a90ffe8dafea0ff35c9a7f
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jan 18 13:58:19 2011 +0100

    SPARQL: Do not use CAST to convert integers to strings
    
    This breaks use of index when sorting by variable introduced in
    select expression.
    
    Fixes NB#218092.

 src/libtracker-data/tracker-sparql-expression.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 824495b..bd4a53a 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -246,7 +246,10 @@ class Tracker.Sparql.Expression : Object {
 	static void convert_expression_to_string (StringBuilder sql, PropertyType type, long begin) {
 		switch (type) {
 		case PropertyType.STRING:
+		case PropertyType.INTEGER:
 			// nothing to convert
+			// do not use CAST to convert integers to strings as this breaks use
+			// of index when sorting by variable introduced in select expression
 			break;
 		case PropertyType.RESOURCE:
 			// ID => Uri



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