Partially revert [24459] and only flush insert_id on the next insert or replace query, as we had been doing before. (Yes, this is not how mysql_insert_id() works.)

git-svn-id: https://develop.svn.wordpress.org/trunk@24494 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-06-21 18:22:26 +00:00
parent de2951b057
commit 46022a51de
1 changed files with 2 additions and 1 deletions

View File

@ -1117,7 +1117,7 @@ class wpdb {
$this->last_result = array(); $this->last_result = array();
$this->col_info = null; $this->col_info = null;
$this->last_query = 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 = ''; $this->last_error = '';
if ( is_resource( $this->result ) ) if ( is_resource( $this->result ) )
@ -1299,6 +1299,7 @@ class wpdb {
function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) { function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) {
if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) ) if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) )
return false; return false;
$this->insert_id = 0;
$formats = $format = (array) $format; $formats = $format = (array) $format;
$fields = array_keys( $data ); $fields = array_keys( $data );
$formatted_fields = array(); $formatted_fields = array();