[wp-trac] [WordPress Trac] #47280: SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17

WordPress Trac noreply at wordpress.org
Wed Nov 25 20:10:12 UTC 2020


#47280: SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17
-------------------------+---------------------
 Reporter:  javorszky    |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.7
Component:  Database     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+---------------------

Comment (by wpe_bdurette):

 Awesome to see this is happening. The GitHub PR only includes fixes for
 two of the occurrences `SQL_CALC_ROWS_FOUND`. There are others. I'm
 working on a PR to address all instances in core.

 The usage in `class-wp-query.php` as some interesting implications. There
 is a filter on the posts query allowing for a completely arbitrary query
 to be run. Options that come to mind are to try to parse that query to
 replace the fields with `COUNT(*)` or simply wrap the query (e.g., `SELECT
 COUNT(*) from ($query) p`). For safety, I plan to do the latter, but I
 have no idea how that will play with the query optimizer.

 I'm open to other ideas.

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


More information about the wp-trac mailing list