Skip to content
  1. Apr 18, 2024
    • Carlos Garnacho's avatar
      Merge branch 'wip/fix-sqlite-3.45.3' into 'master' · c9a8ea81
      Carlos Garnacho authored
      core: Fix incompatibility introduced by SQLite 3.45.3
      
      Closes #435
      
      See merge request !665
      c9a8ea81
    • Carlos Garnacho's avatar
      core: Fix incompatibility introduced by SQLite 3.45.3 · 0c576af6
      Carlos Garnacho authored
      For the umpteenth time, SQLite introduced behavioral changes that
      we need to adapt to. This time, version 3.45.3 "fixed" at
      https://github.com/sqlite/sqlite/commit/74851f66811854c772a9b2d0a13f1e9e82b69c25
      their SQLITE_ALLOW_ROWID_IN_VIEW build-time option which controls the
      behavior of views having an implicit ROWID column vs not.
      
      This broke our view used to proxy data to the content-less FTS5
      table, since the SELECT query it translates to used a naked reference to
      ROWID that is now deemed "ambiguous" by SQLite engine, this results
      in the following errors:
      
      Tracker:ERROR:../tests/core/tracker-ontology-test.c:231:test_query: assertion failed (error == NULL): ambiguous column name: ROWID (tracker-db-interface-error-quark, 0)
      
      We are actually referencing data inside the SELECT query, so fix this
      ambiguity by stating clearly the table/column that we are referring to
      within the SELECT query clause. This is backwards compatible with older
      versions of SQLite.
      
      Closes: GNOME/tracker#435
      0c576af6
  2. Apr 15, 2024
  3. Apr 11, 2024
  4. Apr 05, 2024
  5. Apr 03, 2024
  6. Mar 29, 2024
    • Carlos Garnacho's avatar
      tests: Add test ensuring that DELETE WHERE does not alter the iterated cursor · 4e3e3dc1
      Carlos Garnacho authored
      The changes in the delete clause should not alter the results that the where
      clause goes through. Add a test ensuring that.
      4e3e3dc1
    • Carlos Garnacho's avatar
      core: Avoid flushing updates within delete+insert+where queries · f436db08
      Carlos Garnacho authored
      Currently, we perform the insert/delete operations while iterating
      a cursor dealing with the where clause. Performing updates while
      performing select queries and iterating through cursors is usually
      not an issue, but that is only true (with WAL) if this is performed
      through different interfaces, so the readers can interact with the
      unmodified database while updates are accumulated in the write-ahead
      log. More information at https://www.sqlite.org/isolation.html.
      
      But here, we are dealing with a cursor created from the update thread,
      inside the same lock and seeing the same data than the latest update.
      
      So, if a delete{}insert{}where{} query happens to be modifying data
      that alter the results of the where{} clause, we might be getting the
      cursor silently updated underneath, thus either missing data that
      originally matched the where{} clause, or overreaching with brand
      new data that happens to match the where{} clause.
      
      As per the specs, the ex...
      f436db08
    • Carlos Garnacho's avatar
      core: Add mechanism to freeze flush · eb184785
      Carlos Garnacho authored
      Most regularly, we can do (and prefer) small buffers. This is not universally
      true, so add this mechanism to ensure that operations will accumulate without
      database changes until fully thawed, at which point flush will work again.
      eb184785
    • Carlos Garnacho's avatar
      core: Handle the update buffer growing beyond the expected limits · 7200095a
      Carlos Garnacho authored
      Currently, the update machinery works on fairly small fixed buffers,
      and is optimized for the buffer never growing beyond those limits.
      Nominally, pointers to elements of a fixed size GArray are used as
      keys in a hashtable, so any realloc in the array due to the buffer
      overgrowing would render this hashtable data invalid.
      
      Handle indefinite growth, and make this array of elements an array
      of arrays of elements. This way we keep low sizes by default, allow
      growing without invalidating previously existing pointers (by adding
      new small sized buffer chunks), and during regular operation (i.e.
      with the buffers not overgrowing) this just takes a couple more memory
      allocations.
      7200095a
  7. Mar 28, 2024
  8. Mar 27, 2024
  9. Mar 25, 2024
  10. Mar 24, 2024
  11. Mar 22, 2024
  12. Mar 20, 2024
  13. Mar 17, 2024