diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-02-03 17:57:45 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2022-02-04 11:53:22 +0100 |
commit | ab82269697e503f9d4c64802700e3796abd8fd1d (patch) | |
tree | 7dfd0282202e0312644d03f610aea46c85315205 | |
parent | 42a214be18110503d6f67e05515324237265b8b1 (diff) | |
download | tracker-ab82269697e503f9d4c64802700e3796abd8fd1d.tar.gz |
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
-rw-r--r-- | src/libtracker-sparql/tracker-notifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c index 7592d1bf2..01081a75b 100644 --- a/src/libtracker-sparql/tracker-notifier.c +++ b/src/libtracker-sparql/tracker-notifier.c @@ -407,7 +407,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); |