[wp-trac] [WordPress Trac] #14254: update_meta_cache fails; query too large?

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 9 19:52:19 UTC 2010


#14254: update_meta_cache fails; query too large?
--------------------------+-------------------------------------------------
 Reporter:  newpixel      |       Owner:                   
     Type:  defect (bug)  |      Status:  new              
 Priority:  normal        |   Milestone:  Awaiting Review  
Component:  General       |     Version:  2.9.2            
 Severity:  normal        |    Keywords:  reporter-feedback
--------------------------+-------------------------------------------------
Changes (by nacin):

  * keywords:  update meta cache query posts => reporter-feedback


Old description:

> In the file meta.php, around line 183 in the 'update_meta_cache()'
> function, it tries to do a query but I noticed this can fail (ie. crash
> wordpress) if there are too many post id's in the query.
>
> The function is being called from query_posts(), with 'posts_per_page'
> set to -1.
>
> An example query that crashed it:
>
> SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN
> (1009,1006,989,933,902,860,859,858,857,793,838,837,836,827,825,310,780,777,776,775,774,773,770,763,760,759,758,757,728,756,755,754,753,752,751,750,748,746,
> 732,736,729,726,725,724,723,722,720,719,717,716,715,710,709,503,692,289,625,268,593,583,582,332,32,30,28,26,24,22)
>
> Maybe there is some limit associated with queries of this type internal
> to wordpress, as this query works fine in phpMySql.
>
> Apologies if this is already reported or irrelevant in 3.0!

New description:

 In the file meta.php, around line 183 in the 'update_meta_cache()'
 function, it tries to do a query but I noticed this can fail (ie. crash
 wordpress) if there are too many post id's in the query.

 The function is being called from query_posts(), with 'posts_per_page' set
 to -1.

 An example query that crashed it:
 {{{
 SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN
 (1009,1006,989,933,902,860,859,858,857,793,838,837,836,827,825,310,780,777,776,775,774,773,770,763,760,759,758,757,728,756,755,754,753,752,751,750,748,746,
 732,736,729,726,725,724,723,722,720,719,717,716,715,710,709,503,692,289,625,268,593,583,582,332,32,30,28,26,24,22)
 }}}
 Maybe there is some limit associated with queries of this type internal to
 wordpress, as this query works fine in phpMySql.

 Apologies if this is already reported or irrelevant in 3.0!

--

Comment:

 Can you explain what "crash WordPress" means? That query should have no
 issue.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14254#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list