| |
@@ -0,0 +1,82 @@
|
| |
+ From 0b25059e853235dc46ffa17d1261d6e3f4d303c9 Mon Sep 17 00:00:00 2001
|
| |
+ From: Carlos Garnacho <carlosg@gnome.org>
|
| |
+ Date: Sat, 26 Dec 2020 12:45:39 +0100
|
| |
+ Subject: [PATCH] libtracker-sparql: Fix out parameter in VAPI/Vala files
|
| |
+
|
| |
+ This argument was made nullable in commit 5ea2e77fa. While this sounds
|
| |
+ what we want (the argument is nullable in C API and the vmethod). This
|
| |
+ makes Vala introduce a double indirection for the out parameter, so
|
| |
+ the argument ends up as "glong**" in the generated C code.
|
| |
+
|
| |
+ Of course, this breaks the interaction with C code and cursor class
|
| |
+ definition expecting a "glong*" there, extra points for the C compiler
|
| |
+ error being silenced. Undoing these specific changes from that commit
|
| |
+ makes Vala and C code agree again about the levels of indirection.
|
| |
+
|
| |
+ This broke callers that rely on the string length being meaningful,
|
| |
+ a glaring known broken case is the portal, as it breaks the
|
| |
+ redirection/serialization of cursors to sandboxed apps.
|
| |
+
|
| |
+ Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/282
|
| |
+ ---
|
| |
+ src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala | 2 +-
|
| |
+ src/libtracker-sparql/remote/tracker-json-cursor.vala | 2 +-
|
| |
+ src/libtracker-sparql/remote/tracker-xml-cursor.vala | 2 +-
|
| |
+ src/libtracker-sparql/tracker-sparql.vapi | 2 +-
|
| |
+ 4 files changed, 4 insertions(+), 4 deletions(-)
|
| |
+
|
| |
+ diff --git a/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala b/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala
|
| |
+ index b0ea605ab..954ad1ec7 100644
|
| |
+ --- a/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala
|
| |
+ +++ b/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala
|
| |
+ @@ -69,7 +69,7 @@ class Tracker.Bus.FDCursor : Tracker.Sparql.Cursor {
|
| |
+ return variable_names[column];
|
| |
+ }
|
| |
+
|
| |
+ - public override unowned string? get_string (int column, out long? length = null)
|
| |
+ + public override unowned string? get_string (int column, out long length = null)
|
| |
+ requires (cursor_finished == false) {
|
| |
+ unowned string str = null;
|
| |
+
|
| |
+ diff --git a/src/libtracker-sparql/remote/tracker-json-cursor.vala b/src/libtracker-sparql/remote/tracker-json-cursor.vala
|
| |
+ index e85c6f459..047d47278 100644
|
| |
+ --- a/src/libtracker-sparql/remote/tracker-json-cursor.vala
|
| |
+ +++ b/src/libtracker-sparql/remote/tracker-json-cursor.vala
|
| |
+ @@ -95,7 +95,7 @@ public class Tracker.Remote.JsonCursor : Tracker.Sparql.Cursor {
|
| |
+ return _vars.get_string_element (column);
|
| |
+ }
|
| |
+
|
| |
+ - public override unowned string? get_string (int column, out long? length = null) requires (_cur_row != null) {
|
| |
+ + public override unowned string? get_string (int column, out long length = null) requires (_cur_row != null) {
|
| |
+ var col_node = _cur_row.get_member (get_variable_name (column));
|
| |
+ length = 0;
|
| |
+
|
| |
+ diff --git a/src/libtracker-sparql/remote/tracker-xml-cursor.vala b/src/libtracker-sparql/remote/tracker-xml-cursor.vala
|
| |
+ index 47314c960..a7a710041 100644
|
| |
+ --- a/src/libtracker-sparql/remote/tracker-xml-cursor.vala
|
| |
+ +++ b/src/libtracker-sparql/remote/tracker-xml-cursor.vala
|
| |
+ @@ -144,7 +144,7 @@ public class Tracker.Remote.XmlCursor : Tracker.Sparql.Cursor {
|
| |
+ return _vars[column];
|
| |
+ }
|
| |
+
|
| |
+ - public override unowned string? get_string (int column, out long? length = null) requires (_cur_row != null) {
|
| |
+ + public override unowned string? get_string (int column, out long length = null) requires (_cur_row != null) {
|
| |
+ length = 0;
|
| |
+
|
| |
+ var variable = _vars[column];
|
| |
+ diff --git a/src/libtracker-sparql/tracker-sparql.vapi b/src/libtracker-sparql/tracker-sparql.vapi
|
| |
+ index a7c758d5f..6174ff8c4 100644
|
| |
+ --- a/src/libtracker-sparql/tracker-sparql.vapi
|
| |
+ +++ b/src/libtracker-sparql/tracker-sparql.vapi
|
| |
+ @@ -122,7 +122,7 @@ namespace Tracker {
|
| |
+ public abstract Sparql.ValueType get_value_type (int column);
|
| |
+
|
| |
+ public abstract unowned string? get_variable_name (int column);
|
| |
+ - public abstract unowned string? get_string (int column, out long? length = null);
|
| |
+ + public abstract unowned string? get_string (int column, out long length = null);
|
| |
+
|
| |
+ public abstract bool next (GLib.Cancellable? cancellable = null) throws GLib.Error;
|
| |
+ public async abstract bool next_async (GLib.Cancellable? cancellable = null) throws GLib.Error;
|
| |
+ --
|
| |
+ 2.29.2
|
| |
+
|
| |
This causes Vala apps that depend on Tracker to fail at querying the
data store.
See also https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/637
Signed-off-by: Felipe Borges felipeborges@gnome.org