]> granicus.if.org Git - php/commitdiff
Fixed bug #36802 (mysqli_set_charset() crash with a non-open connection).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 21 Mar 2006 15:35:28 +0000 (15:35 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 21 Mar 2006 15:35:28 +0000 (15:35 +0000)
NEWS
ext/mysqli/mysqli_nonapi.c

diff --git a/NEWS b/NEWS
index 3130d19a67a88bdfacb1f5da1b12206222a5fc77..0fa2328853f1a9387d69356a76f56f839b38ab73 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ PHP                                                                        NEWS
 - Fixed debug_zval_dump() to support private and protected members. (Dmitry)
 - Fixed bug #36809 (__FILE__ behavior changed). (Dmitry)
 - Fixed bug #36808 (syslog ident becomes garbage between requests). (Tony)
+- Fixed bug #36802 (mysqli_set_charset() crash with a non-open connection).
+  (Ilia)
 - Fixed bug #36721 (The SoapServer is not able to send a header that it didn't
   receive). (Dmitry)
 - Fixed bug #36756 (DOMDocument::removeChild corrupts node). (Rob)
index 99a3f0302385dc02b3526076e7a6fcba13d6088c..9c031fab6c487b6ac9ab8ccf5ae68e9c75943167 100644 (file)
@@ -326,7 +326,7 @@ PHP_FUNCTION(mysqli_set_charset)
        }
        MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link");
 
-       if (mysql_set_character_set(mysql->mysql, cs_name)) {
+       if (!mysql->mysql->thread_id || mysql_set_character_set(mysql->mysql, cs_name)) {
                RETURN_FALSE;
        }
        RETURN_TRUE;