[wp-trac] [WordPress Trac] #21367: Mysql 5.5.24 syntax error using SQL_CALC_FOUND_ROWS

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 24 12:05:37 UTC 2012


#21367: Mysql 5.5.24 syntax error using SQL_CALC_FOUND_ROWS
--------------------------+-----------------------------
 Reporter:  benjaoming    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  blocker       |   Keywords:
--------------------------+-----------------------------
 MySQL has changed in 5.5.

 This query is no longer OK as it results in a syntax error:

 {{{
 SELECT SQL_CALC_FOUND_ROWS FROM wp_posts WHERE 1=1 LIMIT 0, 5

  [You have an error in your SQL syntax; check the manual that corresponds
 to your MySQL server version for the right syntax to use near 'FROM
 wp_posts WHERE 1=1 LIMIT 0, 5' at line 1]
 }}}

 It has to be something like this:

 {{{
 SELECT SQL_CALC_FOUND_ROWS * FROM wp_posts WHERE 1=1 LIMIT 0, 5
 }}}

 Please correct in the following files:

 ./wp-includes/user.php:                 $this->query_fields =
 'SQL_CALC_FOUND_ROWS * ' . $this->query_fields;
 ./wp-includes/query.php:                        $found_rows =
 'SQL_CALC_FOUND_ROWS *';

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21367>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list