summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2011-01-14 13:00:42 +0000
committerAndrey Hristov <andrey@php.net>2011-01-14 13:00:42 +0000
commit5ca5c2bf43c292b687642adb4b239d651384713e (patch)
treec9a9b72a3c04ccc44579a68834409b7f5fc31772 /ext/mysqli/mysqli_api.c
parent0048446fddb506a06a37ed7c0f31a28ba4d7d215 (diff)
downloadphp-git-5ca5c2bf43c292b687642adb4b239d651384713e.tar.gz
Change things to allow passing of the password length
to mysqlnd. This is needed as a password might include a \0 and thus we need to be binary safe.
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index c75c9f8ec2..724c1e0ab2 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -535,7 +535,11 @@ PHP_FUNCTION(mysqli_change_user)
old_charset = mysql->mysql->charset;
#endif
+#if defined(MYSQLI_USE_MYSQLND)
+ rc = mysqlnd_change_user_ex(mysql->mysql, user, password, dbname, FALSE, (size_t) password_len);
+#else
rc = mysql_change_user(mysql->mysql, user, password, dbname);
+#endif
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
if (rc) {