[wp-trac] [WordPress Trac] #26106: Passing empty array to wpdb::update() generates invalid SQL

WordPress Trac noreply at wordpress.org
Tue Sep 2 02:07:17 UTC 2014


#26106: Passing empty array to wpdb::update() generates invalid SQL
--------------------------+-----------------------------
 Reporter:  Viper007Bond  |       Owner:  wonderboymusic
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.0
Component:  Database      |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  dev-feedback  |     Focuses:
--------------------------+-----------------------------
Changes (by nacin):

 * keywords:   => dev-feedback


Comment:

 The 1=1 part doesn't matter as to whether it is unbounded. That was just a
 suggestion as to how you could make it "explicit" in that you wanted an
 unbounded query.

 To be honest, I'm still very scared about this. One bad variable and
 suddenly you've updated all rows. I don't love this as an API change and
 would like to see if anyone else agrees for a possible 4.0 revert.

 Two of the longest downtime events of WordPress.com in the last 4-5 years
 were, to my recollection, as follows:
  * A bad variable name/assumption that overwrote entire options tables.
  * An unbounded query that overwrote the entire domain mapping table.

 This fix makes it trivial to combine both of these events into one. Let's
 not, please.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26106#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list