[wp-trac] [WordPress Trac] #57767: SQL query error with multiple order specifications in pre_get_posts.

WordPress Trac noreply at wordpress.org
Tue Feb 21 00:24:35 UTC 2023


#57767: SQL query error with multiple order specifications in pre_get_posts.
--------------------------+------------------------------
 Reporter:  kuroro111     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  6.1.1
 Severity:  critical      |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by kuroro111):

 Supplementary information.

 wp-includes/class-wp-query.php
 There is a pre_get_posts hook in get_posts() in the above file.
 Just before the return of this function, you can retrieve the SQL query
 from the rewritten $this->request.

 I am working with Local by flyfeel and when I type the SQL command
 directly from the admin screen of the database tool Adminer 4.8.1, I get
 the following error.
 I have tried this in the environment immediately after the initial
 installation and the following error is displayed.
 However, what is different from the initial environment is that the
 reordering is successful.
 Perhaps a different query was being run in the first environment due to a
 plugin or customisation, which we will continue to investigate, but it
 does not appear to be a bug.

 I don't have a good understanding of what the query error is, but if it
 looks OK I would like to close this ticket.


 {{{
 Query error (1055): Expression #1 of ORDER BY clause is not in GROUP BY
 clause and contains non-aggregated column 'local.wp_postmeta.meta_value'
 which is not functionally dependent on columns in the GROUP BY clause;
 this is incompatible with sql_mode=only_full_group_by
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57767#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list