Automattic / Automattic/HyperDB

Users queries can skip the SQL_CALC_FOUND_ROWS queries

Open
#136 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
150
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Running a query such as the following, followed by a `SELECT FOUND_ROWS()` will result in an error, and the found rows not being returned.
```
SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_users.ID FROM wp_users WHERE 1....
```

results in this error:
```
Attempted SELECT FOUND_ROWS() without prior SQL_CALC_FOUND_ROWS.
```

For an example of code that can trigger this, see https://github.com/WordPress/wporg-mu-plugins/pull/412

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.