diff options
author | Christopher Jones <sixd@php.net> | 2012-09-26 16:31:22 -0700 |
---|---|---|
committer | Christopher Jones <sixd@php.net> | 2012-09-26 16:31:22 -0700 |
commit | 609e375e2f8084e4765992483166ad7c136e1349 (patch) | |
tree | 055c0c55b844de5eca1ba571dc824a93e09c6e1d /ext/mysqlnd/mysqlnd.c | |
parent | 6ce88bbc71e81c4f367dcb7da7a9e2bf8dbd3df0 (diff) | |
parent | da96aa848fc4845399d4d7a7c396fa31ffb9ffba (diff) | |
download | php-git-609e375e2f8084e4765992483166ad7c136e1349.tar.gz |
Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src: (22 commits)
compile out example plugin in a release build
change public key setting to PERDIR and finish code that allows to set the key file programatically per mysqli_options()
remove old unicode code, that is was compiled out by using a macro
Add SHA256 authentication support - password hashing to mysqlnd Automatic switchover to SSL with plain-text password is not part of this
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)
Add NEWS/UPGRADING for previous change
Simplify set_error_handler/set_exception_handler code
Return previous error handler when resetting the error handler
Allow resetting the error handler
Revert error/exception handler changes
Fixed bug #63132
Avoid calling select if maxfd returned by curl_multi_fdset is -1
Add CURLOPT_READDATA which was removed by mistake
Fixing NEWS file
Fixed bug #63111 (is_callable() lies for abstract static method)
updated lib versions
Do not disable RFC3678 multicast API on Windows
Fix folding
...
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index d7462f77a5..3fa9d11a28 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -456,11 +456,7 @@ mysqlnd_switch_to_ssl_if_needed( if (options->charset_name && (charset = mysqlnd_find_charset_name(options->charset_name))) { auth_packet->charset_no = charset->nr; } else { -#if MYSQLND_UNICODE - auth_packet->charset_no = 200;/* utf8 - swedish collation, check mysqlnd_charset.c */ -#else auth_packet->charset_no = greet_packet->charset_no; -#endif } #ifdef MYSQLND_SSL_SUPPORTED @@ -581,12 +577,14 @@ mysqlnd_run_authentication( } 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(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data); /* The data should be allocated with malloc() */ scrambled_data = auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len, - plugin_data, plugin_data_len, options, mysql_flags TSRMLS_CC); - + plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC); + if (!scrambled_data || conn->error_info->error_no) { + goto end; + } if (FALSE == is_change_user) { ret = mysqlnd_auth_handshake(conn, user, passwd, passwd_len, db, db_len, options, mysql_flags, charset_no, @@ -1028,13 +1026,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, mysqlnd_local_infile_default(conn); -#if MYSQLND_UNICODE - { - unsigned int as_unicode = 1; - conn->m->set_client_option(conn, MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE, (char *)&as_unicode TSRMLS_CC); - DBG_INF("unicode set"); - } -#endif if (FAIL == conn->m->execute_init_commands(conn TSRMLS_CC)) { goto err; } @@ -1334,13 +1325,12 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s DBG_RETURN(FAIL); } - *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array TSRMLS_CC); - FD_ZERO(&rfds); FD_ZERO(&wfds); FD_ZERO(&efds); if (r_array != NULL) { + *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array TSRMLS_CC); set_count = mysqlnd_stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC); if (set_count > max_set_count) { max_set_count = set_count; @@ -2280,13 +2270,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c case MYSQL_OPT_CONNECT_TIMEOUT: case MYSQLND_OPT_NET_CMD_BUFFER_SIZE: case MYSQLND_OPT_NET_READ_BUFFER_SIZE: + case MYSQL_SERVER_PUBLIC_KEY: ret = conn->net->data->m.set_client_option(conn->net, option, value TSRMLS_CC); break; -#if MYSQLND_UNICODE - case MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE: - conn->options->numeric_and_datetime_as_unicode = *(unsigned int*) value; - break; -#endif #ifdef MYSQLND_STRING_TO_INT_CONVERSION case MYSQLND_OPT_INT_AND_FLOAT_NATIVE: conn->options->int_and_float_native = *(unsigned int*) value; |