From b6b234927bd5c3842996fef45957db73b16324c8 Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 22 Dec 2007 06:24:10 +0000 Subject: [PATCH] Don't block SET NAMES query. Props g30rg3x for the find. fixes #5503 for 2.3 git-svn-id: http://svn.automattic.com/wordpress/branches/2.3@6463 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 4f65c6110d..788f83abe0 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -78,11 +78,12 @@ class wpdb { return; } + $this->ready = true; + if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') ) $this->query("SET NAMES '$this->charset'"); $this->select($dbname); - $this->ready = true; } function __destruct() { @@ -95,6 +96,7 @@ class wpdb { */ function select($db) { if (!@mysql_select_db($db, $this->dbh)) { + $this->ready = false; $this->bail("

Can’t select database

We were able to connect to the database server (which means your username and password is okay) but not able to select the $db database.