WordPress.org

Make WordPress Core

Ticket #7215: wpdb-return-affected-rows-alter

File wpdb-return-affected-rows-alter, 531 bytes (added by BjornW, 7 years ago)

patch to return affected rows upon using ALTER statement in query

Line 
1Index: wp-includes/wp-db.php
2===================================================================
3--- wp-includes/wp-db.php       (revision 8221)
4+++ wp-includes/wp-db.php       (working copy)
5@@ -617,7 +617,7 @@
6                        return false;
7                }
8 
9-               if ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) {
10+               if ( preg_match("/^\\s*(insert|delete|update|replace|alter) /i",$query) ) {
11                        $this->rows_affected = mysql_affected_rows($this->dbh);
12                        // Take note of the insert_id
13                        if ( preg_match("/^\\s*(insert|replace) /i",$query) ) {