Skip to content

ItemFetchJob: split up the query to avoid SQL placeholder limit

David Faure requested to merge work/dfaure/split-up-query into master

I have a folder with 67k items in it, and reindexing it failed with the SQL error "Prepared statement contains too many placeholders" because Mariadb has a limit of 64k placeholders in one query.

For context, that query comes from CollectionIndexingJob::indexItems (akonadi-search/agent/collectionindexingjob.cpp) which creates the Akonadi::ItemFetchJob with 67041 items

Commit b403d437 indicates that SQLITE has a limit at 1000 so let's split up by chunks of 1000 while at it.

Merge request reports

Loading