[wp-trac] [WordPress Trac] #32770: sql with unnecessary * in comment.php

WordPress Trac noreply at wordpress.org
Tue Jun 23 19:53:11 UTC 2015


#32770: sql with unnecessary * in comment.php
---------------------------+-----------------------------
 Reporter:  mesaquesoares  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:  4.2.2
 Severity:  normal         |   Keywords:
  Focuses:  performance    |
---------------------------+-----------------------------
 line: 1681
 $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS
 num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved",
 ARRAY_A );

 change the COUNT( * ) for COUNT( comment_ID )

 will be now:
 $count = $wpdb->get_results( "SELECT comment_approved, COUNT( comment_ID )
 AS num_comments FROM {$wpdb->comments} {$where} GROUP BY
 comment_approved", ARRAY_A );

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32770>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list