diff options
author | Andrew Nacin <nacin@git.wordpress.org> | 2013-06-21 18:23:56 +0000 |
---|---|---|
committer | Andrew Nacin <nacin@git.wordpress.org> | 2013-06-21 18:23:56 +0000 |
commit | e0ece3ebddc1992d67d8e368699c384cd990ec72 (patch) | |
tree | f93bd69e7868cc729599f22ee9b56c38134de3b9 | |
parent | d0569d39bb4d8b4969c639637488cf31c7489953 (diff) | |
download | wordpress-e0ece3ebddc1992d67d8e368699c384cd990ec72.tar.gz wordpress-e0ece3ebddc1992d67d8e368699c384cd990ec72.zip |
Partially revert [24460] and only flush insert_id on the next insert or replace query, as we had been doing before.
Merges [24494] to the 3.5 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/3.5@24495 602fd350-edb4-49c9-b593-d223f7449a82
-rw-r--r-- | wp-includes/wp-db.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 692054229a..4fc829fb6c 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1120,7 +1120,7 @@ class wpdb { $this->last_result = array(); $this->col_info = null; $this->last_query = null; - $this->rows_affected = $this->num_rows = $this->insert_id = 0; + $this->rows_affected = $this->num_rows = 0; $this->last_error = ''; if ( is_resource( $this->result ) ) @@ -1302,6 +1302,7 @@ class wpdb { function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) { if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) ) return false; + $this->insert_id = 0; $formats = $format = (array) $format; $fields = array_keys( $data ); $formatted_fields = array(); |