matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.19k stars 2.57k forks source link

Replace usage of SQL_CALC_FOUND_ROWS with separate queries #22225

Closed sgiehl closed 2 weeks ago

sgiehl commented 2 weeks ago

Description:

With MySQL 8.0.17 the SQL_CALC_FOUND_ROWS feature has been deprecated.

To ensure we stay compatible with upcoming MySQL releases, where this might be removed, this PR replaces all usages with separate queries to fetch the count.

Review

michalkleiner commented 2 weeks ago

I can't see it from the PR itself — how is the change around the headers related to the SQL_CALC_FOUND_ROWS?

sgiehl commented 2 weeks ago

The API does not return the count directly but sends it with a header. The changes are only to make that header testable in the API tests.