Changeset 37548
- Timestamp:
- 05/24/2016 05:23:06 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r37544 r37548 1720 1720 $this->check_current_query = true; 1721 1721 1722 // Keep track of the last query for debug. .1722 // Keep track of the last query for debug. 1723 1723 $this->last_query = $query; 1724 1724 1725 1725 $this->_do_query( $query ); 1726 1726 1727 // MySQL server has gone away, try to reconnect 1727 // MySQL server has gone away, try to reconnect. 1728 1728 $mysql_errno = 0; 1729 1729 if ( ! empty( $this->dbh ) ) { 1730 1730 if ( $this->use_mysqli ) { 1731 $mysql_errno = mysqli_errno( $this->dbh ); 1731 if ( $this->dbh instanceof mysqli ) { 1732 $mysql_errno = mysqli_errno( $this->dbh ); 1733 } else { 1734 // $dbh is defined, but isn't a real connection. 1735 // Something has gone horribly wrong, let's try a reconnect. 1736 $mysql_errno = 2006; 1737 } 1732 1738 } else { 1733 $mysql_errno = mysql_errno( $this->dbh ); 1739 if ( is_resource( $this->dbh ) ) { 1740 $mysql_errno = mysql_errno( $this->dbh ); 1741 } else { 1742 $mysql_errno = 2006; 1743 } 1734 1744 } 1735 1745 } … … 1744 1754 } 1745 1755 1746 // If there is an error then take note of it. .1756 // If there is an error then take note of it. 1747 1757 if ( $this->use_mysqli ) { 1748 $this->last_error = mysqli_error( $this->dbh ); 1758 if ( $this->dbh instanceof mysqli ) { 1759 $this->last_error = mysqli_error( $this->dbh ); 1760 } else { 1761 $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); 1762 } 1749 1763 } else { 1750 $this->last_error = mysql_error( $this->dbh ); 1764 if ( is_resource( $this->dbh ) ) { 1765 $this->last_error = mysql_error( $this->dbh ); 1766 } else { 1767 $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); 1768 } 1751 1769 } 1752 1770
Note: See TracChangeset
for help on using the changeset viewer.