mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 23:41:38 +01:00
Properly handle return value of DDL statements. Props scribu, marcis20. fixes #11372
git-svn-id: http://svn.automattic.com/wordpress/trunk@18063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
47ff74214f
commit
fce00c287b
@ -1082,10 +1082,12 @@ class wpdb {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( preg_match( "/^\\s*(insert|delete|update|replace|alter) /i", $query ) ) {
|
if ( preg_match( '/^\s*(create|alter|truncate|drop) /i', $query ) ) {
|
||||||
|
$return_val = $this->result;
|
||||||
|
} elseif ( preg_match( '/^\s*(insert|delete|update|replace) /i', $query ) ) {
|
||||||
$this->rows_affected = mysql_affected_rows( $this->dbh );
|
$this->rows_affected = mysql_affected_rows( $this->dbh );
|
||||||
// Take note of the insert_id
|
// Take note of the insert_id
|
||||||
if ( preg_match( "/^\\s*(insert|replace) /i", $query ) ) {
|
if ( preg_match( '/^\s*(insert|replace) /i', $query ) ) {
|
||||||
$this->insert_id = mysql_insert_id($this->dbh);
|
$this->insert_id = mysql_insert_id($this->dbh);
|
||||||
}
|
}
|
||||||
// Return number of rows affected
|
// Return number of rows affected
|
||||||
|
Loading…
Reference in New Issue
Block a user