[wp-trac] [WordPress Trac] #5185: SQL Error on feeds for invalid posts

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 12 13:10:25 GMT 2007


#5185: SQL Error on feeds for invalid posts
-----------------------------+----------------------------------------------
 Reporter:  robertaccettura  |       Owner:  anonymous                           
     Type:  defect           |      Status:  new                                 
 Priority:  normal           |   Milestone:                                      
Component:  General          |     Version:  2.3                                 
 Severity:  major            |    Keywords:  sql, error, feed, query.php, invalid
-----------------------------+----------------------------------------------
 If you append /feed to an invalid post url (the post itself returns a
 404), you get a SQL error on top:

 WordPress database error: [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 'AND comment_approved = '1' ORDER BY comment_date_gmt DESC
 LIMIT 10' at line 1]
 SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = AND
 comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10

 Looks like it's coming from get_posts() in wp-includes/query.php

 Calling this major since it breaks the feed.

 Google webmaster's console is even weirder.  When a redirect points to a
 feed broken like this, it shows up as a 404.

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


More information about the wp-trac mailing list