Automattic / Automattic/HyperDB

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

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

Description

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.

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.