[wp-trac] [WordPress Trac] #11799: WPDB code improvements

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 8 19:17:44 UTC 2010


#11799: WPDB code improvements
-------------------------+--------------------------------------------------
 Reporter:  hakre        |       Owner:  ryan     
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  3.0      
Component:  Database     |     Version:  3.0      
 Severity:  normal       |    Keywords:  has-patch
-------------------------+--------------------------------------------------

Comment(by hakre):

 Replying to [comment:3 Denis-de-Bernardy]:
 > this is a bit odd: + // initi return values and objects state ...
 Fixed.

 Replying to [comment:4 Denis-de-Bernardy]:
 > isn't this missing a delimiter?
 >
 > {{{
 > if ( preg_match( '(^\s*([a-z]{2,})\s+)i', $query, $matches ) )
 > }}}

 No, it's not, delimitter is {{{()}}} and it's valid and nice as well.
 matches for the group 0 to give a hint :).

 >
 > also, I don't think it'll properly deal with:
 >
 > {{{
 > query("
 > # some comments for debugging using SAVEQUERIES
 > INSERT INTO ...
 > ");
 > }}}
 >
 > but nor does the current version of the class, so that's probably
 another ticket...

 jup, would say other dimension, this requires a new algo to copy with
 that. maybe mysql itself can tell the name of the last command. that could
 solve it.

 >
 > also while we're at it, for reference, the code in wpmu does not deal
 with a tabbed update statements properly. (but yours does, since it
 follows the UPDATE with a \s instead of a space in the regexp.)

 I think that's a valuable hint for wpmuguru.

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


More information about the wp-trac mailing list