[tracker/tracker-3.2: 2/3] libtracker-sparql: Ensure correct integer ordering of queried notifier IDs




commit ab82269697e503f9d4c64802700e3796abd8fd1d
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 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);
 


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