Basic support for the mysql_connect() new_link and client_flags arguments. props Otto42, fixes #19324.

git-svn-id: http://core.svn.wordpress.org/trunk@21609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-08-24 17:44:21 +00:00
parent 1d46178afd
commit e225c12704

View File

@ -1135,10 +1135,13 @@ class wpdb {
$this->is_mysql = true;
$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
if ( WP_DEBUG ) {
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
} else {
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
}
if ( !$this->dbh ) {