[tracker/wip/carlosg/sparql-corners: 6/12] libtracker-sparql: Handle correctly OFFSET without LIMIT
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/sparql-corners: 6/12] libtracker-sparql: Handle correctly OFFSET without LIMIT
- Date: Mon, 1 Mar 2021 23:51:50 +0000 (UTC)
commit 8e7a3c9ed7784fd5f2a6826fb0db27a37afd2b19
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Feb 27 12:11:49 2021 +0100
libtracker-sparql: Handle correctly OFFSET without LIMIT
In Sparql, OFFSET and LIMIT can be set independently (and event flip
around!), however SQL mandates that OFFSET also needs LIMIT. Handle
correctly the case that only OFFSET is given, by setting an unlimited
limit.
src/libtracker-data/tracker-sparql.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index e2f1139b0..ce33a5ca2 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -3708,6 +3708,8 @@ translate_LimitOffsetClauses (TrackerSparql *sparql,
TRACKER_LITERAL_BINDING (limit));
_append_literal_sql (sparql, TRACKER_LITERAL_BINDING (limit));
g_object_unref (limit);
+ } else if (offset) {
+ _append_string (sparql, "LIMIT -1 ");
}
if (offset) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]