[wp-trac] [WordPress Trac] #15158: wpdb insert & update with null values

WordPress Trac noreply at wordpress.org
Fri Jan 4 19:56:38 UTC 2013


#15158: wpdb insert & update with null values
-------------------------+-----------------------------
 Reporter:  westi        |       Owner:  sorich87
     Type:  enhancement  |      Status:  accepted
 Priority:  normal       |   Milestone:  Future Release
Component:  Database     |     Version:  3.0.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------------

Comment (by miqrogroove):

 Replying to [comment:28 jbutkus]:
 > I would vote for adding it in a different commit, as it is a separate
 feature (which was not checked for in the past), but here is my
 [attachment:wpdb_prepare_null.15158.v3.patch​ attempt upon this] question.

 I took a closer look at this for you.  I suggest going back to v2.patch
 and change this line:

 {{{if ( ! isset( $values[$loc_index] ) ) {}}}

 ... with my suggested code ...

 {{{if ( $loc_index < count($values) and is_null( $values[$loc_index] ) )
 {}}}

 ... now there is no need for the extra variables.

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


More information about the wp-trac mailing list