After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766505 - search in gnome-music raises tracker warnings
search in gnome-music raises tracker warnings
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2016-05-16 08:52 UTC by Marinus Schraal
Modified: 2016-11-02 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
errors when querying artist and album (749 bytes, text/plain)
2016-05-16 12:42 UTC, Marinus Schraal
  Details
libtracker-data: Refine BIND() variable mapping (2.57 KB, patch)
2016-05-29 23:35 UTC, Carlos Garnacho
committed Details | Review
query: Quote column names in fts:match clauses (4.11 KB, patch)
2016-11-01 14:46 UTC, Carlos Garnacho
committed Details | Review

Description Marinus Schraal 2016-05-16 08:52:14 UTC
The queries for artist/album/song are broken since the query rework in 2.19 it seems. Ironically it seems to be commit https://git.gnome.org/browse/gnome-music/commit/?id=0b169a97f22305c4822a532a08aaa80f615cc336 that broke it.
Comment 1 Carlos Garnacho 2016-05-16 12:01:23 UTC
Broken exactly how? Are you using Tracker master or 1.8?

I can see missing songs/albums when running tracker 1.9/master, but AFAICS it all comes back normal if running tracker 1.8. 

Trying with the combinations, I've figured out the difference in behavior is triggered by tracker-extract, running everything from master except tracker extract brings all songs in the views. Doing the opposite (just running tracker-extract from master) results in missing albums.

So it seems something with the metadata, I tracked it down to commit 79af6adf6ee3. Reverting it brings back all songs in the music view here. I'm still unclear why though, the metadata is most similar for files I see missing here.

Could you confirm? In that case, please reassign to tracker and retitle :)
Comment 2 Carlos Garnacho 2016-05-16 12:03:28 UTC
The commit is https://git.gnome.org/browse/tracker/commit/?id=79af6adf6ee3
Comment 3 Marinus Schraal 2016-05-16 12:42:53 UTC
Created attachment 327974 [details]
errors when querying artist and album

Tried with tracker 1.8.0 (release) and 1.9 (git). Output is as in attachment when trying to search specifically for artist and album.

Could still be a local set-up problem if you can't reproduce.
Comment 4 Carlos Garnacho 2016-05-16 16:10:28 UTC
The full warning is:
(gnome-music:10772): Grilo-WARNING **: [tracker-source-request] grl-tracker-source-api.c:501: Could not execute sparql query id=3: no such column: nmm:MusicAlbum_nmm:albumArtist3.nmm:albumArtist

This is not due to sparql, but apparently an error in libtracker-sparql (that's not an ontology warning, but a sql engine one). For added fun, running the same queries with "tracker sparql" brings no warnings.

Reassigning and retitling.
Comment 5 Carlos Garnacho 2016-05-29 23:35:39 UTC
Created attachment 328707 [details] [review]
libtracker-data: Refine BIND() variable mapping

The implementation of BIND() introduced an special case in the way we
construct the result columns in selects (Handled in commit 64b54a7784).
This special case however turns out wrong when the resolved variable
is used both in and outside the BIND() statement.

So, admit the nature of this hack and special case it altogether, the
check was too iffy when there is really one situation where this makes
sense.
Comment 6 Carlos Garnacho 2016-05-30 09:59:45 UTC
I also forgot to mention, the issue mentioned in comment #1 is also fixed, commit 6dc2c858561
Comment 7 Carlos Garnacho 2016-06-04 23:03:23 UTC
Pushed to master at the moment, a candidate for 1.8 though.

Attachment 328707 [details] pushed as 4e5cc9b - libtracker-data: Refine BIND() variable mapping
Comment 8 Marinus Schraal 2016-06-05 13:56:23 UTC
Sorry, I didn't get around to testing the patches earlier. However, current master -including this patch- doesn't solve the problem for me. I still get the exact same warnings as in comment #3 .
Comment 9 Marinus Schraal 2016-10-31 23:12:07 UTC
Ok, I did some digging and figured this is probably due to switching to FTS5 and FTS5 defining syntax for the colon symbol ( https://sqlite.org/fts5.html#full_text_query_syntax ).

Music does it's fts searches by searching for the full iri's (?) ( eg. https://git.gnome.org/browse/gnome-music/tree/gnomemusic/query.py#n855 ), the semicolon messes with the sql query it looks like.

This would mean we need to rewrite the queries. Any thought on this?
Comment 10 Carlos Garnacho 2016-11-01 14:46:45 UTC
Created attachment 338890 [details] [review]
query: Quote column names in fts:match clauses

The colon in the column name seems able to confuse the FTS parser,
let's help it better by enclosing the column name with double
quotes, which is valid syntax according to the FTS5 syntax reference.
Comment 11 Carlos Garnacho 2016-11-01 14:50:40 UTC
Moving back to gnome-music, as the FTS syntax is pretty much offered as-is, there's not much further involvement from tracker here.