[wp-trac] [WordPress Trac] #19019: Reduce duplication in $wpdb

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 24 21:39:23 UTC 2012


#19019: Reduce duplication in $wpdb
-------------------------------------+------------------
 Reporter:  scribu                   |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  3.5
Component:  Database                 |     Version:
 Severity:  minor                    |  Resolution:
 Keywords:  has-patch needs-refresh  |
-------------------------------------+------------------
Changes (by nacin):

 * keywords:  has-patch => has-patch needs-refresh


Comment:

 Patch applies fine (aside from load.php, which was committed elsewhere).

 The by-reference $format so we may unshift it seems a bit odd. I
 understand why it was done, though. Looks like some docs were updated to
 $formats — arguments and variables should be updated just the same, in
 that case.

 Avoiding the table clashes is a noble idea, but this isn't foolproof. It
 only checks the tables property, while there are also global and multisite
 global tables. If we check against both `$wpdb->tables( 'all' )` and
 `$wpdb->tables( 'ms_global' ) )`, that seems like a lot of unnecessary
 checking. Not terrible, but it also wouldn't catch queries done against WP
 tables with another prefix. I don't think that is something core does
 these days (we opt to switch_to_blog() instead) but something to think
 about.

 I'd rather leave that out for now and revisit it in its own ticket.

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


More information about the wp-trac mailing list