Commit:    9d2dda90588cbc9dbf76db30389490cd37d097d9
Author:    Andrey Hristov <and...@php.net>         Tue, 14 May 2013 11:26:35 
+0200
Parents:   ad210f2c10e07175a39da8ca9b61bd6bf07d6f75
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=9d2dda90588cbc9dbf76db30389490cd37d097d9

Log:
Fix for Bug #64394 MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS undeclared when using 
Connector/C

Bugs:
https://bugs.php.net/64394

Changed paths:
  M  NEWS
  M  ext/mysqli/mysqli.c
  M  ext/mysqli/mysqli_api.c
  M  ext/mysqli/tests/mysqli_expire_password.phpt


Diff:
diff --git a/NEWS b/NEWS
index 881fb64..99dcbe7 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ PHP                                                            
            NEWS
 - mbstring:
   . Fixed bug #64769 (mbstring PHPTs crash on Windows x64). (Anatol)
 
+- mysqli:
+  . Fixed bug #64394 (MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS undeclared when
+    using Connector/C). (Andrey)
+
 - Sockets:
   . Fixed bug #64508 (Fails to build with --disable-ipv6). (Gustavo)
 
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index d14b616..4dd1a40 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -842,7 +842,7 @@ PHP_MINIT_FUNCTION(mysqli)
        REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, 
CONST_CS | CONST_PERSISTENT);
 #endif
 
-#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND)
+#if (MYSQL_VERSION_ID >= 50611 && 
defined(CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS)) || defined(MYSQLI_USE_MYSQLND)
        REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", 
MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT);
 #endif
 
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 3d651fc..3ee5c80 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -1698,7 +1698,7 @@ static int mysqli_options_get_option_zval_type(int option)
 #ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT
        REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", 
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
 #endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */
-#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND)
+#if (MYSQL_VERSION_ID >= 50611 && 
defined(CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS)) || defined(MYSQLI_USE_MYSQLND)
                case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS:
 #endif
                        return IS_LONG;
diff --git a/ext/mysqli/tests/mysqli_expire_password.phpt 
b/ext/mysqli/tests/mysqli_expire_password.phpt
index ce89a21..4fdf902 100644
--- a/ext/mysqli/tests/mysqli_expire_password.phpt
+++ b/ext/mysqli/tests/mysqli_expire_password.phpt
@@ -127,11 +127,11 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE 
%s.test TO expiretest@'%
 ?>
 --EXPECTF--
 
-Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d
-[001] Cannot connect [1820] %s
+Warning: mysqli_real_connect(): (HY000/1862): %s in %s on line %d
+[001] Cannot connect [1862] %s
 
-Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d
-[003] Cannot connect [1820] %s
+Warning: mysqli_real_connect(): (HY000/1862): %s in %s on line %d
+[003] Cannot connect [1862] %s
 [006] Connect allowed, query fail, [1820] %s
 [008] Connect allowed, pw set, [0%A
 array(1) {


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to