[tracker] libtracker-data: Fixed support for IN, NOT IN with <resources>
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Fixed support for IN, NOT IN with <resources>
- Date: Wed, 11 Aug 2010 11:56:38 +0000 (UTC)
commit 94e5f5c1f993dd7db891aaabef2167e7b5f37b40
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Aug 11 13:56:10 2010 +0200
libtracker-data: Fixed support for IN, NOT IN with <resources>
src/libtracker-data/tracker-sparql-expression.vala | 4 ++--
tests/libtracker-data/algebra/Makefile.am | 4 ++++
tests/libtracker-data/algebra/filter-in-3.out | 4 ++++
tests/libtracker-data/algebra/filter-in-3.rq | 4 ++++
tests/libtracker-data/algebra/filter-in-4.out | 4 ++++
tests/libtracker-data/algebra/filter-in-4.rq | 4 ++++
tests/libtracker-data/tracker-sparql-test.c | 2 ++
7 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 23bb28e..30fff1c 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -1097,10 +1097,10 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.OPEN_PARENS);
sql.append (" IN (");
if (!accept (SparqlTokenType.CLOSE_PARENS)) {
- translate_expression_as_string (sql);
+ translate_expression (sql);
while (accept (SparqlTokenType.COMMA)) {
sql.append (", ");
- translate_expression_as_string (sql);
+ translate_expression (sql);
}
expect (SparqlTokenType.CLOSE_PARENS);
}
diff --git a/tests/libtracker-data/algebra/Makefile.am b/tests/libtracker-data/algebra/Makefile.am
index 19ebed5..e88d0f0 100644
--- a/tests/libtracker-data/algebra/Makefile.am
+++ b/tests/libtracker-data/algebra/Makefile.am
@@ -13,6 +13,10 @@ EXTRA_DIST = \
filter-in-1.rq \
filter-in-2.out \
filter-in-2.rq \
+ filter-in-3.in \
+ filter-in-3.out \
+ filter-in-4.rq \
+ filter-in-4.out \
filter-placement-1.out \
filter-placement-1.rq \
filter-placement-2.out \
diff --git a/tests/libtracker-data/algebra/filter-in-3.out b/tests/libtracker-data/algebra/filter-in-3.out
new file mode 100644
index 0000000..bee50b4
--- /dev/null
+++ b/tests/libtracker-data/algebra/filter-in-3.out
@@ -0,0 +1,4 @@
+"1"
+"2"
+"3"
+"4"
diff --git a/tests/libtracker-data/algebra/filter-in-3.rq b/tests/libtracker-data/algebra/filter-in-3.rq
new file mode 100644
index 0000000..11d39f0
--- /dev/null
+++ b/tests/libtracker-data/algebra/filter-in-3.rq
@@ -0,0 +1,4 @@
+PREFIX : <http://example/>
+
+SELECT ?v
+{ ?x :p ?v . FILTER(?x IN (:x)) }
diff --git a/tests/libtracker-data/algebra/filter-in-4.out b/tests/libtracker-data/algebra/filter-in-4.out
new file mode 100644
index 0000000..bee50b4
--- /dev/null
+++ b/tests/libtracker-data/algebra/filter-in-4.out
@@ -0,0 +1,4 @@
+"1"
+"2"
+"3"
+"4"
diff --git a/tests/libtracker-data/algebra/filter-in-4.rq b/tests/libtracker-data/algebra/filter-in-4.rq
new file mode 100644
index 0000000..883045e
--- /dev/null
+++ b/tests/libtracker-data/algebra/filter-in-4.rq
@@ -0,0 +1,4 @@
+PREFIX : <http://example/>
+
+SELECT ?v
+{ ?x :p ?v . FILTER(str(?x) IN ('http://example/x')) }
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 0b85588..ccd688c 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -57,6 +57,8 @@ const TestInfo tests[] = {
{ "algebra/filter-scope-1", "algebra/data-2", FALSE },
{ "algebra/filter-in-1", "algebra/data-2", FALSE },
{ "algebra/filter-in-2", "algebra/data-2", FALSE },
+ { "algebra/filter-in-3", "algebra/data-2", FALSE },
+ { "algebra/filter-in-4", "algebra/data-2", FALSE },
{ "algebra/var-scope-join-1", "algebra/var-scope-join-1", FALSE },
{ "anon/query", "anon/data", FALSE },
{ "ask/ask-1", "ask/data", FALSE },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]