Skip to content

WordPress database error Expression #1 of ORDER BY clause is not in SELECT list #120

@AlligatorNest

Description

@AlligatorNest

HyperDB files are causing the following errors on certain SELECT statements in WP.
WP Version: 6.1.1

Error:
WordPress database error Expression #1 of ORDER BY clause is not in SELECT list, references column 'phns17.wp_posts.post_date' which is not in SELECT list; this is incompatible with DISTINCT for query

This is caused by the MYSQL database sql_mode setting "only_full_group_by". It looks like WP has a built-in work around for this issue that HyperDB is overriding.

This prevents WP from retrieving Categories and tags so that posts appear to have no category. The category is being saved, but not retrieved in the select statement.

Removing HyperDB files fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions