[wp-trac] [WordPress Trac] #4525: atom comment feed has sql error in title

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 24 18:27:14 GMT 2007


#4525: atom comment feed has sql error in title
---------------------------+------------------------------------------------
 Reporter:  trombonekenny  |       Owner:  anonymous
     Type:  defect         |      Status:  new      
 Priority:  normal         |   Milestone:           
Component:  General        |     Version:  2.2.1    
 Severity:  normal         |    Keywords:           
---------------------------+------------------------------------------------
 When building the atom comment feed with 2.2.1 I get the following error
 when it tries to get the title:

 <p class='wpdberror'><strong>WordPress database error:</strong> [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 &#039;AND
 comment_approved = &#039;1&#039;&#039; at line 2]<br />
                         <code>SELECT
 COUNT(*) FROM wp_comments WHERE comment_post_ID =  AND
 comment_approved = &#039;1&#039;</code></p>

 My MySQL is an older 4.0 build, but it looks like a variable isn't getting
 evaluated where it should be.  Here's a larger section of the output:

 {{{
 <?xml version="1.0" encoding="utf-8" ?><feed
         xmlns="http://www.w3.org/2005/Atom"
         xml:lang="en"
         >
         <title type="text">Comments for Recently, it's been like
 this...</title>
         <subtitle type="text">A blog.  You know, a weblog.
 </subtitle>

         <updated>2007-06-24T17:58:50Z</updated>
         <generator uri="http://wordpress.org/"
 version="2.2.1">WordPress</generator>

         <link rel="alternate" type="text/html" href="http://www-
 dave.cs.uiuc.edu/wordpress" />

         <link rel="self" type="application/atom+xml" href="http://www-
 dave.cs.uiuc.edu/wordpress/comments/feed/atom/" />
         <id>http://www-dave.cs.uiuc.edu/wordpress/comments/feed/atom/</id>

         <entry>
                 <title><div id='error'>
                         <p class='wpdberror'><strong>WordPress database
 error:</strong> [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 &#039;AND
 comment_approved = &#039;1&#039;&#039; at line 2]<br />
                         <code>SELECT
 COUNT(*) FROM wp_comments WHERE comment_post_ID =  AND
 comment_approved = &#039;1&#039;</code></p>
                         </div>Comment on &#8220;Farnum, Christ knows
 he&#8217;s earned it&#8221; by Tony</title>
                 <link rel="alternate" href="http://www-
 dave.cs.uiuc.edu/wordpress/2007/06/22/farnum-christ-knows-hes-earned-
 it/#comment-43975" type="text/html" />

                 <author>
                         <name>Tony</name>

                         <uri>http://protected.com</uri>
                 </author>

                 <id>http://www-dave.cs.uiuc.edu/wordpress/2007/06/22
 /farnum-christ-knows-hes-earned-it/#comment-43975</id>
                 <updated>2007-06-23T14:40:32Z</updated>
                 <published>2007-06-23T14:40:32Z</published>
 }}}

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


More information about the wp-trac mailing list