diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-08-08 13:36:28 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-08-08 13:36:28 +0000 |
commit | 5c6ee17a9e51c27b8b23c598ccf2615c3991f6ee (patch) | |
tree | 785cfa259f0d1fd02af658fb3f476bf4247d11c4 /ext/mysql | |
parent | 6f2df2113612fcb492923b31daea6e78510b4a5f (diff) | |
download | php-git-5c6ee17a9e51c27b8b23c598ccf2615c3991f6ee.tar.gz |
Fixed bug #24977 (Revert mysql_select_db optimization)
Diffstat (limited to 'ext/mysql')
-rw-r--r-- | ext/mysql/php_mysql.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 7d57a5536c..03a9366444 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -268,17 +268,12 @@ static void php_mysql_set_default_link(int id TSRMLS_DC) */ static int php_mysql_select_db(php_mysql_conn *mysql, char *db TSRMLS_DC) { - /* a small optimization to avoid selecting the database if it is already selected */ - if (mysql->conn.db && !strcmp(mysql->conn.db, db)) { - return 1; - } else { - PHPMY_UNBUFFERED_QUERY_CHECK(); + PHPMY_UNBUFFERED_QUERY_CHECK(); - if (mysql_select_db(&mysql->conn, db) != 0) { - return 0; - } else { - return 1; - } + if (mysql_select_db(&mysql->conn, db) != 0) { + return 0; + } else { + return 1; } } /* }}} */ |