[tracker/wip/carlosg/ensure-notifier-order: 1/2] libtracker-sparql: Ensure correct integer ordering of queried notifier IDs
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/ensure-notifier-order: 1/2] libtracker-sparql: Ensure correct integer ordering of queried notifier IDs
- Date: Thu, 3 Feb 2022 17:21:24 +0000 (UTC)
commit 2fea3bfed625d496dd2e66bb84111fa412989a32
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Feb 3 17:57:45 2022 +0100
libtracker-sparql: Ensure correct integer ordering of queried notifier IDs
We query info for IDs in an specific order and expect them to come in the exact
same order in the cursor, however the column may be implicitly mapped to a
string type, which may result in a different ordering.
Ensure the ORDER BY happens with integer affinity, this ensures the cursor
values are in the expected order.
Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/345
Related: https://gitlab.gnome.org/GNOME/gnome-music/-/issues/487
src/libtracker-sparql/tracker-notifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c
index cb7ce9022..ea8391a88 100644
--- a/src/libtracker-sparql/tracker-notifier.c
+++ b/src/libtracker-sparql/tracker-notifier.c
@@ -406,7 +406,7 @@ create_extra_info_query (TrackerNotifier *notifier,
if (service)
g_string_append (sparql, "} ");
- g_string_append (sparql, "ORDER BY ?id");
+ g_string_append (sparql, "ORDER BY xsd:integer(?id)");
g_free (service);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]