Skip to content

Users queries can skip the SQL_CALC_FOUND_ROWS queries #136

@dd32

Description

@dd32

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 WordPress/wporg-mu-plugins#412

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions