summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd.c
diff options
context:
space:
mode:
authorJerome Loyet <fat@php.net>2012-09-27 23:57:06 +0200
committerJerome Loyet <fat@php.net>2012-09-27 23:57:06 +0200
commit0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc (patch)
tree04bbcd1a5da16ea5246d39c1bcae45b9eb67c526 /ext/mysqlnd/mysqlnd.c
parent1fa8ecd082607858084994ad7081ef06e37db5f5 (diff)
parent6a50a8640c562a41d90c7ab46affa767b97d2621 (diff)
downloadphp-git-0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc.tar.gz
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (367 commits) fix unix/win dir separators Fix bug #63173: Crash when invoking invalid array callback Correct the test summary Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo) Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo) Avoid calling select if maxfd returned by curl_multi_fdset is -1 Fixing NEWS file Fixed bug #63111 (is_callable() lies for abstract static method) updated lib versions Fix folding fix bug #63015 (Incorrect arginfo for DOMErrorHandler) Bug #63000: MCAST_JOIN_GROUP on OSX is broken Fixed bug #61442 (exception threw in __autoload can not be catched) Merging PR #116 Merged GitHub PR #190: Support for the HTTP PATCH method in CLI webserver updated libary versions split tests for the new zlib version on win Fixed Bug #63103 (ext\curl\tests\bug62839.phpt broken) update news Support building PHP with the native client toolchain. ...
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r--ext/mysqlnd/mysqlnd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 797cadd624..900f8207b4 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -764,6 +764,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent);
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
+ if (!conn->greet_charset) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no);
+ SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
+ "Server sent charset unknown to the client. Please, report to the developers");
+ goto err;
+ }
/* we allow load data local infile by default */
mysql_flags |= MYSQLND_CAPABILITIES;
@@ -2177,7 +2184,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
}
memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len);
- DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data);
+ DBG_INF_FMT("salt=[%*.s]", plugin_data_len - 1, plugin_data);
/* The data should be allocated with malloc() */
scrambled_data =