Skip to content

libtracker-data: Workaround SQLite 3.35.x bug

Carlos Garnacho requested to merge wip/carlosg/sqlite-3-35-workaround into master
The optimization for UNION ALLs inside JOINs had another unexpected
victim:

  SELECT * { GRAPH ?g { ?a ... OPTIONAL { ?a ... } } }

Does now break when matching the graph between both sides of the
LEFT JOIN caused by OPTIONAL, making all other values coming from
the right hand side come back empty. Make it sure this specific case
is ineligible for query flattening optimizations by adding a LIMIT
clause on the right hand side of the LEFT JOIN. This brings back
correct over fast.

This workaround should be revisited when a SQLite fix is available.

Merge request reports