[wp-trac] [WordPress Trac] #19467: wpdb does not always set rows_affected or insert_id properties when needed

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 19 20:46:06 UTC 2012


#19467: wpdb does not always set rows_affected or insert_id properties when needed
------------------------------+-----------------------------
 Reporter:  GeertDD           |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Future Release
Component:  Database          |     Version:  3.3
 Severity:  trivial           |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+-----------------------------
Changes (by bpetty):

 * cc: bpetty (added)


Comment:

 I am still able to reproduce this issue in SVN trunk. By that, I mean
 wpdb->query() incorrectly identifies perfectly valid SQL, resulting in
 missing rows_affected and insert_id values for SQL statements when they
 contain white space other than a space after the first query keyword.

 I have tested both with and without this patch using one of the existing
 SQL queries in WP (the attachment post_parent UPDATE) by adding a newline
 immediately after "UPDATE". This patch has a 4 lines offset, but still
 applies cleanly, and it does address the issue correctly, and fixes this.

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


More information about the wp-trac mailing list