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

WordPress Trac noreply at wordpress.org
Fri Dec 28 16:56:06 UTC 2012


#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:  needs-patch  |
-------------------------+-----------------------------

Comment (by TechDagan):

 Replying to [comment:19 jbutkus]:
 > If I would like to use NULL for field, I would just skip that field from
 SQL statement, instead of adding 'null' format mask.

 In the case of an INSERT, that would work fine. But a field cannot be
 updated to become NULL, only to contain an empty string or, in the case of
 an integer, 0. Boolean fields are completely unmanageable.

 I can see why the original version(s) of wpdb did not bother to include
 null-parsing logic, but it's not really ''that'' complicated to do. I'll
 take a look at the code and, time willing, see about submitting a patch.

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


More information about the wp-trac mailing list