[PHP-CVS] com php-src: Fix loss of precision: ext/mysqli/mysqli_nonapi.c ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd.h
Commit:86aad979798a665e3f23aafb200390d51d44f8fa Author:Andrey Hristov Wed, 4 Dec 2013 12:06:59 +0200 Parents: d1314893fd1325ca6aa0831101896e31135a2658 Branches: PHP-5.4 PHP-5.5 PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=86aad979798a665e3f23aafb200390d51d44f8fa Log: Fix loss of precision Changed paths: M ext/mysqli/mysqli_nonapi.c M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd.h Diff: diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index e1557ef..35ea163 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -777,7 +777,7 @@ PHP_FUNCTION(mysqli_poll) MYSQLND **new_r_array = NULL, **new_e_array = NULL, **new_dont_poll_array = NULL; longsec = 0, usec = 0; enum_func_status ret; - uintdesc_num; + int desc_num; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) { return; diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 20e63e1..a09ebe1 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1214,7 +1214,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds /* {{{ _mysqlnd_poll */ PHPAPI enum_func_status -_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC) +_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC) { struct timeval tv; struct timeval *tv_p = NULL; diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index e707c41..2d8f599 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -117,7 +117,7 @@ PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC); #define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data TSRMLS_CC) #define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result) TSRMLS_CC) -PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC); +PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC); #define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data TSRMLS_CC) #define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data TSRMLS_CC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.6': NEWS configure.in main/main.c
Commit:406d5a5ecc7a23eb2b157e066ddc09641854daf9 Author:Andrey Hristov Wed, 4 Dec 2013 16:20:03 +0200 Parents: dd7c33d0c9812df09a029d32451decb012d42629 97909ef4efb6756730b814c9966579ea6ec9e3ba Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=406d5a5ecc7a23eb2b157e066ddc09641854daf9 Log: Merge branch 'PHP-5.6' Conflicts: NEWS UPGRADING Changed paths: MM NEWS MM configure.in MM main/main.c Diff: diff --cc NEWS index 5229ff4,dabe0cf..b8e420f --- a/NEWS +++ b/NEWS @@@ -1,5 -1,96 +1,6 @@@ PHP NEWS ||| -?? ??? 20??, PHP 5.6.0 - -- CLI server: - . Added some MIME types to the CLI web server (Chris Jones) - -- Core: - . Improved IS_VAR operands fetching. (Laruence, Dmitry) - . Implemented internal operator overloading -(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) - . Made calls from incompatible context issue an E_DEPRECATED warning instead -of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx). - (Gustavo) - . Uploads equal or greater than 2GB in size are now accepted. -(Ralf Lang, Mike) - . Reduced POST data memory usage by 200-300%. Removed INI setting -always_populate_raw_post_data and the $HTTP_RAW_POST_DATA global -variable. (Mike) - . Implemented dedicated syntax for variadic functions -(RFC: https://wiki.php.net/rfc/variadics). (Nikita) - . Fixed bug #50333 Improving multi-threaded scalability by using -emalloc/efree/estrdup (Anatol, Dmitry) - . Implemented constant scalar expressions (with support for constants) -(RFC: https://wiki.php.net/rfc/const_scalar_exprs). (Bob) - -- cURL: - . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir -or safe_mode). (Adam) - -- GMP: - . Moved GMP to use object as the underlying structure and implemented various -improvements based on this. -(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) - . Added gmp_root() and gmp_rootrem() functions for calculating nth roots. -(Nikita) - -- Hash: - . Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz) - -- JSON: - . Fixed case part of bug #64874 ("json_decode handles whitespace and -case-sensitivity incorrectly") - -- mysqlnd: - . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively -supported by the overlying APIs. (Andrey) - -- OPcache: - . Added an optimization of class constants and constant calls to some -internal functions (Laruence, Dmitry) - . Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL. -(Laruence, Dmitry) - . Added an optimization pass to merged identical constants (and related -cache_slots) in op_array->literals table. (Laruence, Dmitry) - . Added script level constant replacement optimization pass. (Dmitry) - -- Openssl: - . Added crypto_method option for the ssl stream context. (Martin Jansen) - . Added certificate fingerprint support. (Tjerk Meesters) - . Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey) - . Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters) - -- PDO_pgsql: - . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo) - . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 -syntax). (Matteo) - -- Session: - . Fixed Bug #65315 (session.hash_function silently fallback to default md5) -(Yasuo) - . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) - . Implemented Request #17860 (Session write short circuit). (Yasuo) - . Implemented Request #20421 (session_abort() and session_reset() function). -(Yasuo) - . Implemented Request #11100 (session_gc() function). (Yasuo) - -- Standard: - . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version -1.1). (Adam) - . Implemented Change crypt() behavior w/o salt RFC. (Yasuo) -https://wiki.php.net/rfc/crypt_function_salt - . Implemented request #49824 (Change array_fill() to allow creating empty -array). (Nikita) - -- XMLReader: - . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). -(Mike) - -- Zip: - . update libzip to version 1.11.1. -PHP don't use any ilibzip private symbol anymore. (Pierre, Remi) - . new method ZipArchive::setPassword($password). (Pierre) - . add --with-libzip option to build with system libzip. (Remi) ++<<<<<<< HEAD +?? ??? 20??, PHP 5.7.0 <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqli/mysqli_nonapi.c ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd.h
Commit:ceb1b7e20fdbbdb121a67242d0848ab923915e65 Author:Andrey Hristov Wed, 4 Dec 2013 12:07:18 +0200 Parents: 00a7b1ff7fed49df51d0392d47aa79f63bf1c66e 86aad979798a665e3f23aafb200390d51d44f8fa Branches: PHP-5.5 PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ceb1b7e20fdbbdb121a67242d0848ab923915e65 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/mysqli/mysqli_nonapi.c MM ext/mysqlnd/mysqlnd.c MM ext/mysqlnd/mysqlnd.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd_ps_codec.c
Commit:763f4aef8b84847d82ada4c4bb07c1e8b3e21e36 Author:Andrey Hristov Thu, 21 Nov 2013 21:29:37 +0200 Parents: c2b2afacc03cc9b93f7cd73d3ada8995ac54960e ce098222696b505b93faea37414446740dbd9846 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=763f4aef8b84847d82ada4c4bb07c1e8b3e21e36 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/mysqlnd/mysqlnd_ps_codec.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add some tracing: ext/mysqlnd/mysqlnd.c
Commit:82a7ec72de81ed8cd27c3d043d448523cabc5a34 Author:Andrey Hristov Thu, 8 Aug 2013 13:51:55 +0200 Parents: c932d532c8d858bed66b5393cc8d7be21f26dd2e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=82a7ec72de81ed8cd27c3d043d448523cabc5a34 Log: add some tracing Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 0a856f1..b41e542 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1225,6 +1225,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC #include "php_network.h" +/* {{{ mysqlnd_stream_array_to_fd_set */ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC) { int cnt = 0; @@ -1255,15 +1256,17 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS } return ret; } +/* }}} */ -/* {{{ stream_select mysqlnd_stream_array_to_fd_set functions */ +/* {{{ mysqlnd_stream_array_to_fd_set */ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC) { php_socket_t this_fd; php_stream *stream = NULL; - int cnt = 0; + unsigned int cnt = 0; MYSQLND **p = conn_array; + DBG_ENTER("mysqlnd_stream_array_to_fd_set"); while (*p) { /* get the fd. @@ -1272,6 +1275,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p * is not displayed. * */ stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC); + DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream); if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { @@ -1284,21 +1288,24 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p } p++; } - return cnt ? 1 : 0; + DBG_RETURN(cnt ? 1 : 0); } +/* }}} */ + +/* {{{ mysqlnd_stream_array_from_fd_set */ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC) { php_socket_t this_fd; php_stream *stream = NULL; int ret = 0; zend_bool disproportion = FALSE; - - MYSQLND **fwd = conn_array, **bckwd = conn_array; + DBG_ENTER("mysqlnd_stream_array_from_fd_set"); while (*fwd) { stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC); + DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream); if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { if (PHP_SAFE_FD_ISSET(this_fd, fds)) { @@ -1316,7 +1323,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds } *bckwd = NULL;/* NULL-terminate the list */ - return ret; + DBG_RETURN(ret); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Disable a flag: NEWS ext/mysqlnd/mysqlnd_enum_n_def.h
Commit:a047ece2e0c8d5e6448986d0e2f8c7c88ec830d7 Author:Andrey Hristov Mon, 22 Jul 2013 11:02:48 +0200 Parents: 85bbc8fa9dcfde80a1628ac5e05b22f14f76e222 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a047ece2e0c8d5e6448986d0e2f8c7c88ec830d7 Log: Disable a flag Changed paths: M NEWS M ext/mysqlnd/mysqlnd_enum_n_def.h Diff: diff --git a/NEWS b/NEWS index 076a0c1..c679b90 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ PHP NEWS . Implemented internal operator overloading (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) +- mysqlnd: + . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively +supported by the overlying APIs. (Andrey) + - OPcache: . Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL. (Laruence, Dmitry) diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 4ace69a..c9127ef 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -104,7 +104,7 @@ #define MYSQLND_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | \ CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION | \ - CLIENT_MULTI_RESULTS | CLIENT_PS_MULTI_RESULTS | CLIENT_LOCAL_FILES | CLIENT_PLUGIN_AUTH) + CLIENT_MULTI_RESULTS | CLIENT_LOCAL_FILES | CLIENT_PLUGIN_AUTH) #define MYSQLND_NET_FLAG_USE_COMPRESSION 1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' of ssh://git.php.net/php-src into PHP-5.4: NEWS
Commit:2c3f6dcdb6de8cd43371e91fb470e547aa217327 Author:Andrey Hristov Mon, 8 Jul 2013 20:28:51 +0200 Parents: 9fc38183b707341b6eddb8c196d0ea2b7c13d6a9 e4a28b7b7b972fecd01458364c0663195352891e Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2c3f6dcdb6de8cd43371e91fb470e547aa217327 Log: Merge branch 'PHP-5.4' of ssh://git.php.net/php-src into PHP-5.4 Conflicts: NEWS Changed paths: MM NEWS Diff: diff --cc NEWS index 04dc482,1d3385a..d20ec7e --- a/NEWS +++ b/NEWS @@@ -18,12 -20,19 +20,22 @@@ PH - CLI server: . Fixed bug #65066 (Cli server not responsive when responding with 422 http status code). (Adam) + + - FPM: + . Fixed bug #63983 (enabling FPM borks compile on FreeBSD). + (chibisuke at web dot de, Felipe) + + - Imap: + . Fixed bug #64467 (Segmentation fault after imap_reopen failure). + (askalski at gmail dot com) - Intl: - . Fixed bug #62759: Buggy grapheme_substr() on edge case. (Stas) + . Fixed bug #62759 (Buggy grapheme_substr() on edge case). (Stas) + . Fixed bug #61860 (Offsets may be wrong for grapheme_stri* functions). + (Stas) + +- mysqlnd: + . Fixed segfault in mysqlnd when doing long prepare. (Andrey) - ODBC: . Fixed bug #61387 (NULL valued anonymous column causes segfault in -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/pgsql/pgsql.c
Commit:781be5f1d74ea9406e9ab82f9f90844befcc67b3 Author:Andrey Hristov Wed, 26 Jun 2013 16:50:08 +0200 Parents: 623386d79988d1aeea941bb463ece2c27f9ed5d0 b34e8d2e3e892d8844cf9af7c0ce4bf3ed698fc6 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=781be5f1d74ea9406e9ab82f9f90844befcc67b3 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: NEWS Changed paths: MM ext/pgsql/pgsql.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add new test: ext/standard/tests/array/array_walk_closure.phpt
Commit:b34e8d2e3e892d8844cf9af7c0ce4bf3ed698fc6 Author:Andrey Hristov Wed, 26 Jun 2013 16:44:26 +0200 Parents: 8922c50ca41e94ab21b27e1b56fbe2bcbc7638ac Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b34e8d2e3e892d8844cf9af7c0ce4bf3ed698fc6 Log: add new test Changed paths: A ext/standard/tests/array/array_walk_closure.phpt Diff: diff --git a/ext/standard/tests/array/array_walk_closure.phpt b/ext/standard/tests/array/array_walk_closure.phpt new file mode 100644 index 000..7f6c834 --- /dev/null +++ b/ext/standard/tests/array/array_walk_closure.phpt @@ -0,0 +1,251 @@ +--TEST-- +array_walk() closure tests +--FILE-- + 1, "two"=>2, "three" => 3]; +var_dump(array_walk($ar, function(){ var_dump(func_get_args());})); + +echo "\nclosure with array\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = ["sum" => 42]; +$func = function($value, $key, &$udata) { + var_dump($udata); + $udata["sum"] += $value; +}; + +var_dump(array_walk($ar, $func, $user_data)); +echo "End result:"; +var_dump($user_data["sum"]); + +echo "\nclosure with use\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = ["sum" => 42]; +$func = function($value, $key) use (&$user_data) { + var_dump($user_data); + $user_data["sum"] += $value; +}; + +var_dump(array_walk($ar, $func, $user_data)); +echo "End result:"; +var_dump($user_data["sum"]); + + +echo "\nclosure with object\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = (object)["sum" => 42]; +$func = function($value, $key, &$udata) { + var_dump($udata); + $udata->sum += $value; +}; + +var_dump(array_walk($ar, $func, $user_data)); +echo "End result:"; +var_dump($user_data->sum); + + + +echo "\nfunction with object\n"; +function sum_it_up_object($value, $key, $udata) +{ + var_dump($udata); + $udata->sum += $value; +} + +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = (object)["sum" => 42]; + +var_dump(array_walk($ar, "sum_it_up_object", $user_data)); +echo "End result:"; +var_dump($user_data->sum); + + +echo "\nfunction with array\n"; +function sum_it_up_array($value, $key, $udata) +{ + var_dump($udata); + $udata['sum'] += $value; +} + +$ar = ["one" => 1, "two"=>2, "three" => 3]; +$user_data = ["sum" => 42]; + +var_dump(array_walk($ar, "sum_it_up_array", $user_data)); +echo "End result:"; +var_dump($user_data['sum']); + +echo "\nclosure and exception\n"; +$ar = ["one" => 1, "two"=>2, "three" => 3]; +try { + var_dump(array_walk($ar, function($v, $k) { if ($v == 2) throw new Exception; } )); +} catch (Exception $e) { + var_dump($e->getTrace()); +} + + +echo "Done\n"; +?> +--EXPECTF-- +Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d +NULL + +Warning: array_walk() expects parameter 1 to be array, boolean given in %s on line %d +NULL + +Warning: array_walk() expects parameter 1 to be array, null given in %s on line %d +NULL +array(2) { + [0]=> + int(1) + [1]=> + string(3) "one" +} +array(2) { + [0]=> + int(2) + [1]=> + string(3) "two" +} +array(2) { + [0]=> + int(3) + [1]=> + string(5) "three" +} +bool(true) + +closure with array +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(43) +} +array(1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(42) + +closure with use +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(43) +} +array(1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(48) + +closure with object +object(stdClass)#1 (1) { + ["sum"]=> + int(42) +} +object(stdClass)#1 (1) { + ["sum"]=> + int(43) +} +object(stdClass)#1 (1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(48) + +function with object +object(stdClass)#2 (1) { + ["sum"]=> + int(42) +} +object(stdClass)#2 (1) { + ["sum"]=> + int(43) +} +object(stdClass)#2 (1) { + ["sum"]=> + int(45) +} +bool(true) +End result:int(48) + +function with array +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(42) +} +array(1) { + ["sum"]=> + int(42) +} +bool(true) +End result:int(42) + +closure and exception +array(2) { + [0]=> +
[PHP-CVS] com php-src: updates: EXTENSIONS ext/mysql/CREDITS ext/mysqlnd/CREDITS
Commit:378a5f9bfe03ca7251af5dd6cd9c3be1a6524b34 Author:Andrey Hristov Tue, 21 May 2013 13:27:45 +0200 Parents: ed9a9b6144d9b2acaa621a5f51ffcf35850c8f36 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=378a5f9bfe03ca7251af5dd6cd9c3be1a6524b34 Log: updates Changed paths: M EXTENSIONS M ext/mysql/CREDITS M ext/mysqlnd/CREDITS Diff: diff --git a/EXTENSIONS b/EXTENSIONS index 5308582..61a1688 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -147,7 +147,7 @@ STATUS: Working COMMENT: Tested on phpts and isapi versions --- EXTENSION: mysql -PRIMARY MAINTAINER: Zak Greant , Georg Richter , Johannes Schl�ter , Ulf Wendel +PRIMARY MAINTAINER: Zak Greant , Georg Richter , Andrey Hristov , Johannes Schl�ter , Ulf Wendel MAINTENANCE: Maintained STATUS: Working --- @@ -158,7 +158,7 @@ STATUS: Working SINCE: 5.0 --- EXTENSION: mysqlnd -PRIMARY MAINTAINER: Georg Richter , Andrey Hristov , Johannes Schl�ter , Ulf Wendel +PRIMARY MAINTAINER: Andrey Hristov , Johannes Schl�ter , Ulf Wendel MAINTENANCE: Maintained STATUS: Working SINCE: 5.3 diff --git a/ext/mysql/CREDITS b/ext/mysql/CREDITS index e5a6208..15b00a9 100644 --- a/ext/mysql/CREDITS +++ b/ext/mysql/CREDITS @@ -1,2 +1,2 @@ MySQL -Zeev Suraski, Zak Greant, Georg Richter +Zeev Suraski, Zak Greant, Georg Richter, Andrey Hristov diff --git a/ext/mysqlnd/CREDITS b/ext/mysqlnd/CREDITS index 5aed316..5a7d69d 100644 --- a/ext/mysqlnd/CREDITS +++ b/ext/mysqlnd/CREDITS @@ -1,2 +1,2 @@ MySQLnd -Andrey Hristov, Ulf Wendel, Georg Richter +Andrey Hristov, Ulf Wendel, Georg Richter, Johannes Schl�ter -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix for Bug #64394 MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS undeclared when using Connector/C: NEWS ext/mysqli/mysqli.c ext/mysqli/mysqli_api.c ext/mysqli/tests/mysqli_expire_pass
Commit:9d2dda90588cbc9dbf76db30389490cd37d097d9 Author:Andrey Hristov 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
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd_enum_n_def.h
Commit:39cc08c7e985a7621d052e3f557c63cf5456fc30 Author:Andrey Hristov Fri, 19 Apr 2013 15:55:46 +0200 Parents: ecf76e2da81ca23d8e53d010ad1190129eb417ab 0802961bd13adef4f108ebb84a7de84951811795 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=39cc08c7e985a7621d052e3f557c63cf5456fc30 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqlnd/mysqlnd_enum_n_def.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: lower the limit, should fit in a byte: ext/mysqlnd/mysqlnd_enum_n_def.h
Commit:0802961bd13adef4f108ebb84a7de84951811795 Author:Andrey Hristov Fri, 19 Apr 2013 15:54:35 +0200 Parents: 323fdb9879c69c40ab7baa83400e182e292b547e Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0802961bd13adef4f108ebb84a7de84951811795 Log: lower the limit, should fit in a byte Changed paths: M ext/mysqlnd/mysqlnd_enum_n_def.h Diff: diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 10deb03..f02a5b1 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -39,7 +39,7 @@ #define MYSQLND_SQLSTATE_LENGTH5 #define MYSQLND_SQLSTATE_NULL "0" -#define MYSQLND_MAX_ALLOWED_USER_LEN 256 /* 64 char * 4byte . MySQL supports now only 16 char, but let it be forward compatible */ +#define MYSQLND_MAX_ALLOWED_USER_LEN 252 /* 63 char * 4byte . MySQL supports now only 16 char, but let it be forward compatible */ #define MYSQLND_MAX_ALLOWED_DB_LEN 1024/* 256 char * 4byte. MySQL supports now only 64 char in the tables, but on the FS could be different. Forward compatible. */ #define MYSQLND_NET_CMD_BUFFER_MIN_SIZE4096 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Avoid trailing line break: ext/opcache/zend_accelerator_module.c
On 03/18/2013 02:40 PM, Dmitry Stogov wrote: Hi Andrey, I don't think it makes a lot of sense to make it in only this particular place. We use "int" in thousands other places (near everywhere across PHP sources). "A journey of a thousand miles begins with a single step" Lau-Tzu :) Thanks. Dmitry. On Mon, Mar 18, 2013 at 5:09 PM, Andrey Hristov wrote: could you use size_t instead of len? (strlen() returns size_t). Thanks :) Andrey Best, Andrey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Avoid trailing line break: ext/opcache/zend_accelerator_module.c
On 03/18/2013 10:36 AM, Dmitry Stogov wrote: Commit:5b0879e7c969e0bd87b0ad6fad03e278a0a46642 Author:Dmitry Stogov Mon, 18 Mar 2013 13:36:31 +0400 Parents: a9684532ebda83e2459da4f6f450a37f4ee6ff7b Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5b0879e7c969e0bd87b0ad6fad03e278a0a46642 Log: Avoid trailing line break Changed paths: M ext/opcache/zend_accelerator_module.c Diff: diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 019ce66..dd8eb59 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -403,6 +403,8 @@ static zval* accelerator_get_scripts(TSRMLS_D) for (i = 0; inext) { zend_persistent_script *script; + char *str; + int len; could you use size_t instead of len? (strlen() returns size_t). Thanks :) if (cache_entry->indirect) continue; @@ -414,7 +416,10 @@ static zval* accelerator_get_scripts(TSRMLS_D) add_assoc_long(persistent_script_report, "hits", script->dynamic_members.hits); add_assoc_long(persistent_script_report, "memory_consumption", script->dynamic_members.memory_consumption); ta = localtime(&script->dynamic_members.last_used); - add_assoc_string(persistent_script_report, "last_used", asctime(ta), 1); + str = asctime(ta); + len = strlen(str); + if (len > 0 && str[len - 1] == '\n') len--; + add_assoc_stringl(persistent_script_report, "last_used", str, len, 1); add_assoc_long(persistent_script_report, "last_used_timestamp", script->dynamic_members.last_used); if (ZCG(accel_directives).validate_timestamps) { add_assoc_long(persistent_script_report, "timestamp", (long)script->timestamp); Andrey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix the fix: ext/mysqlnd/mysqlnd_ps.c
Commit:c09652c2899dd4149fe3187b5b50f6b3c54da384 Author:Andrey Hristov Wed, 13 Mar 2013 15:56:44 +0100 Parents: 7503a4b4a4d0ffe4140f5afab9cae45aaa691c4a Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c09652c2899dd4149fe3187b5b50f6b3c54da384 Log: fix the fix Changed paths: M ext/mysqlnd/mysqlnd_ps.c Diff: diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 2a0c9dd..15b2938 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1463,8 +1463,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne if (stmt->param_count) { if (!stmt->param_bind) { -// stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent); - stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND)); + stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent); if (!stmt->param_bind) { DBG_RETURN(FAIL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS ext/mysqlnd/mysqlnd_ps.c
Commit:7503a4b4a4d0ffe4140f5afab9cae45aaa691c4a Author:Andrey Hristov Wed, 13 Mar 2013 15:29:40 +0100 Parents: 28634bf603d312bf066eab0a95700ae187d8d347 0777a18703d9be2ea8efd85c0352863b8768e49e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7503a4b4a4d0ffe4140f5afab9cae45aaa691c4a Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: NEWS Changed paths: MM NEWS MM ext/mysqlnd/mysqlnd_ps.c Diff: diff --cc NEWS index 291ec52,ac0c943..9d87b95 --- a/NEWS +++ b/NEWS @@@ -1,28 -1,6 +1,31 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.14 +?? ??? 20??, PHP 5.5.0 Beta 1 + +- Core: + . Fixed bug #64354 (Unserialize array of objects whose class can't +be autoloaded fail). (Laruence) + . Added support for changing the process's title in CLI/CLI-Server SAPIs. +The implementation is more robust that the proctitle PECL module. More +details here: https://wiki.php.net/rfc/cli_process_title. (Keyur) + . Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']). +(Anatol) + ++- mysqlnd ++ . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc ++for stmt->param_bind). (Andrey) + +07 Mar 2013, PHP 5.5.0 Alpha 6 + +- Core: + . Fixed bug #61025 (__invoke() visibility not honored). (Laruence) + . Fixed bug #49348 (Uninitialized ++$foo->bar; does not cause a notice). +(Stas) + +- Sockets: + . Fixed bug #64287 (sendmsg/recvmsg shutdown handler causes segfault). +(Gustavo) + - PCRE: . Merged PCRE 8.32. (Anatol) diff --cc ext/mysqlnd/mysqlnd_ps.c index 4916c06,cd5b302..2a0c9dd --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@@ -1463,7 -1478,7 +1463,8 @@@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_p if (stmt->param_count) { if (!stmt->param_bind) { - stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent); ++//stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent); + stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND)); if (!stmt->param_bind) { DBG_RETURN(FAIL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS ext/mysqlnd/mysqlnd_ps.c ext/pdo_mysql/mysql_statement.c
Commit:0777a18703d9be2ea8efd85c0352863b8768e49e Author:Andrey Hristov Wed, 13 Mar 2013 14:24:23 +0100 Parents: a328cc452e02ef9605518a1c1a0c97d91b87b846 f1e2edff8befb7863723adbe5680ce3d9714d9ed Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0777a18703d9be2ea8efd85c0352863b8768e49e Log: Merge branch 'PHP-5.3' into PHP-5.4 Conflicts: NEWS Changed paths: MM NEWS MM ext/mysqlnd/mysqlnd_ps.c MM ext/pdo_mysql/mysql_statement.c Diff: diff --cc NEWS index 1fbd5a2,fb877c0..ac0c943 --- a/NEWS +++ b/NEWS @@@ -1,45 -1,15 +1,49 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.3.24 +?? ??? 2013, PHP 5.4.14 - PCRE: - . Merged PCRE 8.32). (Anatol) + . Merged PCRE 8.32. (Anatol) + +?? ??? 2013, PHP 5.4.13 + +- Core: + . Fixed bug #64354 (Unserialize array of objects whose class can't +be autoloaded fail). (Laruence) + . Fixed bug #64235 (Insteadof not work for class method in 5.4.11). +(Laruence) + . Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang). +(Ard Biesheuvel) + . Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell) + . Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi) + . Fixed bug #64070 (Inheritance with Traits failed with error). (Dmitry) + +- CLI server: + . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi) + +- Mbstring: + . mb_split() can now handle empty matches like preg_split() does. (Moriyoshi) + - mysqlnd + . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc + for stmt->param_bind). (Andrey) + +- OpenSSL: + . New SSL stream context option to prevent CRIME attack vector. (Daniel Lowrey, + Lars) + . Fixed bug #61930 (openssl corrupts ssl key resource when using +openssl_get_publickey()). (Stas) -28 Feb 2013, PHP 5.3.23RC1 +- PDO_mysql: + . Fixed bug #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs). +(Johannes) + +- Phar: + . Fixed timestamp update on Phar contents modification. (Dmitry) + +- SOAP + . Added check that soap.wsdl_cache_dir conforms to open_basedir +(CVE-2013-1635). (Dmitry) + . Disabled external entities loading (CVE-2013-1643). (Dmitry) - Phar: . Fixed timestamp update on Phar contents modification. (Dmitry) diff --cc ext/pdo_mysql/mysql_statement.c index f2e36c1,d6dcb3a..2ae5595 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@@ -343,7 -351,8 +343,6 @@@ static int pdo_mysql_stmt_next_rowset(p pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; pdo_mysql_db_handle *H = S->H; long row_count; -- int ret; PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset"); PDO_DBG_INF_FMT("stmt=%p", S->stmt); @@@ -412,26 -421,26 +411,21 @@@ S->result = NULL; } -- ret = mysql_next_result(H->server); ++ if (!mysql_more_results(H->server)) { ++ /* No more results */ ++ PDO_DBG_RETURN(0); ++ } #if PDO_USE_MYSQLND -- /* for whatever reason mysqlnd breaks with libmysql compatibility at the C level, no -1 */ -- if (PASS != ret) { ++ if (mysql_next_result(H->server) == FAIL) { pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); -- } -- if (mysql_more_results(H->server)) { -- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC)); } else { -- /* No more results */ -- PDO_DBG_RETURN(0); ++ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC)); } #else -- if (ret > 0) { ++ if (mysql_next_result(H->server) > 0) { pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); -- } else if (ret < 0) { -- /* No more results */ -- PDO_DBG_RETURN(0); } else { PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC)); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix for bug #63530 mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind: NEWS ext/mysqlnd/mysqlnd_ps.c
Commit:f1e2edff8befb7863723adbe5680ce3d9714d9ed Author:Andrey Hristov Wed, 13 Mar 2013 13:37:51 +0100 Parents: bdaafe3c7b7f388e34078a0a9d7215c8d58acadb Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f1e2edff8befb7863723adbe5680ce3d9714d9ed Log: fix for bug #63530 mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind Bugs: https://bugs.php.net/63530 Changed paths: M NEWS M ext/mysqlnd/mysqlnd_ps.c Diff: diff --git a/NEWS b/NEWS index 82afa3a..fb877c0 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,10 @@ PHP NEWS - PCRE: . Merged PCRE 8.32). (Anatol) +- mysqlnd + . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc +for stmt->param_bind). (Andrey) + 28 Feb 2013, PHP 5.3.23RC1 diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index c553aa5..0020590 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1485,7 +1485,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne if (stmt->param_count) { if (!stmt->param_bind) { - stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND)); + stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent); if (!stmt->param_bind) { DBG_RETURN(FAIL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: relax the check: ext/mysqli/mysqli_nonapi.c
Commit:64a2a8a7536de781aac015e7392cb56308d8aed0 Author:Andrey Hristov Fri, 22 Feb 2013 13:50:04 +0100 Parents: 1643d4ed568890d1b18a87304a39791ebb4790be Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=64a2a8a7536de781aac015e7392cb56308d8aed0 Log: relax the check Changed paths: M ext/mysqli/mysqli_nonapi.c Diff: diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index e743449..398c159 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -,7 +,7 @@ PHP_FUNCTION(mysqli_begin_transaction) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for parameter flags (%ld)", flags); err = TRUE; } - if (!name || !name_len) { + if (!name_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty"); err = TRUE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add some parameter checks: ext/mysqli/mysqli_nonapi.c
Commit:1643d4ed568890d1b18a87304a39791ebb4790be Author:Andrey Hristov Fri, 22 Feb 2013 13:17:46 +0100 Parents: b479c2bffb91ee8a6c2e676920e895da08b68a4b Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1643d4ed568890d1b18a87304a39791ebb4790be Log: Add some parameter checks Changed paths: M ext/mysqli/mysqli_nonapi.c Diff: diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index c3a56fc..e743449 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -1100,13 +1100,25 @@ PHP_FUNCTION(mysqli_begin_transaction) zval*mysql_link; longflags = TRANS_START_NO_OPT; char * name = NULL; - int name_len = 0; + int name_len = -1; + zend_bool err = FALSE; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); - + if (flags < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for parameter flags (%ld)", flags); + err = TRUE; + } + if (!name || !name_len) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty"); + err = TRUE; + } + if (TRUE == err) { + RETURN_FALSE; + } + #if !defined(MYSQLI_USE_MYSQLND) if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name)) { RETURN_FALSE; @@ -1143,12 +1155,16 @@ PHP_FUNCTION(mysqli_savepoint) MY_MYSQL*mysql; zval*mysql_link; char * name = NULL; - int name_len = 0; + int name_len = -1; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); + if (!name || !name_len) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty"); + RETURN_FALSE; + } #if !defined(MYSQLI_USE_MYSQLND) if (mysqli_savepoint_libmysql(mysql->mysql, name, FALSE)) { @@ -1169,14 +1185,15 @@ PHP_FUNCTION(mysqli_release_savepoint) MY_MYSQL*mysql; zval*mysql_link; char * name = NULL; - int name_len = 0; + int name_len = -1; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); if (!name || !name_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name not provided"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty"); + RETURN_FALSE; } #if !defined(MYSQLI_USE_MYSQLND) if (mysqli_savepoint_libmysql(mysql->mysql, name, TRUE)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: news for mysqli_savepoint and mysql_release_savepoint: NEWS
Commit:3d9a31efdfbbc3d73b8c94649f38035277264151 Author:Andrey Hristov Fri, 8 Feb 2013 18:33:45 +0100 Parents: a5b426eeffdb4f35e927d268ff82ffb67d8f889e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3d9a31efdfbbc3d73b8c94649f38035277264151 Log: news for mysqli_savepoint and mysql_release_savepoint Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 2e2fc55..f7882de 100644 --- a/NEWS +++ b/NEWS @@ -23,15 +23,17 @@ PHP NEWS to master. - mysqli - . Add mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented all + . Added mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented all options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT and ROLLBACK through options to mysqli_commit()/mysqli_rollback() and their respective OO counterparts. They work in libmysql and mysqlnd mode. (Andrey) + . Added mysqli_savepoint(), mysqli_release_savepoint(). (Andrey) - mysqlnd . Add new begin_transaction() call to the connection object. Implemented all options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT and ROLLBACK. (Andrey) + . Added mysqlnd_savepoint(), mysqlnd_release_savepoint(). (Andrey) - Sockets: . Added recvmsg() and sendmsg() wrappers. (Gustavo) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: mysqli_savepoint()/mysqli_release_savepoint(): ext/mysqli/mysqli_api.c ext/mysqli/mysqli_fe.c ext/mysqli/mysqli_fe.h ext/mysqli/mysqli_nonapi.c ext/mysqli/tests/mysqli_class_mys
Commit:43ecd8fe1b307945df0e45ed14cab4be8aacdedb Author:Andrey Hristov Fri, 8 Feb 2013 18:09:50 +0100 Parents: 0da369ae5048185f8e5e26e0e89191de09da22cb Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=43ecd8fe1b307945df0e45ed14cab4be8aacdedb Log: mysqli_savepoint()/mysqli_release_savepoint() Changed paths: M ext/mysqli/mysqli_api.c M ext/mysqli/mysqli_fe.c M ext/mysqli/mysqli_fe.h M ext/mysqli/mysqli_nonapi.c M ext/mysqli/tests/mysqli_class_mysqli_interface.phpt Diff: diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 760ee3c..3d651fc 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -714,7 +714,7 @@ PHP_FUNCTION(mysqli_commit) #if !defined(MYSQLI_USE_MYSQLND) if (mysqli_commit_or_rollback_libmysql(mysql->mysql, TRUE, flags, name)) { #else - if (mysqlnd_commit(mysql->mysql, flags, name)) { + if (FAIL == mysqlnd_commit(mysql->mysql, flags, name)) { #endif RETURN_FALSE; } @@ -1960,7 +1960,7 @@ PHP_FUNCTION(mysqli_rollback) #if !defined(MYSQLI_USE_MYSQLND) if (mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, flags, name)) { #else - if (mysqlnd_rollback(mysql->mysql, flags, name)) { + if (FAIL == mysqlnd_rollback(mysql->mysql, flags, name)) { #endif RETURN_FALSE; } diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index 411ab11..6f2e404 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -97,6 +97,24 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_savepoint, 0, 0, 2) + MYSQLI_ZEND_ARG_OBJ_INFO_LINK() + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_savepoint, 0, 0, 1) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_release_savepoint, 0, 0, 2) + MYSQLI_ZEND_ARG_OBJ_INFO_LINK() + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_release_savepoint, 0, 0, 1) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_commit, 0, 0, 1) MYSQLI_ZEND_ARG_OBJ_INFO_LINK() ZEND_ARG_INFO(0, flags) @@ -430,7 +448,9 @@ const zend_function_entry mysqli_functions[] = { #if defined(MYSQLI_USE_MYSQLND) PHP_FE(mysqli_reap_async_query, arginfo_mysqli_only_link) #endif + PHP_FE(mysqli_release_savepoint, arginfo_mysqli_release_savepoint) PHP_FE(mysqli_rollback, arginfo_mysqli_rollback) + PHP_FE(mysqli_savepoint, arginfo_mysqli_savepoint) PHP_FE(mysqli_select_db, arginfo_mysqli_select_db) #ifdef HAVE_MYSQLI_SET_CHARSET PHP_FE(mysqli_set_charset, arginfo_mysqli_set_charset) @@ -528,7 +548,9 @@ const zend_function_entry mysqli_link_methods[] = { #endif PHP_FALIAS(escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string) PHP_FALIAS(real_query, mysqli_real_query, arginfo_class_mysqli_query) + PHP_FALIAS(release_savepoint, mysqli_release_savepoint, arginfo_class_mysqli_release_savepoint) PHP_FALIAS(rollback, mysqli_rollback, arginfo_class_mysqli_rollback) + PHP_FALIAS(savepoint, mysqli_savepoint, arginfo_class_mysqli_savepoint) PHP_FALIAS(select_db,mysqli_select_db, arginfo_class_mysqli_select_db) #ifdef HAVE_MYSQLI_SET_CHARSET PHP_FALIAS(set_charset, mysqli_set_charset, arginfo_class_mysqli_set_charset) diff --git a/ext/mysqli/mysqli_fe.h b/ext/mysqli/mysqli_fe.h index e6cd3a6..7e447c6 100644 --- a/ext/mysqli/mysqli_fe.h +++ b/ext/mysqli/mysqli_fe.h @@ -108,6 +108,8 @@ PHP_FUNCTION(mysqli_sqlstate); PHP_FUNCTION(mysqli_ssl_set); PHP_FUNCTION(mysqli_stat); PHP_FUNCTION(mysqli_refresh); +PHP_FUNCTION(mysqli_savepoint); +PHP_FUNCTION(mysqli_release_savepoint); PHP_FUNCTION(mysqli_stmt_affected_rows); PHP_FUNCTION(mysqli_stmt_close); PHP_FUNCTION(mysqli_stmt_data_seek); diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index c08fbae..c3a56fc 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -1112,7 +1112,7 @@ PHP_FUNCTION(mysqli_begin_transaction) RETURN_FALSE; } #else - if (mysqlnd_begin_transaction(mysql->mysql, flags, name)) { + if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) { RETURN_FALSE; } #endif @@ -1121,6 +1121,75 @@ PHP_FUNCTION(mysqli_begin_transaction) /* }}} */ +#if !defined(MYSQLI_US
[PHP-CVS] com php-src: update test case: ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt
Commit:a5b426eeffdb4f35e927d268ff82ffb67d8f889e Author:Andrey Hristov Fri, 8 Feb 2013 18:28:22 +0100 Parents: 43ecd8fe1b307945df0e45ed14cab4be8aacdedb Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a5b426eeffdb4f35e927d268ff82ffb67d8f889e Log: update test case Changed paths: M ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt Diff: diff --git a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt index c62cb52..259fcd9 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt @@ -892,6 +892,29 @@ isPassedByReference: no isOptional: no isDefaultValueAvailable: no +Inspecting method 'release_savepoint' +isFinal: no +isAbstract: no +isPublic: yes +isPrivate: no +isProtected: no +isStatic: no +isConstructor: no +isDestructor: no +isInternal: yes +isUserDefined: no +returnsReference: no +Modifiers: 256 +Number of Parameters: 1 +Number of Required Parameters: 1 + +Inspecting parameter 'name' of method 'release_savepoint' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: no +isDefaultValueAvailable: no + Inspecting method 'rollback' isFinal: no isAbstract: no @@ -922,6 +945,29 @@ isPassedByReference: no isOptional: yes isDefaultValueAvailable: no +Inspecting method 'savepoint' +isFinal: no +isAbstract: no +isPublic: yes +isPrivate: no +isProtected: no +isStatic: no +isConstructor: no +isDestructor: no +isInternal: yes +isUserDefined: no +returnsReference: no +Modifiers: 256 +Number of Parameters: 1 +Number of Required Parameters: 1 + +Inspecting parameter 'name' of method 'savepoint' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: no +isDefaultValueAvailable: no + Inspecting method 'select_db' isFinal: no isAbstract: no -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add the constants needed for mysqli_commit(), _rollback() and begin_transaction(): ext/mysqli/mysqli.c ext/mysqli/tests/mysqli_constants.phpt
Commit:0da369ae5048185f8e5e26e0e89191de09da22cb Author:Andrey Hristov Fri, 8 Feb 2013 17:05:25 +0100 Parents: 666a83566077d1db195fd17d088062434b6202fa Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0da369ae5048185f8e5e26e0e89191de09da22cb Log: Add the constants needed for mysqli_commit(), _rollback() and begin_transaction() Changed paths: M ext/mysqli/mysqli.c M ext/mysqli/tests/mysqli_constants.phpt Diff: diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 22e75cd..1731bb7 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -846,6 +846,16 @@ PHP_MINIT_FUNCTION(mysqli) REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT); #endif + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_START_WITH_CONSISTENT_SNAPSHOT", TRANS_START_WITH_CONSISTENT_SNAPSHOT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_START_READ_WRITE", TRANS_START_READ_WRITE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_START_READ_ONLY", TRANS_START_READ_ONLY, CONST_CS | CONST_PERSISTENT); + + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_COR_AND_CHAIN", TRANS_COR_AND_CHAIN, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_COR_AND_NO_CHAIN", TRANS_COR_AND_NO_CHAIN, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_COR_RELEASE", TRANS_COR_RELEASE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_TRANS_COR_NO_RELEASE", TRANS_COR_NO_RELEASE, CONST_CS | CONST_PERSISTENT); + + #ifdef MYSQLI_USE_MYSQLND mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC); #endif diff --git a/ext/mysqli/tests/mysqli_constants.phpt b/ext/mysqli/tests/mysqli_constants.phpt index 7c0f6a9..7c6dacd 100644 --- a/ext/mysqli/tests/mysqli_constants.phpt +++ b/ext/mysqli/tests/mysqli_constants.phpt @@ -32,7 +32,7 @@ require_once('skipifconnectfailure.inc'); "MYSQLI_ASSOC" => true, "MYSQLI_NUM"=> true, "MYSQLI_BOTH" => true, - "MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH"=> true, + "MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH"=> true, "MYSQLI_NOT_NULL_FLAG" => true, "MYSQLI_PRI_KEY_FLAG" => true, "MYSQLI_UNIQUE_KEY_FLAG"=> true, @@ -86,14 +86,21 @@ require_once('skipifconnectfailure.inc'); "MYSQLI_SET_CHARSET_NAME" => true, "MYSQLI_SET_CHARSET_DIR"=> true, "MYSQLI_REFRESH_GRANT" => true, - "MYSQLI_REFRESH_LOG"=> true, + "MYSQLI_REFRESH_LOG"=> true, "MYSQLI_REFRESH_TABLES" => true, "MYSQLI_REFRESH_HOSTS" => true, "MYSQLI_REFRESH_STATUS" => true, "MYSQLI_REFRESH_THREADS"=> true, "MYSQLI_REFRESH_SLAVE" => true, "MYSQLI_REFRESH_MASTER" => true, - "MYSQLI_DEBUG_TRACE_ENABLED"=> true, + "MYSQLI_DEBUG_TRACE_ENABLED"=> true, + "MYSQLI_TRANS_START_WITH_CONSISTENT_SNAPSHOT" => true, + "MYSQLI_TRANS_START_READ_WRITE" => true, + "MYSQLI_TRANS_START_READ_ONLY" => true, + "MYSQLI_TRANS_COR_AND_CHAIN"=> true, + "MYSQLI_TRANS_COR_AND_NO_CHAIN" => true, + "MYSQLI_TRANS_COR_RELEASE" => true, + "MYSQLI_TRANS_COR_NO_RELEASE" => true, ); /* depends on the build - experimental */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add savepoint and rollback to savepoint support: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd.h ext/mysqlnd/mysqlnd_structs.h
Commit:666a83566077d1db195fd17d088062434b6202fa Author:Andrey Hristov Fri, 8 Feb 2013 16:36:17 +0100 Parents: 2d30a192f0b387bd2ae291f1ddd5a47432dbe5df Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=666a83566077d1db195fd17d088062434b6202fa Log: Add savepoint and rollback to savepoint support Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd.h M ext/mysqlnd/mysqlnd_structs.h Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 959f3e0..ccd8af5 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2761,6 +2761,70 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi /* }}} */ +/* {{{ mysqlnd_conn_data::tx_savepoint */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC) +{ + size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint); + enum_func_status ret = FAIL; + DBG_ENTER("mysqlnd_conn_data::tx_savepoint"); + + if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { + do { + char * query; + unsigned int query_len; + if (!name) { + SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Savepoint name not provided"); + break; + } + query_len = mnd_sprintf(&query, 0, "SAVEPOINT `%s`", name); + if (!query) { + SET_OOM_ERROR(*conn->error_info); + break; + } + ret = conn->m->query(conn, query, query_len TSRMLS_CC); + mnd_sprintf_free(query); + } while (0); + conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); + } + + DBG_RETURN(ret); +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::tx_savepoint_release */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC) +{ + size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint_release); + enum_func_status ret = FAIL; + DBG_ENTER("mysqlnd_conn_data::tx_savepoint_release"); + + if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { + do { + char * query; + unsigned int query_len; + if (!name) { + SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Savepoint name not provided"); + break; + } + query_len = mnd_sprintf(&query, 0, "RELEASE SAVEPOINT `%s`", name); + if (!query) { + SET_OOM_ERROR(*conn->error_info); + break; + } + ret = conn->m->query(conn, query, query_len TSRMLS_CC); + mnd_sprintf_free(query); + } while (0); + conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); + } + + DBG_RETURN(ret); +} +/* }}} */ + + /* {{{ mysqlnd_conn_data::local_tx_start */ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC) @@ -2878,6 +2942,8 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data) MYSQLND_METHOD(mysqlnd_conn_data, tx_begin), MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback), MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string), + MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint), + MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release), MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start), MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end), diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 7adf3b6..4093363 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -195,6 +195,8 @@ PHPAPI void mysqlnd_set_local_infile_handler(MYSQLND_CONN_DATA * const conn, con #define mysqlnd_begin_transaction(conn,flags,name) ((conn)->data)->m->tx_begin((conn)->data, (flags), (name) TSRMLS_CC) #define mysqlnd_commit(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, TRUE, (flags), (name) TSRMLS_CC) #define mysqlnd_rollback(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, FALSE, (flags), (name) TSRMLS_CC) +#define mysqlnd_savepoint(conn, name) ((conn)->data)->m->tx_savepoint
[PHP-CVS] com php-src: add the news about recent commits: NEWS
Commit:2d30a192f0b387bd2ae291f1ddd5a47432dbe5df Author:Andrey Hristov Fri, 8 Feb 2013 11:12:54 +0100 Parents: e1e22fd2e4b2c036589162fed9198cd9ca210445 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2d30a192f0b387bd2ae291f1ddd5a47432dbe5df Log: add the news about recent commits Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 3bb6ace..2e2fc55 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,17 @@ PHP NEWS . Cherry-picked UConverter wrapper, which had accidentaly been committed only to master. +- mysqli + . Add mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented all +options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT + and ROLLBACK through options to mysqli_commit()/mysqli_rollback() and their + respective OO counterparts. They work in libmysql and mysqlnd mode. (Andrey) + +- mysqlnd + . Add new begin_transaction() call to the connection object. Implemented all +options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT + and ROLLBACK. (Andrey) + - Sockets: . Added recvmsg() and sendmsg() wrappers. (Gustavo) See https://wiki.php.net/rfc/sendrecvmsg -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add support for begin_transaction in libmysql mode. Add support for flags and name for commit/rollback in libmysql mode: ext/mysqli/mysqli_api.c ext/mysqli/mysqli_fe.c ext/mysql
Commit:afacdecd1f8001b143e86676859d570ebf4659b9 Author:Andrey Hristov Thu, 7 Feb 2013 18:45:49 +0100 Parents: 403d4fbbffdd11c82caa7a6eac2e32d9b57f1ce3 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=afacdecd1f8001b143e86676859d570ebf4659b9 Log: Add support for begin_transaction in libmysql mode. Add support for flags and name for commit/rollback in libmysql mode Changed paths: M ext/mysqli/mysqli_api.c M ext/mysqli/mysqli_fe.c M ext/mysqli/mysqli_fe.h M ext/mysqli/mysqli_libmysql.h M ext/mysqli/mysqli_nonapi.c M ext/mysqli/tests/mysqli_class_mysqli_interface.phpt M ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt M ext/mysqli/tests/mysqli_commit_oo.phpt diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 70a8cc6..760ee3c 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -30,6 +30,7 @@ #include "php_ini.h" #include "php_globals.h" #include "ext/standard/info.h" +#include "ext/standard/php_smart_str.h" #include "php_mysqli_structs.h" #include "mysqli_priv.h" @@ -635,18 +636,86 @@ PHP_FUNCTION(mysqli_close) } /* }}} */ + +#if !defined(MYSQLI_USE_MYSQLND) +/* {{{ mysqli_tx_cor_options_to_string */ +static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str * str, const unsigned int mode) +{ + if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "AND CHAIN", sizeof("AND CHAIN") - 1); + } else if (mode & TRANS_COR_AND_NO_CHAIN && !(mode & TRANS_COR_AND_CHAIN)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "AND NO CHAIN", sizeof("AND NO CHAIN") - 1); + } + + if (mode & TRANS_COR_RELEASE && !(mode & TRANS_COR_NO_RELEASE)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "RELEASE", sizeof("RELEASE") - 1); + } else if (mode & TRANS_COR_NO_RELEASE && !(mode & TRANS_COR_RELEASE)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "NO RELEASE", sizeof("NO RELEASE") - 1); + } + smart_str_0(str); +} +/* }}} */ + + +/* {{{ proto bool mysqli_commit_or_rollback_libmysql */ +static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, const unsigned int mode, const char * const name) +{ + int ret; + smart_str tmp_str = {0, 0, 0}; + mysqli_tx_cor_options_to_string(conn, &tmp_str, mode); + smart_str_0(&tmp_str); + + { + char * commented_name = NULL; + unsigned int commented_name_len = name? spprintf(&commented_name, 0, " /*%s*/", name):0; + char * query; + unsigned int query_len = spprintf(&query, 0, (commit? "COMMIT%s %s":"ROLLBACK%s %s"), + commented_name? commented_name:"", tmp_str.c? tmp_str.c:""); + smart_str_free(&tmp_str); + + ret = mysql_real_query(conn, query, query_len); + efree(query); + if (commented_name) { + efree(commented_name); + } + } +} +/* }}} */ +#endif + + /* {{{ proto bool mysqli_commit(object link) Commit outstanding actions and close transaction */ PHP_FUNCTION(mysqli_commit) { MY_MYSQL*mysql; zval*mysql_link; + longflags = TRANS_COR_NO_OPT; + char * name = NULL; + int name_len = 0; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); - if (mysql_commit(mysql->mysql)) { + +#if !defined(MYSQLI_USE_MYSQLND) + if (mysqli_commit_or_rollback_libmysql(mysql->mysql, TRUE, flags, name)) { +#else + if (mysqlnd_commit(mysql->m
[PHP-CVS] com php-src: Export new calls: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd.h ext/mysqlnd/mysqlnd_libmysql_compat.h
Commit:403d4fbbffdd11c82caa7a6eac2e32d9b57f1ce3 Author:Andrey Hristov Thu, 7 Feb 2013 18:29:19 +0100 Parents: 49e3d91ad91bd3b65e2142641f80de0401396b85 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=403d4fbbffdd11c82caa7a6eac2e32d9b57f1ce3 Log: Export new calls Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd.h M ext/mysqlnd/mysqlnd_libmysql_compat.h Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 0e47def..959f3e0 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2761,9 +2761,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi /* }}} */ -typedef enum_func_status (*func_mysqlnd_conn_data__)(MYSQLND_CONN_DATA * conn, const unsigned int flags, const char * const name TSRMLS_DC); - - /* {{{ mysqlnd_conn_data::local_tx_start */ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC) diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index bf0f70b..7adf3b6 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -192,8 +192,9 @@ PHPAPI void mysqlnd_set_local_infile_handler(MYSQLND_CONN_DATA * const conn, con /* Simple commands */ #define mysqlnd_autocommit(conn, mode) ((conn)->data)->m->set_autocommit((conn)->data, (mode) TSRMLS_CC) -#define mysqlnd_commit(conn) ((conn)->data)->m->tx_commit((conn)->data TSRMLS_CC) -#define mysqlnd_rollback(conn) ((conn)->data)->m->tx_rollback((conn)->data TSRMLS_CC) +#define mysqlnd_begin_transaction(conn,flags,name) ((conn)->data)->m->tx_begin((conn)->data, (flags), (name) TSRMLS_CC) +#define mysqlnd_commit(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, TRUE, (flags), (name) TSRMLS_CC) +#define mysqlnd_rollback(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, FALSE, (flags), (name) TSRMLS_CC) #define mysqlnd_list_dbs(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW DATABASES LIKE %s":"SHOW DATABASES", (wild), NULL TSRMLS_CC) #define mysqlnd_list_fields(conn, tab,wild) ((conn)->data)->m->list_fields((conn)->data, (tab), (wild) TSRMLS_CC) #define mysqlnd_list_processes(conn) ((conn)->data)->m->list_method((conn)->data, "SHOW PROCESSLIST", NULL, NULL TSRMLS_CC) diff --git a/ext/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h index e3ab9ee..516200e 100644 --- a/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -44,7 +44,7 @@ #define mysql_change_user(r,a,b,c) mysqlnd_change_user((r), (a), (b), (c), FALSE) #define mysql_character_set_name(c)mysqlnd_character_set_name((c)) #define mysql_close(r) mysqlnd_close((r), MYSQLND_CLOSE_EXPLICIT) -#define mysql_commit(r) mysqlnd_commit((r)) +#define mysql_commit(r) mysqlnd_commit((r), TRANS_COR_NO_OPT, NULL) #define mysql_data_seek(r,o) mysqlnd_data_seek((r),(o)) #define mysql_debug(x) mysqlnd_debug((x)) #define mysql_dump_debug_info(r) mysqlnd_dump_debug_info((r)) @@ -74,7 +74,7 @@ #define mysql_real_escape_string(r,a,b,c) mysqlnd_real_escape_string((r), (a), (b), (c)) #define mysql_real_query(r,a,b)mysqlnd_query((r), (a), (b)) #define mysql_refresh(conn, options) mysqlnd_refresh((conn), (options)) -#define mysql_rollback(r) mysqlnd_rollback((r)) +#define mysql_rollback(r) mysqlnd_rollback((r), TRANS_COR_NO_OPT, NULL) #define mysql_select_db(r,a) mysqlnd_select_db((r), (a) ,strlen((a))) #define mysql_set_server_option(r,o) mysqlnd_set_server_option((r), (o)) #define mysql_set_character_set(r,a) mysqlnd_set_character_set((r), (a)) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add support for commit and rollback options. Add support for explicitly starting a transaction - modes also available. Using the API makes the life of load balancer mysqlnd plug
Commit:9fb0dba4be197b677b6ff7df23a110698d12530b Author:Andrey Hristov Thu, 7 Feb 2013 16:05:27 +0100 Parents: 0547a36e95ec36025a30e93e971d26b6b1ecf0e9 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9fb0dba4be197b677b6ff7df23a110698d12530b Log: Add support for commit and rollback options. Add support for explicitly starting a transaction - modes also available. Using the API makes the life of load balancer mysqlnd plugins easier/possible. Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_enum_n_def.h M ext/mysqlnd/mysqlnd_structs.h diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 1bab6f5..d7ddcb5 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2617,12 +2617,79 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsi static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC) { - size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_commit); + return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL TSRMLS_CC); +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::tx_rollback */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn TSRMLS_DC) +{ + return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL TSRMLS_CC); +} +/* }}} */ + + +/* {{{ mysqlnd_tx_cor_options_to_string */ +static void +MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode TSRMLS_DC) +{ + if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "AND CHAIN", sizeof("AND CHAIN") - 1); + } else if (mode & TRANS_COR_AND_NO_CHAIN && !(mode & TRANS_COR_AND_CHAIN)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "AND NO CHAIN", sizeof("AND NO CHAIN") - 1); + } + + if (mode & TRANS_COR_RELEASE && !(mode & TRANS_COR_NO_RELEASE)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "RELEASE", sizeof("RELEASE") - 1); + } else if (mode & TRANS_COR_NO_RELEASE && !(mode & TRANS_COR_RELEASE)) { + if (str->len) { + smart_str_appendl(str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(str, "NO RELEASE", sizeof("NO RELEASE") - 1); + } + smart_str_0(str); +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::tx_commit_ex */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name TSRMLS_DC) +{ + size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_commit_or_rollback); enum_func_status ret = FAIL; - DBG_ENTER("mysqlnd_conn_data::tx_commit"); + DBG_ENTER("mysqlnd_conn_data::tx_commit_or_rollback"); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { - ret = conn->m->query(conn, "COMMIT", sizeof("COMMIT") - 1 TSRMLS_CC); + do { + smart_str tmp_str = {0, 0, 0}; + conn->m->tx_cor_options_to_string(conn, &tmp_str, flags TSRMLS_CC); + smart_str_0(&tmp_str); + + { + char * query; + unsigned int query_len = mnd_sprintf(&query, 0, (commit? "COMMIT %s":"ROLLBACK %s"), tmp_str.c? tmp_str.c:""); + smart_str_free(&tmp_str); + + if (!query) { + SET_OOM_ERROR(*conn->error_info); + break; + } + ret = conn->m->query(conn, query, query_len TSRMLS_CC); + mnd_sprintf_free(query); + } + } while (0); conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); } @@ -2631,16 +2698,55 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC) /* }}} */ -/* {{
[PHP-CVS] com php-src: Add the name in a comment at commit/rollback, if provided: ext/mysqlnd/mysqlnd.c
Commit:49e3d91ad91bd3b65e2142641f80de0401396b85 Author:Andrey Hristov Thu, 7 Feb 2013 16:24:08 +0100 Parents: 9fb0dba4be197b677b6ff7df23a110698d12530b Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=49e3d91ad91bd3b65e2142641f80de0401396b85 Log: Add the name in a comment at commit/rollback, if provided Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index d7ddcb5..0e47def 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2678,8 +2678,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con smart_str_0(&tmp_str); { + char * commented_name = NULL; + unsigned int commented_name_len = name? mnd_sprintf(&commented_name, 0, " /*%s*/", name):0; char * query; - unsigned int query_len = mnd_sprintf(&query, 0, (commit? "COMMIT %s":"ROLLBACK %s"), tmp_str.c? tmp_str.c:""); + unsigned int query_len = mnd_sprintf(&query, 0, (commit? "COMMIT%s %s":"ROLLBACK%s %s"), + commented_name? commented_name:"", tmp_str.c? tmp_str.c:""); smart_str_free(&tmp_str); if (!query) { @@ -2688,6 +2691,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con } ret = conn->m->query(conn, query, query_len TSRMLS_CC); mnd_sprintf_free(query); + if (commented_name) { + mnd_sprintf_free(commented_name); + } } } while (0); conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: check the validity of the parameter: ext/mysqlnd/mysqlnd.c
Commit:740b823be80a29e4c6537d4053eb7bad0fae6c41 Author:Andrey Hristov Mon, 4 Feb 2013 14:27:56 +0100 Parents: 643ce95b5bd80e744c7f5e6ac33138f40ed9a1f7 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=740b823be80a29e4c6537d4053eb7bad0fae6c41 Log: check the validity of the parameter Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 0b81ac9..90c2b73 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2321,7 +2321,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c break; case MYSQL_SET_CHARSET_NAME: { - char * new_charset_name = mnd_pestrdup(value, conn->persistent); + char * new_charset_name; + if (!mysqlnd_find_charset_name(value)) { + SET_CLIENT_ERROR(*conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set"); + ret = FAIL; + break; + } + + new_charset_name = mnd_pestrdup(value, conn->persistent); if (!new_charset_name) { goto oom; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd.c
Commit:c311884e5b7534f1a55c5bf95edb2add3bd04d0b Author:Andrey Hristov Mon, 4 Feb 2013 14:28:23 +0100 Parents: cb8b2dd2e0257f13eedb0bf6ea07944dd71679ad 740b823be80a29e4c6537d4053eb7bad0fae6c41 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c311884e5b7534f1a55c5bf95edb2add3bd04d0b Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/mysqlnd/mysqlnd.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add new charset, from MySQL 5.6: ext/mysqlnd/mysqlnd_charset.c
Commit:f45a85c3861325c0ec5f5f5f7af01e4de1545189 Author:Andrey Hristov Fri, 1 Feb 2013 17:21:50 +0100 Parents: 9d75bf35e96bfc5c8d629ecef6807a90b4c98be7 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f45a85c3861325c0ec5f5f5f7af01e4de1545189 Log: add new charset, from MySQL 5.6 Changed paths: M ext/mysqlnd/mysqlnd_charset.c Diff: diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index a36bb11..8766a4b 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -504,12 +504,14 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL}, { 54, "utf16", "utf16_general_ci", 2, 4, "UTF-16 Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16}, { 55, "utf16", "utf16_bin", 2, 4, "UTF-16 Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16}, + { 56, "utf16le", "utf16le_general_ci", 2, 4, "UTF-16LE Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16}, { 58, "cp1257", "cp1257_bin", 1, 1, "", NULL, NULL}, #ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5 { 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL}, #endif /*55*/{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, /*55*/{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, + { 62, "utf16le", "utf16le_bin", 2, 4, "UTF-16LE Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16}, { 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL}, { 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL}, { 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL}, @@ -669,14 +671,15 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(unsigned int charsetnr) /* {{{ mysqlnd_find_charset_name */ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const name) { - const MYSQLND_CHARSET * c = mysqlnd_charsets; - - do { - if (!strcasecmp(c->name, name)) { - return c; - } - ++c; - } while (c[0].nr != 0); + if (name) { + const MYSQLND_CHARSET * c = mysqlnd_charsets; + do { + if (!strcasecmp(c->name, name)) { + return c; + } + ++c; + } while (c[0].nr != 0); + } return NULL; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix valgrind warning: ext/mysqlnd/mysqlnd_structs.h
Commit:95346c017c55e44a3e3d19945902a0275d3fafe4 Author:Andrey Hristov Tue, 22 Jan 2013 16:48:39 +0100 Parents: e6bde1f8f6d8b5d32e608926dd2af2e0f82a5de5 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=95346c017c55e44a3e3d19945902a0275d3fafe4 Log: fix valgrind warning Changed paths: M ext/mysqlnd/mysqlnd_structs.h Diff: diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index ecb1d89..b88004a 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -195,7 +195,7 @@ typedef struct st_mysqlnd_net_options unsigned int timeout_read; unsigned int timeout_write; - unsigned int net_read_buffer_size; + size_t net_read_buffer_size; /* SSL information */ char*ssl_key; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: revert change. now it doesn't compile again...someone should fix ext/date...: ext/date/php_date.c
Commit:5cfa916aad14df889e9119161e359b57a4d9886e Author:Andrey Hristov Tue, 15 Jan 2013 12:20:58 +0100 Parents: acc24d1f9eb1f5dddc89123baca14e70be84be20 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5cfa916aad14df889e9119161e359b57a4d9886e Log: revert change. now it doesn't compile again...someone should fix ext/date... Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1e1e239..cc83130 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2071,7 +2071,7 @@ static zval* date_clone_immutable(zval *object) zval *new_object; ALLOC_ZVAL(new_object); -// Z_OBJVAL_P(new_object) = date_object_clone_date(object); + Z_OBJVAL_P(new_object) = date_object_clone_date(object); Z_SET_REFCOUNT_P(new_object, 1); Z_SET_ISREF_P(new_object); Z_TYPE_P(new_object) = IS_OBJECT; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Use two dtors thus allow allocation based on the alloc model of the connection.: ext/date/php_date.c ext/mysqlnd/mysqlnd.c
Commit:acc24d1f9eb1f5dddc89123baca14e70be84be20 Author:Andrey Hristov Tue, 15 Jan 2013 12:19:52 +0100 Parents: d377a266b27e0d0b2ac088333564f8d1f05cceb8 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=acc24d1f9eb1f5dddc89123baca14e70be84be20 Log: Use two dtors thus allow allocation based on the alloc model of the connection. Changed paths: M ext/date/php_date.c M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index cc83130..1e1e239 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2071,7 +2071,7 @@ static zval* date_clone_immutable(zval *object) zval *new_object; ALLOC_ZVAL(new_object); - Z_OBJVAL_P(new_object) = date_object_clone_date(object); +// Z_OBJVAL_P(new_object) = date_object_clone_date(object); Z_SET_REFCOUNT_P(new_object, 1); Z_SET_ISREF_P(new_object); Z_TYPE_P(new_object) = IS_OBJECT; diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index f5b1063..96c420d 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2418,14 +2418,28 @@ end: /* }}} */ -/* {{{ connect_attr_item_dtor */ +/* {{{ connect_attr_item_edtor */ static void -connect_attr_item_dtor(void * pDest) +connect_attr_item_edtor(void * pDest) { #ifdef ZTS TSRMLS_FETCH(); #endif - DBG_ENTER("connect_attr_item_dtor"); + DBG_ENTER("connect_attr_item_edtor"); + mnd_efree(*(char **) pDest); + DBG_VOID_RETURN; +} +/* }}} */ + + +/* {{{ connect_attr_item_pdtor */ +static void +connect_attr_item_pdtor(void * pDest) +{ +#ifdef ZTS + TSRMLS_FETCH(); +#endif + DBG_ENTER("connect_attr_item_pdtor"); mnd_pefree(*(char **) pDest, 1); DBG_VOID_RETURN; } @@ -2456,11 +2470,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons if (!conn->options->connect_attr) { goto oom; } - zend_hash_init(conn->options->connect_attr, 0, NULL, connect_attr_item_dtor, conn->persistent); + zend_hash_init(conn->options->connect_attr, 0, NULL, conn->persistent? connect_attr_item_pdtor:connect_attr_item_edtor, conn->persistent); } DBG_INF_FMT("Adding [%s][%s]", key, value); { - const char * copyv = mnd_pestrdup(value, 1); + const char * copyv = mnd_pestrdup(value, conn->persistent); if (!copyv) { goto oom; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: plug a leak - forgot ot use the dtor already written: ext/mysqlnd/mysqlnd.c
Commit:d377a266b27e0d0b2ac088333564f8d1f05cceb8 Author:Andrey Hristov Tue, 15 Jan 2013 11:32:44 +0100 Parents: 5718568830ebea6684f3093a5681eb0d44d6d417 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d377a266b27e0d0b2ac088333564f8d1f05cceb8 Log: plug a leak - forgot ot use the dtor already written Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 1023b3e..f5b1063 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1103,6 +1103,7 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle, } /* }}} */ + /* {{{ mysqlnd_connect */ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle, const char * host, const char * user, @@ -2455,7 +2456,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons if (!conn->options->connect_attr) { goto oom; } - zend_hash_init(conn->options->connect_attr, 0, NULL, NULL, conn->persistent); + zend_hash_init(conn->options->connect_attr, 0, NULL, connect_attr_item_dtor, conn->persistent); } DBG_INF_FMT("Adding [%s][%s]", key, value); { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/file.c
Commit:22ba2b95ce840fb0cc29acac9a1f6240a17c0c08 Author:Andrey Hristov Tue, 15 Jan 2013 11:06:59 +0100 Parents: dc495bbe95680a9cf2321da83a382d834d70758c 83864b470b030a7d1bd0a1b46d3be75ce301304c Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=22ba2b95ce840fb0cc29acac9a1f6240a17c0c08 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: NEWS Changed paths: MM ext/standard/file.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add support for connect attributes, as of MySQL 5.6: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd.h ext/mysqlnd/mysqlnd_auth.c ext/mysqlnd/mysqlnd_enum_n_def.h ext/mysqlnd/mysqlnd_
Commit:1ff43522630f0f98c20e884890f77e6593a43f3b Author:Andrey Hristov Tue, 15 Jan 2013 10:04:59 +0100 Parents: be07f815f240803fe7a48a5fb3d68a169bef4707 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1ff43522630f0f98c20e884890f77e6593a43f3b Log: Add support for connect attributes, as of MySQL 5.6 Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd.h M ext/mysqlnd/mysqlnd_auth.c M ext/mysqlnd/mysqlnd_enum_n_def.h M ext/mysqlnd/mysqlnd_libmysql_compat.h M ext/mysqlnd/mysqlnd_structs.h M ext/mysqlnd/mysqlnd_wireprotocol.c M ext/mysqlnd/mysqlnd_wireprotocol.h diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index ebc4a77..1023b3e 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -95,6 +95,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn TSRMLS_ mnd_pefree(conn->options->cfg_section, pers); conn->options->cfg_section = NULL; } + if (conn->options->connect_attr) { + zend_hash_destroy(conn->options->connect_attr); + mnd_pefree(conn->options->connect_attr, pers); + conn->options->connect_attr = NULL; + } } /* }}} */ @@ -797,13 +802,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn, goto err; } + conn->client_flag = mysql_flags; + conn->server_capabilities = greet_packet->server_capabilities; + if (FAIL == mysqlnd_connect_run_authentication(conn, user, passwd, db, db_len, (size_t) passwd_len, greet_packet, conn->options, mysql_flags TSRMLS_CC)) { goto err; } - conn->client_flag = mysql_flags; - conn->server_capabilities = greet_packet->server_capabilities; conn->upsert_status->warning_count = 0; conn->upsert_status->server_status = greet_packet->server_status; conn->upsert_status->affected_rows = 0; @@ -811,6 +817,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn, PACKET_FREE(greet_packet); DBG_RETURN(PASS); err: + conn->client_flag = 0; + conn->server_capabilities = 0; PACKET_FREE(greet_packet); DBG_RETURN(FAIL); } @@ -1086,6 +1094,7 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle, DBG_ENTER("mysqlnd_conn::connect"); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { + mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_client_name", "mysqlnd"); ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC); conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC); @@ -2375,6 +2384,19 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; } break; + case MYSQL_OPT_CONNECT_ATTR_RESET: + if (conn->options->connect_attr) { + DBG_INF_FMT("Before reset %d attribute(s)", zend_hash_num_elements(conn->options->connect_attr)); + zend_hash_clean(conn->options->connect_attr); + } + break; + case MYSQL_OPT_CONNECT_ATTR_DELETE: + if (conn->options->connect_attr && value) { + DBG_INF_FMT("Before delete %d attribute(s)", zend_hash_num_elements(conn->options->connect_attr)); + zend_hash_del(conn->options->connect_attr, value, strlen(value)); + DBG_INF_FMT("%d left", zend_hash_num_elements(conn->options->connect_attr)); + } + break; #ifdef WHEN_SUPPORTED_BY_MYSQLI case MYSQL_SHARED_MEMORY_BASE_NAME: case MYSQL_OPT_USE_RESULT: @@ -2395,6 +2417,69 @@ end: /* }}} */ +/* {{{ connect_attr_item_dtor */ +static void +connect_attr_item_dtor(void * pDest) +{ +#ifdef ZTS + TSRMLS_FETCH(); +#endif + DBG_ENTER("connect_attr_item_dtor"); + mnd_pefree(*(char **) pDest, 1); + DBG_VOID_RETURN; +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::set_client_option_2d */ +static enum_func_stat
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': NEWS
Commit:c4fe37bd8c5e35d1957d43acecbcb3f010501e4a Author:Andrey Hristov Tue, 15 Jan 2013 10:12:54 +0100 Parents: 7a316922536495560b080bc602f54c268537c67b dc495bbe95680a9cf2321da83a382d834d70758c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c4fe37bd8c5e35d1957d43acecbcb3f010501e4a Log: Merge branch 'PHP-5.5' Conflicts: NEWS Changed paths: MM NEWS diff --cc NEWS index 7d36738,4145dc5..f753a83 --- a/NEWS +++ b/NEWS @@@ -1,6 -1,250 +1,5 @@@ PHP NEWS ||| - <<<<<<< HEAD -?? ??? 201?, PHP 5.5.0 Alpha 3 - -- Core: - . Fixed bug #63980 (object members get trimmed by zero bytes). (Laruence) - -- General improvements: - . Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick) - . Fixed bug #63822 (Crash when using closures with ArrayAccess). -(Nikita Popov) - . Add Generator::throw() method. (Nikita Popov) - . Bug #23955: allow specifying Max-Age attribute in setcookie() (narfbg, Lars) - . Bug #52126: timestamp for mail.log (Martin Jansen, Lars) - -- mysqlnd - . Fixed return value of mysqli_stmt_affected_rows() in the time after -prepare() and before execute(). (Andrey) - -- cURL: - . Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror -curl_pause, curl_reset, curl_share_close, curl_share_init, - curl_share_setopt curl_strerror and curl_unescape. (Pierrick) - . Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION, -CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE, - CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick) - -- DateTime - . Added DateTimeImmutable - a variant of DateTime that only returns the -modified state instead of changing itself. (Derick) - -- pgsql: - . Bug #46408: Locale number format settings can cause pg_query_params to -break with numerics. (asmecher, Lars) - -- dba: - . Bug #62489: dba_insert not working as expected. -(marc-bennewitz at arcor dot de, Lars) - -18 Dec 2012, PHP 5.5.0 Alpha 2 - -- General improvements: - . Added systemtap support by enabling systemtap compatible dtrace probes on -linux. (David Soria Parra) - . Added support for using empty() on the result of function calls and -other expressions (https://wiki.php.net/rfc/empty_isset_exprs). -(Nikita Popov) - . Optimized access to temporary and compiled VM variables. 8% less memory -reads. (Dmitry) - . The VM stacks for passing function arguments and syntaticaly nested calls -were merged into a single stack. The stack size needed for op_array -execution is calculated at compile time and preallocated at once. As result -all the stack push operatins don't require checks for stack overflow -any more. (Dmitry) - -- MySQL - . This extension is now deprecated, and deprecation warnings will be generated -when connections are established to databases via mysql_connect(), -mysql_pconnect(), or through implicit connection: use MySQLi or PDO_MySQL -instead (https://wiki.php.net/rfc/mysql_deprecation). (Adam) - -- Fileinfo: - . Fixed bug #63590 (Different results in TS and NTS under Windows). -(Anatoliy) - -- Apache2 Handler SAPI: - . Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy) - -13 Nov 2012, PHP 5.5.0 Alpha 1 - -- General improvements: - . Added generators and coroutines (https://wiki.php.net/rfc/generators). -(Nikita Popov) - . Added "finally" keyword (https://wiki.php.net/rfc/finally). (Laruence) - . Add simplified password hashing API -(https://wiki.php.net/rfc/password_hash). (Anthony Ferrara) - . Added support for list in foreach (https://wiki.php.net/rfc/foreachlist). -(Laruence) - . Added support for using empty() on the result of function calls and -other expressions (https://wiki.php.net/rfc/empty_isset_exprs). -(Nikita Popov) - . Added support for constant array/string dereferencing. (Laruence) - . Improve set_exception_handler while doing reset.(Laruence) - . Remove php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid(), -zend_logo_guid(). (Adnrew Faulds) - . Drop Windows XP and 2003 support. (Pierre) - -- Calendar: - . Fixed bug #54254 (cal_from_jd returns month = 6 when there is only one Adar) -(Stas, Eitan Mosenkis) - -- Core: - . Added boolval(). (Jille Timmermans) - . Added "Z" option to pack/unpack. (Gustavo) - . Implemented FR #60738 (Allow 'set_error_handler' to handle NULL). -(Laruence, Nikita Popov) - . Added optional second argument for assert() to specify custom message. Patch -by Lonny Kapelushnik (lo...@lonnylot.com). (Lars) - . Fixed bug #18556 (Engine uses
[PHP-CVS] com php-src: Add mysqli support - constants and checking in mysqli_options() for the new constant for password expriration: ext/mysqli/mysqli.c ext/mysqli/mysqli_api.c
Commit:d430b5a4eb26679a6dfa7055dff43cae8dabd20e Author:Andrey Hristov Wed, 9 Jan 2013 19:14:48 +0100 Parents: 258c76eb41a7eaf8e1e7b4994fa5f268c2060039 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d430b5a4eb26679a6dfa7055dff43cae8dabd20e Log: Add mysqli support - constants and checking in mysqli_options() for the new constant for password expriration Changed paths: M ext/mysqli/mysqli.c M ext/mysqli/mysqli_api.c Diff: diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 1a7d72f..a4c1b87 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -838,6 +838,9 @@ 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) + REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT); +#endif #ifdef MYSQLI_USE_MYSQLND mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 277322f..2cda0aa 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1672,6 +1672,9 @@ 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) + case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: +#endif return IS_LONG; #ifdef MYSQL_SHARED_MEMORY_BASE_NAME -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqli/mysqli.c ext/mysqli/mysqli_api.c
Commit:846e506a3d1d11773171e08d3c6f9bbc7fc3dacd Author:Andrey Hristov Wed, 9 Jan 2013 19:15:29 +0100 Parents: 790096b68b2a58eb691e8a6f33325e8826bec263 d430b5a4eb26679a6dfa7055dff43cae8dabd20e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=846e506a3d1d11773171e08d3c6f9bbc7fc3dacd Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/mysqli/mysqli.c MM ext/mysqli/mysqli_api.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: backport handling of expired passwords in mysqlnd to 5.4: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_enum_n_def.h
Commit:258c76eb41a7eaf8e1e7b4994fa5f268c2060039 Author:Andrey Hristov Wed, 9 Jan 2013 18:58:29 +0100 Parents: bcd278ad7f3a8e549a3281600decd897dd7d73ce Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=258c76eb41a7eaf8e1e7b4994fa5f268c2060039 Log: backport handling of expired passwords in mysqlnd to 5.4 Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_enum_n_def.h Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index db0a111..0b81ac9 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2286,7 +2286,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c break; #endif case MYSQL_OPT_LOCAL_INFILE: - if (!value || (*(unsigned int*) value) ? 1 : 0) { + if (value && (*(unsigned int*) value) ? 1 : 0) { conn->options->flags |= CLIENT_LOCAL_FILES; } else { conn->options->flags &= ~CLIENT_LOCAL_FILES; @@ -2370,6 +2370,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol); break; } + case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: + if (value && (*(unsigned int*) value) ? 1 : 0) { + conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; + } else { + conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; + } + break; #ifdef WHEN_SUPPORTED_BY_MYSQLI case MYSQL_SHARED_MEMORY_BASE_NAME: case MYSQL_OPT_USE_RESULT: diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 56a2bf9..92f6cb3 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -95,7 +95,9 @@ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ #define CLIENT_PS_MULTI_RESULTS(1UL << 18) /* Multi-results in PS-protocol */ #define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */ - +#define CLIENT_CONNECT_ATTRS (1UL << 20) /* Client supports connection attributes */ +#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21) /* Enable authentication response packet to be larger than 255 bytes. */ +#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS(1UL << 22) /* Don't close the connection for a connection with expired password. */ #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define MYSQLND_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | \ @@ -164,6 +166,9 @@ typedef enum mysqlnd_option MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, + MYSQL_SERVER_PUBLIC_KEY, + MYSQL_ENABLE_CLEARTEXT_PLUGIN, + MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, #if MYSQLND_UNICODE MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE = 200, #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: support for password expiration in mysqlnd, through a flag: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_enum_n_def.h
Commit:ddcb67d446ba7a0637fdf3a52bd99ee80755 Author:Andrey Hristov Wed, 9 Jan 2013 15:33:07 +0100 Parents: 83f736aad4eaea1b2a6df70e81632a8069641894 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ddcb67d446ba7a0637fdf3a52bd99ee80755 Log: support for password expiration in mysqlnd, through a flag Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_enum_n_def.h Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 653561e..b9db94b 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2282,7 +2282,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c break; #endif case MYSQL_OPT_LOCAL_INFILE: - if (!value || (*(unsigned int*) value) ? 1 : 0) { + if (value && (*(unsigned int*) value) ? 1 : 0) { conn->options->flags |= CLIENT_LOCAL_FILES; } else { conn->options->flags &= ~CLIENT_LOCAL_FILES; @@ -2366,6 +2366,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol); break; } + case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: + if (value && (*(unsigned int*) value) ? 1 : 0) { + conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; + } else { + conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; + } + break; #ifdef WHEN_SUPPORTED_BY_MYSQLI case MYSQL_SHARED_MEMORY_BASE_NAME: case MYSQL_OPT_USE_RESULT: diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 7dd4d0f..abaaf1f 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -169,6 +169,8 @@ typedef enum mysqlnd_option MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, MYSQL_SERVER_PUBLIC_KEY, + MYSQL_ENABLE_CLEARTEXT_PLUGIN, + MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, MYSQLND_DEPRECATED_ENUM1 = 200, #ifdef MYSQLND_STRING_TO_INT_CONVERSION MYSQLND_OPT_INT_AND_FLOAT_NATIVE = 201, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd.c
Commit:cb6071ef54779e392cf50831399dfd66939de9a0 Author:Andrey Hristov Wed, 9 Jan 2013 18:30:56 +0100 Parents: ddcb67d446ba7a0637fdf3a52bd99ee80755 6a6ec195acb0a67b8728dd32fad5c82b37b31192 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cb6071ef54779e392cf50831399dfd66939de9a0 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: ext/mysqlnd/mysqlnd.c Changed paths: MM ext/mysqlnd/mysqlnd.c diff --cc ext/mysqlnd/mysqlnd.c index b9db94b,3483d86..db1b901 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@@ -657,160 -491,116 +657,162 @@@ mysqlnd_connect_run_authentication ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags TSRMLS_CC); if (PASS == ret) { - zend_bool first_call = TRUE; + ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, db_len, + greet_packet->auth_plugin_data, greet_packet->auth_plugin_data_len, greet_packet->auth_protocol, + greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/ TSRMLS_CC); + } + DBG_RETURN(ret); +} +/* }}} */ - char * switch_to_auth_protocol = NULL; - size_t switch_to_auth_protocol_len = 0; - char * requested_protocol = NULL; - zend_uchar * plugin_data; - size_t plugin_data_len; - plugin_data_len = greet_packet->auth_plugin_data_len; - plugin_data = mnd_emalloc(plugin_data_len + 1); - if (!plugin_data) { - ret = FAIL; - goto end; - } - memcpy(plugin_data, greet_packet->auth_plugin_data, plugin_data_len); - plugin_data[plugin_data_len] = '\0'; +/* {{{ mysqlnd_conn_data::execute_init_commands */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC) +{ + enum_func_status ret = PASS; - requested_protocol = mnd_pestrdup(greet_packet->auth_protocol? greet_packet->auth_protocol: "mysql_native_password", FALSE); - if (!requested_protocol) { - ret = FAIL; - goto end; + DBG_ENTER("mysqlnd_conn_data::execute_init_commands"); + if (conn->options->init_commands) { + unsigned int current_command = 0; + for (; current_command < conn->options->num_commands; ++current_command) { + const char * const command = conn->options->init_commands[current_command]; + if (command) { + MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT); + if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) { + MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT); + ret = FAIL; + break; + } + if (conn->last_query_type == QUERY_SELECT) { + MYSQLND_RES * result = conn->m->use_result(conn TSRMLS_CC); + if (result) { + result->m.free_result(result, TRUE TSRMLS_CC); + } + } + } } + } + DBG_RETURN(ret); +} +/* }}} */ - do { - struct st_mysqlnd_authentication_plugin * auth_plugin; - { - char * plugin_name = NULL; - mnd_sprintf(&plugin_name, 0, "auth_plugin_%s", requested_protocol); +/* {{{ mysqlnd_conn_data::get_updated_connect_flags */ +static unsigned int +MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC) +{ + MYSQLND_NET * net = conn->net; - DBG_INF_FMT("looking for %s auth plugin", plugin_name); - auth_plugin = mysqlnd_plugin_find(plugin_name); - mnd_sprintf_free(plugin_name); + DBG_ENTER("mysqlnd_conn_data::get_updated_connect_flags"); + /* we allow load data local infile by default */ + mysql_flags |= MYSQLND_CAPABILITIES; - if (!auth_plugin) { -
[PHP-CVS] com php-src: Use during connect the flags set with set_client_option(): ext/mysqlnd/mysqlnd.c
Commit:12e759c2eaafbf85ef8595e4c2ed0711a25091ef Author:Andrey Hristov Wed, 9 Jan 2013 18:27:06 +0100 Parents: d4650c5d69ffb49d476a2969c6200879bd424caf Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=12e759c2eaafbf85ef8595e4c2ed0711a25091ef Log: Use during connect the flags set with set_client_option() Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index eaef49f..20bab91 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -691,6 +691,8 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn, mysql_flags |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS; mysql_flags |= MYSQLND_CAPABILITIES; + mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */ + if (db) { mysql_flags |= CLIENT_CONNECT_WITH_DB; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd.c
Commit:1f7f8429af67cd362ed1dc5ee81bcf518e9d44be Author:Andrey Hristov Wed, 9 Jan 2013 18:40:57 +0100 Parents: cb6071ef54779e392cf50831399dfd66939de9a0 bcd278ad7f3a8e549a3281600decd897dd7d73ce Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1f7f8429af67cd362ed1dc5ee81bcf518e9d44be Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: ext/mysqlnd/mysqlnd.c Changed paths: MM ext/mysqlnd/mysqlnd.c diff --cc ext/mysqlnd/mysqlnd.c index db1b901,db0a111..ebc4a77 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@@ -657,162 -491,116 +657,162 @@@ mysqlnd_connect_run_authentication ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags TSRMLS_CC); if (PASS == ret) { - zend_bool first_call = TRUE; + ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, db_len, + greet_packet->auth_plugin_data, greet_packet->auth_plugin_data_len, greet_packet->auth_protocol, + greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/ TSRMLS_CC); + } + DBG_RETURN(ret); +} +/* }}} */ - char * switch_to_auth_protocol = NULL; - size_t switch_to_auth_protocol_len = 0; - char * requested_protocol = NULL; - zend_uchar * plugin_data; - size_t plugin_data_len; - plugin_data_len = greet_packet->auth_plugin_data_len; - plugin_data = mnd_emalloc(plugin_data_len + 1); - if (!plugin_data) { - ret = FAIL; - goto end; - } - memcpy(plugin_data, greet_packet->auth_plugin_data, plugin_data_len); - plugin_data[plugin_data_len] = '\0'; +/* {{{ mysqlnd_conn_data::execute_init_commands */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC) +{ + enum_func_status ret = PASS; - requested_protocol = mnd_pestrdup(greet_packet->auth_protocol? greet_packet->auth_protocol: "mysql_native_password", FALSE); - if (!requested_protocol) { - ret = FAIL; - goto end; + DBG_ENTER("mysqlnd_conn_data::execute_init_commands"); + if (conn->options->init_commands) { + unsigned int current_command = 0; + for (; current_command < conn->options->num_commands; ++current_command) { + const char * const command = conn->options->init_commands[current_command]; + if (command) { + MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT); + if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) { + MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT); + ret = FAIL; + break; + } + if (conn->last_query_type == QUERY_SELECT) { + MYSQLND_RES * result = conn->m->use_result(conn TSRMLS_CC); + if (result) { + result->m.free_result(result, TRUE TSRMLS_CC); + } + } + } } + } + DBG_RETURN(ret); +} +/* }}} */ - do { - struct st_mysqlnd_authentication_plugin * auth_plugin; - { - char * plugin_name = NULL; - mnd_sprintf(&plugin_name, 0, "auth_plugin_%s", requested_protocol); +/* {{{ mysqlnd_conn_data::get_updated_connect_flags */ +static unsigned int +MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC) +{ + MYSQLND_NET * net = conn->net; - DBG_INF_FMT("looking for %s auth plugin", plugin_name); - auth_plugin = mysqlnd_plugin_find(plugin_name); - mnd_sprintf_free(plugin_name); + DBG_ENTER("mysqlnd_conn_data::get_updated_connect_flags"); + /* we allow load data local infile by default */ + mysql_flags |= MYSQLND_CAPABILITIES; - mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd.c
Commit:6a6ec195acb0a67b8728dd32fad5c82b37b31192 Author:Andrey Hristov Wed, 9 Jan 2013 18:27:50 +0100 Parents: 625000ab442dd4c1bfc6975a4a979f2c5f60a78d 12e759c2eaafbf85ef8595e4c2ed0711a25091ef Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6a6ec195acb0a67b8728dd32fad5c82b37b31192 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqlnd/mysqlnd.c Diff: diff --cc ext/mysqlnd/mysqlnd.c index 9e40846,20bab91..3483d86 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@@ -772,8 -688,11 +772,10 @@@ MYSQLND_METHOD(mysqlnd_conn_data, conne goto err; } /* we allow load data local infile by default */ - mysql_flags |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS; mysql_flags |= MYSQLND_CAPABILITIES; + mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */ + if (db) { mysql_flags |= CLIENT_CONNECT_WITH_DB; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix compilation error after merge: ext/mysqlnd/mysqlnd.c
Commit:bcd278ad7f3a8e549a3281600decd897dd7d73ce Author:Andrey Hristov Wed, 9 Jan 2013 18:39:59 +0100 Parents: 6a6ec195acb0a67b8728dd32fad5c82b37b31192 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bcd278ad7f3a8e549a3281600decd897dd7d73ce Log: fix compilation error after merge Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 3483d86..db0a111 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -774,7 +774,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, /* we allow load data local infile by default */ mysql_flags |= MYSQLND_CAPABILITIES; - mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */ + mysql_flags |= conn->options->flags; /* use the flags from set_client_option() */ if (db) { mysql_flags |= CLIENT_CONNECT_WITH_DB; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add new constants: ext/mysqlnd/mysqlnd_enum_n_def.h
Commit:b8a369f522511109583cab276ee0d31bbb3f677a Author:Andrey Hristov Wed, 9 Jan 2013 14:50:43 +0100 Parents: 326f896739785cfcd36ef918dbd399ac605f6552 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b8a369f522511109583cab276ee0d31bbb3f677a Log: Add new constants Changed paths: M ext/mysqlnd/mysqlnd_enum_n_def.h Diff: diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 3c50c2a..7dd4d0f 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -97,7 +97,9 @@ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ #define CLIENT_PS_MULTI_RESULTS(1UL << 18) /* Multi-results in PS-protocol */ #define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */ - +#define CLIENT_CONNECT_ATTRS (1UL << 20) /* Client supports connection attributes */ +#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21) /* Enable authentication response packet to be larger than 255 bytes. */ +#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS(1UL << 22) /* Don't close the connection for a connection with expired password. */ #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define MYSQLND_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': NEWS
Commit:4a68c46594aa5e258dccbbca773d401e9cf668cd Author:Andrey Hristov Mon, 7 Jan 2013 16:46:16 +0100 Parents: 7a13ce61e02d1894224a0c3009dac74990666926 cde53e7fcd3f74cb29af4d3fb9fb09812ee1d4a0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4a68c46594aa5e258dccbbca773d401e9cf668cd Log: Merge branch 'PHP-5.5' Conflicts: NEWS Changed paths: MM NEWS diff --cc NEWS index f753a83,e79501f..7d36738 --- a/NEWS +++ b/NEWS @@@ -1,5 -1,235 +1,6 @@@ PHP NEWS ||| -?? ??? 201?, PHP 5.5.0 Alpha 3 - -- General improvements: - . Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick) - . Fixed bug #63822 (Crash when using closures with ArrayAccess). -(Nikita Popov) - . Add Generator::throw() method. (Nikita Popov) - . Bug #23955: allow specifying Max-Age attribute in setcookie() (narfbg, Lars) - . Bug #52126: timestamp for mail.log (Martin Jansen, Lars) - -- mysqlnd - . Fixed return value of mysqli_stmt_affected_rows() in the time after -prepare() and before execute(). (Andrey) - -- cURL: - . Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror -curl_pause, curl_reset, curl_share_close, curl_share_init, - curl_share_setopt curl_strerror and curl_unescape. (Pierrick) - . Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION, -CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE, - CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick) - -18 Dec 2012, PHP 5.5.0 Alpha 2 - -- General improvements: - . Added systemtap support by enabling systemtap compatible dtrace probes on -linux. (David Soria Parra) - . Added support for using empty() on the result of function calls and -other expressions (https://wiki.php.net/rfc/empty_isset_exprs). -(Nikita Popov) - . Optimized access to temporary and compiled VM variables. 8% less memory -reads. (Dmitry) - . The VM stacks for passing function arguments and syntaticaly nested calls -were merged into a single stack. The stack size needed for op_array -execution is calculated at compile time and preallocated at once. As result -all the stack push operatins don't require checks for stack overflow -any more. (Dmitry) - -- MySQL - . This extension is now deprecated, and deprecation warnings will be generated -when connections are established to databases via mysql_connect(), -mysql_pconnect(), or through implicit connection: use MySQLi or PDO_MySQL -instead (https://wiki.php.net/rfc/mysql_deprecation). (Adam) - -- Fileinfo: - . Fixed bug #63590 (Different results in TS and NTS under Windows). -(Anatoliy) - -- Apache2 Handler SAPI: - . Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy) - -13 Nov 2012, PHP 5.5.0 Alpha 1 - -- General improvements: - . Added generators and coroutines (https://wiki.php.net/rfc/generators). -(Nikita Popov) - . Added "finally" keyword (https://wiki.php.net/rfc/finally). (Laruence) - . Add simplified password hashing API -(https://wiki.php.net/rfc/password_hash). (Anthony Ferrara) - . Added support for list in foreach (https://wiki.php.net/rfc/foreachlist). -(Laruence) - . Added support for using empty() on the result of function calls and -other expressions (https://wiki.php.net/rfc/empty_isset_exprs). -(Nikita Popov) - . Added support for constant array/string dereferencing. (Laruence) - . Improve set_exception_handler while doing reset.(Laruence) - . Remove php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid(), -zend_logo_guid(). (Adnrew Faulds) - . Drop Windows XP and 2003 support. (Pierre) - -- Calendar: - . Fixed bug #54254 (cal_from_jd returns month = 6 when there is only one Adar) -(Stas, Eitan Mosenkis) - -- Core: - . Added boolval(). (Jille Timmermans) - . Added "Z" option to pack/unpack. (Gustavo) - . Implemented FR #60738 (Allow 'set_error_handler' to handle NULL). -(Laruence, Nikita Popov) - . Added optional second argument for assert() to specify custom message. Patch -by Lonny Kapelushnik (lo...@lonnylot.com). (Lars) - . Fixed bug #18556 (Engine uses locale rules to handle class names). (Stas) - . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence) - . Fixed bug #61038 (unpack("a5", "str\0\0") does not work as expected). -(srgoogleguy, Gustavo) - . Return previous handler when passing NULL to set_error_handler and -set_exception_handler. (Nikita Popov) - -- cURL: - . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND, -CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PER
[PHP-CVS] com php-src: fix different values of mysqli_stmt_affected_rows between libmysql and mysqlnd (in favor of libmysql) before execute and after prepare(): NEWS ext/mysqli/tests/057.phpt ext/mysq
Commit:cde53e7fcd3f74cb29af4d3fb9fb09812ee1d4a0 Author:Andrey Hristov Mon, 7 Jan 2013 16:36:21 +0100 Parents: f4142a92b2ecfa0fdf89ec83bb41c2a46b299973 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cde53e7fcd3f74cb29af4d3fb9fb09812ee1d4a0 Log: fix different values of mysqli_stmt_affected_rows between libmysql and mysqlnd (in favor of libmysql) before execute and after prepare() Changed paths: M NEWS M ext/mysqli/tests/057.phpt M ext/mysqlnd/mysqlnd_ps.c Diff: diff --git a/NEWS b/NEWS index cfd2aa3..e79501f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ PHP NEWS . Bug #23955: allow specifying Max-Age attribute in setcookie() (narfbg, Lars) . Bug #52126: timestamp for mail.log (Martin Jansen, Lars) +- mysqlnd + . Fixed return value of mysqli_stmt_affected_rows() in the time after +prepare() and before execute(). (Andrey) + - cURL: . Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror curl_pause, curl_reset, curl_share_close, curl_share_init, diff --git a/ext/mysqli/tests/057.phpt b/ext/mysqli/tests/057.phpt index 2cb8875..7c7e2b7 100644 --- a/ext/mysqli/tests/057.phpt +++ b/ext/mysqli/tests/057.phpt @@ -35,8 +35,8 @@ require_once('skipifconnectfailure.inc'); var_dump(mysqli_stmt_reset($stmt)); var_dump($stmt = mysqli_prepare($link, "SELECT * FROM test_store_result")); - if ($IS_MYSQLND && $stmt->affected_rows !== -1) - printf("[001] Expecting -1, got %d\n", $stmt->affected_rows); + if ($stmt->affected_rows !== 0) + printf("[001] Expecting 0, got %d\n", $stmt->affected_rows); var_dump(mysqli_stmt_execute($stmt)); var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link)); diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 134be5f..4916c06 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -307,6 +307,7 @@ mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC) stmt->warning_count = stmt->conn->upsert_status->warning_count = prepare_resp->warning_count; stmt->field_count = stmt->conn->field_count = prepare_resp->field_count; stmt->param_count = prepare_resp->param_count; + stmt->upsert_status->affected_rows = 0; /* be like libmysql */ done: PACKET_FREE(prepare_resp); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqlnd/mysqlnd_alloc.c
Commit:ec012c1b75a46ebc9a685597d8bcd74c4c0fa0c4 Author:Andrey Hristov Wed, 19 Dec 2012 16:58:34 +0100 Parents: 2768315856be2c2df291b275b76d90fb6ef09414 ae9ba081c8c83db096e5f9ab6add73b6223663cc Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ec012c1b75a46ebc9a685597d8bcd74c4c0fa0c4 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: ext/mysqlnd/mysqlnd_alloc.c Changed paths: MM ext/mysqlnd/mysqlnd_alloc.c diff --cc ext/mysqlnd/mysqlnd_alloc.c index e681d33,5883d66..6166b4e --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@@ -81,11 -81,14 +81,14 @@@ void * _mysqlnd_emalloc(size_t size MYS #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_emalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_emalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif #if PHP_DEBUG /* -1 is also "true" */ @@@ -118,10 -121,13 +121,14 @@@ void * _mysqlnd_pemalloc(size_t size, z #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_pemalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno, persistent); ++ + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif #if PHP_DEBUG /* -1 is also "true" */ @@@ -157,11 -163,14 +164,15 @@@ void * _mysqlnd_ecalloc(unsigned int nm #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_ecalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); ++ + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif - DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); + TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); #if PHP_DEBUG /* -1 is also "true" */ @@@ -194,10 -203,13 +205,13 @@@ void * _mysqlnd_pecalloc(unsigned int n #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_pecalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno, persistent); + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif #if PHP_DEBUG /* -1 is also "true" */ @@@ -234,11 -246,14 +248,15 @@@ void * _mysqlnd_erealloc(void *ptr, siz #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_erealloc_fail_th
[PHP-CVS] com php-src: be cautious about the result of strrchr: ext/mysqlnd/mysqlnd_alloc.c
Commit:1f7c46b5790cbb82cad3920807f68e53aa242b4d Author:Andrey Hristov Tue, 18 Dec 2012 16:21:05 +0100 Parents: 05deaf17063b61f035e5602fba29e9d0aa8b3a41 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1f7c46b5790cbb82cad3920807f68e53aa242b4d Log: be cautious about the result of strrchr Changed paths: M ext/mysqlnd/mysqlnd_alloc.c Diff: diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 06e979a..5883d66 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -83,7 +83,12 @@ void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D) #endif DBG_ENTER(mysqlnd_emalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); + } +#endif #if PHP_DEBUG /* -1 is also "true" */ @@ -117,7 +122,12 @@ void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) long * threshold = persistent? &MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold); #endif DBG_ENTER(mysqlnd_pemalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); + } +#endif #if PHP_DEBUG /* -1 is also "true" */ @@ -154,7 +164,12 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold); #endif DBG_ENTER(mysqlnd_ecalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); + } +#endif DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); #if PHP_DEBUG @@ -189,7 +204,12 @@ void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent M long * threshold = persistent? &MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold); #endif DBG_ENTER(mysqlnd_pecalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); + } +#endif #if PHP_DEBUG /* -1 is also "true" */ @@ -227,7 +247,12 @@ void * _mysqlnd_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D) long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold); #endif DBG_ENTER(mysqlnd_erealloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); + } +#endif DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size); #if PHP_DEBUG @@ -262,7 +287,12 @@ void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQL long * threshold = persistent? &MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold); #endif DBG_ENTER(mysqlnd_perealloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); + } +#endif DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent); #if PHP_DEBUG @@ -296,7 +326,12 @@ void _mysqlnd_efree(void *ptr MYSQLND_MEM_D) size_t free_amount = 0; zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); DBG_ENTER(mysqlnd_efree_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno); +#if PHP_DEBUG + { + char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); + DBG_INF
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/mysqlnd/mysqlnd_alloc.c
Commit:c780ddbb5041160e85b0353fbb815f3997cd0b83 Author:Andrey Hristov Wed, 19 Dec 2012 15:05:47 +0100 Parents: 210d428f99bd3dff789e9257a4619e930d3c6e45 1f7c46b5790cbb82cad3920807f68e53aa242b4d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c780ddbb5041160e85b0353fbb815f3997cd0b83 Log: Merge branch 'PHP-5.4' Conflicts: ext/mysqlnd/mysqlnd_alloc.c Changed paths: MM ext/mysqlnd/mysqlnd_alloc.c diff --cc ext/mysqlnd/mysqlnd_alloc.c index e681d33,5883d66..6166b4e --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@@ -81,11 -81,14 +81,14 @@@ void * _mysqlnd_emalloc(size_t size MYS #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_emalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_emalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif #if PHP_DEBUG /* -1 is also "true" */ @@@ -118,10 -121,13 +121,14 @@@ void * _mysqlnd_pemalloc(size_t size, z #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_pemalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno, persistent); ++ + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif #if PHP_DEBUG /* -1 is also "true" */ @@@ -157,11 -163,14 +164,15 @@@ void * _mysqlnd_ecalloc(unsigned int nm #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_ecalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); ++ + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif - DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); + TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); #if PHP_DEBUG /* -1 is also "true" */ @@@ -194,10 -203,13 +205,13 @@@ void * _mysqlnd_pecalloc(unsigned int n #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold); #endif - char * fn = NULL; - DBG_ENTER(mysqlnd_pecalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", - (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno, persistent); + #if PHP_DEBUG + { - char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); - DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); ++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR); ++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno); + } + #endif #if PHP_DEBUG /* -1 is also "true" */ @@@ -234,11 -246,14 +248,15 @@@ void * _mysqlnd_erealloc(void *ptr, siz #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold); #endif - char * fn = N
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/mysqlnd/mysqlnd_wireprotocol.c
Commit:9acc2367b16dcf8c281ca9bd35bd25913ab20b4a Author:Andrey Hristov Wed, 31 Oct 2012 19:04:10 +0100 Parents: 44b1a07d851c267bb0c0c47857629ef3f790215a 965bd32fec803c4ca20157c621ee663dccfaeb29 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9acc2367b16dcf8c281ca9bd35bd25913ab20b4a Log: Merge branch 'PHP-5.4' Changed paths: MM ext/mysqlnd/mysqlnd_wireprotocol.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: read 1 instead of 2 bytes. The next 2 bytes are 2 and thus not a problem: ext/mysqlnd/mysqlnd_wireprotocol.c
Commit:a17559d4224eea0148ad67de9bb1cca22cbef7f6 Author:Andrey Hristov Wed, 31 Oct 2012 18:26:09 +0100 Parents: b3cd64afef4d7c35d8551d34858f98a6286db975 Branches: PHP-5.3 PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a17559d4224eea0148ad67de9bb1cca22cbef7f6 Log: read 1 instead of 2 bytes. The next 2 bytes are 2 and thus not a problem Changed paths: M ext/mysqlnd/mysqlnd_wireprotocol.c Diff: diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 1318c37..ec0ff49 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -982,7 +982,7 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC) p += 2; BAIL_IF_NO_MORE_DATA; - meta->decimals = uint2korr(p); + meta->decimals = uint1korr(p); p += 1; BAIL_IF_NO_MORE_DATA; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd_wireprotocol.c
Commit:965bd32fec803c4ca20157c621ee663dccfaeb29 Author:Andrey Hristov Wed, 31 Oct 2012 18:29:31 +0100 Parents: 7886f46b560c51f235da35a33c8cd0e6479c9360 a17559d4224eea0148ad67de9bb1cca22cbef7f6 Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=965bd32fec803c4ca20157c621ee663dccfaeb29 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqlnd/mysqlnd_wireprotocol.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: cosmetics: ext/mysqlnd/mysqlnd_net.c
Commit:d62bc53a4fb2058a06f356b5779a0db88f6e207c Author:Andrey Hristov Wed, 31 Oct 2012 15:54:45 +0100 Parents: 91ce3764f0f5e5f1564d32bcd622e0b658dba674 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d62bc53a4fb2058a06f356b5779a0db88f6e207c Log: cosmetics Changed paths: M ext/mysqlnd/mysqlnd_net.c Diff: diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index 4f55ddb..b04c4ee 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -527,7 +527,7 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf enum_func_status retval = PASS; zend_uchar * compressed_data = NULL; zend_uchar comp_header[COMPRESSED_HEADER_SIZE]; - DBG_ENTER("mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffe"); + DBG_ENTER("mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffer"); /* Read the compressed header */ if (FAIL == net->data->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) { @@ -631,13 +631,13 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co if (net->data->compressed) { if (net->uncompressed_data) { size_t to_read_from_buffer = MIN(net->uncompressed_data->bytes_left(net->uncompressed_data), to_read); - DBG_INF_FMT("reading %u from uncompressed_data buffer", to_read_from_buffer); + DBG_INF_FMT("reading "MYSQLND_SZ_T_SPEC" from uncompressed_data buffer", to_read_from_buffer); if (to_read_from_buffer) { net->uncompressed_data->read(net->uncompressed_data, to_read_from_buffer, (zend_uchar *) p); p += to_read_from_buffer; to_read -= to_read_from_buffer; } - DBG_INF_FMT("left %u to read", to_read); + DBG_INF_FMT("left "MYSQLND_SZ_T_SPEC" to read", to_read); if (TRUE == net->uncompressed_data->is_empty(net->uncompressed_data)) { /* Everything was consumed. This should never happen here, but for security */ net->uncompressed_data->free_buffer(&net->uncompressed_data TSRMLS_CC); @@ -697,7 +697,7 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys DBG_RETURN(FAIL); } net->cmd_buffer.length = *(unsigned int*) value; - DBG_INF_FMT("new_length=%u", net->cmd_buffer.length); + DBG_INF_FMT("new_length="MYSQLND_SZ_T_SPEC, net->cmd_buffer.length); if (!net->cmd_buffer.buffer) { net->cmd_buffer.buffer = mnd_pemalloc(net->cmd_buffer.length, net->persistent); } else { @@ -707,7 +707,7 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys case MYSQLND_OPT_NET_READ_BUFFER_SIZE: DBG_INF("MYSQLND_OPT_NET_READ_BUFFER_SIZE"); net->data->options.net_read_buffer_size = *(unsigned int*) value; - DBG_INF_FMT("new_length=%u", net->data->options.net_read_buffer_size); + DBG_INF_FMT("new_length="MYSQLND_SZ_T_SPEC, net->data->options.net_read_buffer_size); break; case MYSQL_OPT_CONNECT_TIMEOUT: DBG_INF("MYSQL_OPT_CONNECT_TIMEOUT"); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: plug recent leak: ext/mysqlnd/mysqlnd_net.c
Commit:a0a34f5bcaf1b3d7b567a7d6646cfb1f75156092 Author:Andrey Hristov Wed, 31 Oct 2012 16:13:00 +0100 Parents: f2f380407ac4138a483b43f9649695db36e42c8c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a0a34f5bcaf1b3d7b567a7d6646cfb1f75156092 Log: plug recent leak Changed paths: M ext/mysqlnd/mysqlnd_net.c Diff: diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index b04c4ee..5e9f404 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -978,6 +978,10 @@ MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC) mnd_pefree(net->data->options.ssl_cipher, pers); net->data->options.ssl_cipher = NULL; } + if (net->data->options.sha256_server_public_key) { + mnd_pefree(net->data->options.sha256_server_public_key, pers); + net->data->options.sha256_server_public_key = NULL; + } DBG_VOID_RETURN; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix crashes in newly introduced macros when normal trace is disabled but memory traced is enabled.: ext/mysqlnd/mysqlnd_debug.h
Commit:27e0999843f40efd3c9e725866ffb3a93b22c53f Author:Andrey Hristov Mon, 22 Oct 2012 14:35:35 +0200 Parents: 8219b02579097a1931ad63d4a863d854153fa64f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=27e0999843f40efd3c9e725866ffb3a93b22c53f Log: fix crashes in newly introduced macros when normal trace is disabled but memory traced is enabled. Changed paths: M ext/mysqlnd/mysqlnd_debug.h Diff: diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h index 272cdb2..37fbb80 100644 --- a/ext/mysqlnd/mysqlnd_debug.h +++ b/ext/mysqlnd/mysqlnd_debug.h @@ -96,10 +96,10 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); #define DBG_PROFILE_END_TIME(duration) #endif -#define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) -#define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) -#define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) -#define DBG_ERR_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); } while (0) +#define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE && (dbg_obj)) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) +#define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE && (dbg_obj)) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) +#define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE && (dbg_obj)) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) +#define DBG_ERR_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE && (dbg_obj)) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); } while (0) #define DBG_BLOCK_ENTER_EX(dbg_obj, block_name) DBG_BLOCK_ENTER_EX2((dbg_obj), NULL, (block_name)) #define DBG_BLOCK_LEAVE_EX(dbg_obj) DBG_BLOCK_LEAVE_EX2((dbg_obj)) @@ -124,7 +124,7 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); dbg_skip_trace = !(dbg_obj1)->m->func_enter((dbg_obj1), __LINE__, __FILE__, func_name, strlen(func_name)); \ } \ if ((dbg_obj2)) { \ - dbg_skip_trace = !(dbg_obj2)->m->func_enter((dbg_obj2), __LINE__, __FILE__, func_name, strlen(func_name)); \ + dbg_skip_trace |= !(dbg_obj2)->m->func_enter((dbg_obj2), __LINE__, __FILE__, func_name, strlen(func_name)); \ } \ if (dbg_skip_trace); /* shut compiler's mouth */\ do { \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add protection against core dumps if the underlying library returns 0x0 for some reason: ext/mysqli/mysqli_api.c ext/mysqli/tests/mysqli_class_mysqli_interface.phpt ext/mysqli/t
Commit:967a1ebe5147e3892559f029a95514fd449e0c6a Author:Andrey Hristov Thu, 18 Oct 2012 15:09:17 +0200 Parents: 4eece4c86a74e18b916a4c052eb72c1977732828 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=967a1ebe5147e3892559f029a95514fd449e0c6a Log: add protection against core dumps if the underlying library returns 0x0 for some reason Changed paths: M ext/mysqli/mysqli_api.c M ext/mysqli/tests/mysqli_class_mysqli_interface.phpt M ext/mysqli/tests/mysqli_info.phpt Diff: diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 3940736..1ac9173 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -566,14 +566,17 @@ PHP_FUNCTION(mysqli_character_set_name) { MY_MYSQL*mysql; zval*mysql_link; + const char *cs_name; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); - - RETURN_STRING((char *)mysql_character_set_name(mysql->mysql), 1); + cs_name = mysql_character_set_name(mysql->mysql); + if (cs_name) { + RETURN_STRING(cs_name, 1); + } } /* }}} */ @@ -732,12 +735,16 @@ PHP_FUNCTION(mysqli_error) { MY_MYSQL*mysql; zval*mysql_link; + const char *err; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); - RETURN_STRING((char *)mysql_error(mysql->mysql),1); + err = mysql_error(mysql->mysql); + if (err) { + RETURN_STRING(err, 1); + } } /* }}} */ @@ -1268,7 +1275,10 @@ PHP_FUNCTION(mysqli_free_result) Get MySQL client info */ PHP_FUNCTION(mysqli_get_client_info) { - RETURN_STRING((char *)mysql_get_client_info(), 1); + const char * info = mysql_get_client_info(); + if (info) { + RETURN_STRING(info, 1); + } } /* }}} */ @@ -1320,15 +1330,18 @@ PHP_FUNCTION(mysqli_get_server_info) { MY_MYSQL*mysql; zval*mysql_link = NULL; + const char *info; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); - RETURN_STRING((char *)mysql_get_server_info(mysql->mysql), 1); + info = mysql_get_server_info(mysql->mysql); + if (info) { + RETURN_STRING(info, 1); + } } - /* }}} */ /* {{{ proto int mysqli_get_server_version(object link) @@ -1361,7 +1374,9 @@ PHP_FUNCTION(mysqli_info) MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); info = mysql_info(mysql->mysql); - RETURN_STRING((info) ? (char *)info : "", 1); + if (info) { + RETURN_STRING(info, 1); + } } /* }}} */ @@ -2096,12 +2111,16 @@ PHP_FUNCTION(mysqli_sqlstate) { MY_MYSQL*mysql; zval*mysql_link; + const char *state; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); - RETURN_STRING((char *)mysql_sqlstate(mysql->mysql),1); + state = mysql_sqlstate(mysql->mysql); + if (state) { + RETURN_STRING(state, 1); + } } /* }}} */ @@ -2279,13 +2298,17 @@ PHP_FUNCTION(mysqli_stmt_error) { MY_STMT *stmt; zval*mysql_stmt; + const char * err; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_INITIALIZED); - RETURN_STRING((char *)mysql_stmt_error(stmt->stmt),1); + err = mysql_stmt_error(stmt->stmt); + if (err) { + RETURN_STRING(err, 1); + } } /* }}} */ @@ -2424,13 +2447,17 @@ PHP_FUNCTION(mysqli_stmt_sqlstate) { MY_STMT *stmt; zval*mysql_stmt; + const char * state; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_VALID); - RE
[PHP-CVS] com php-src: fix NEWS: NEWS
Commit:505836e958c9779b1de180197047d9b334d1 Author:Andrey Hristov Wed, 17 Oct 2012 17:56:17 +0200 Parents: 7314ed535f93841ff2d2bca5e65afcb0f2b003bb Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=505836e958c9779b1de180197047d9b334d1 Log: fix NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 9c8c9c2..efb0c2a 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.3.19 +- mysql: + . Fixed compilation failure on mixed 32/64 bit systems. (Andrey) + - PDO: . Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec). (Martin Osvald, Remi) @@ -66,12 +69,13 @@ be added after merge by RM) - CURL: . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick) - -- Intl: - . Fix null pointer dereferences in some classes of ext/intl. (Gustavo) - -- mysql: - . Fixed compilation failure on mixed 32/64 bit systems. (Andrey) + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false). + (r.hampartsum...@gmail.com, Laruence) + + - DateTime: + . Fixed bug #62852 (Unserialize invalid DateTime causes crash). + (reeze@gmail.com) + . Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence) - MySQLnd: . Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix compilation failure on 32/64bit linux systems, when libmysql is used with ext/mysql: NEWS ext/mysql/config.m4
Commit:c50d732f7686352381d44926988aca194204433d Author:Andrey Hristov Wed, 17 Oct 2012 17:22:31 +0200 Parents: e5bdd2c0eeab50dc1f863dae9a32d3857ece6a79 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c50d732f7686352381d44926988aca194204433d Log: fix compilation failure on 32/64bit linux systems, when libmysql is used with ext/mysql Changed paths: M NEWS M ext/mysql/config.m4 Diff: diff --git a/NEWS b/NEWS index 3d156c1..f909817 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,9 @@ PHP NEWS (reeze@gmail.com) . Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence) +- mysql: + . Fixed compilation failure on mixed 32/64 bit systems. (Andrey) + - MySQLnd: . Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence) diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index 2babcee..e7d598f 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -99,6 +99,13 @@ Note that the MySQL client library is not bundled anymore!]) done if test -z "$MYSQL_LIB_DIR"; then +MYSQL_LIB_CHK(lib/x86_64-linux-gnu) + fi + if test -z "$MYSQL_LIB_DIR"; then +MYSQL_LIB_CHK(lib/i386-linux-gnu) + fi + + if test -z "$MYSQL_LIB_DIR"; then AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. Note that the MySQL client library is not bundled anymore!]) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' of ssh://git.php.net/php-src into PHP-5.3: NEWS
Commit:7314ed535f93841ff2d2bca5e65afcb0f2b003bb Author:Andrey Hristov Wed, 17 Oct 2012 17:23:37 +0200 Parents: c50d732f7686352381d44926988aca194204433d da541ff561e0ac6ac72d2efd8b785ecfeef868dc Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7314ed535f93841ff2d2bca5e65afcb0f2b003bb Log: Merge branch 'PHP-5.3' of ssh://git.php.net/php-src into PHP-5.3 Changed paths: MM NEWS Diff: diff --cc NEWS index f909817,fb7f83e..9c8c9c2 --- a/NEWS +++ b/NEWS @@@ -12,19 -66,10 +66,13 @@@ be added after merge by RM - CURL: . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick) - . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false). - (r.hampartsum...@gmail.com, Laruence) - - DateTime: - . Fixed bug #62852 (Unserialize invalid DateTime causes crash). - (reeze@gmail.com) - . Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence) + - Intl: + . Fix null pointer dereferences in some classes of ext/intl. (Gustavo) +- mysql: + . Fixed compilation failure on mixed 32/64 bit systems. (Andrey) + - MySQLnd: . Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix build with libmysql on Ubuntu 12.04 x64 probably other mixed 32/64 systems: ext/mysql/config.m4
Commit:d62702851ca7012cf4b635e6379cb4de383dc7ac Author:Andrey Hristov Wed, 17 Oct 2012 16:35:36 +0200 Parents: 54cbf5315c11172eeba9231d0f0f7f3174dee210 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d62702851ca7012cf4b635e6379cb4de383dc7ac Log: fix build with libmysql on Ubuntu 12.04 x64 probably other mixed 32/64 systems Changed paths: M ext/mysql/config.m4 Diff: diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index fa7a46f..5968c43 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -97,6 +97,13 @@ Note that the MySQL client library is not bundled anymore!]) done if test -z "$MYSQL_LIB_DIR"; then +MYSQL_LIB_CHK(lib/x86_64-linux-gnu) + fi + if test -z "$MYSQL_LIB_DIR"; then +MYSQL_LIB_CHK(lib/i386-linux-gnu) + fi + + if test -z "$MYSQL_LIB_DIR"; then AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. Note that the MySQL client library is not bundled anymore!]) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix newly introduced segfault: ext/mysqlnd/mysqlnd_auth.c
Commit:b0e8fb6489f7aa65aeaae6198a3dd81574f1ebcd Author:Andrey Hristov Tue, 16 Oct 2012 15:06:02 +0200 Parents: ccf749e38d1c05ab50d30781b47e55786d571585 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b0e8fb6489f7aa65aeaae6198a3dd81574f1ebcd Log: fix newly introduced segfault Changed paths: M ext/mysqlnd/mysqlnd_auth.c Diff: diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 3cae693..cdbdf6d 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -555,8 +555,8 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, DBG_INF_FMT("Public key:%*.s", len, key_str); efree(key_str); } + php_stream_free(stream, PHP_STREAM_FREE_CLOSE); } - php_stream_free(stream, PHP_STREAM_FREE_CLOSE); } DBG_RETURN(ret); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test: ext/mysqli/tests/mysqli_constants.phpt
Commit:6fbcf693750d682b223660d3299a0b6864915acc Author:Andrey Hristov Fri, 12 Oct 2012 10:35:45 +0200 Parents: 0f3fb08a8dac2d39b6923bc23d6cfc71eac6fa9e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6fbcf693750d682b223660d3299a0b6864915acc Log: fix test Changed paths: M ext/mysqli/tests/mysqli_constants.phpt Diff: diff --git a/ext/mysqli/tests/mysqli_constants.phpt b/ext/mysqli/tests/mysqli_constants.phpt index 613dddf..0f87187 100644 --- a/ext/mysqli/tests/mysqli_constants.phpt +++ b/ext/mysqli/tests/mysqli_constants.phpt @@ -125,6 +125,12 @@ require_once('skipifconnectfailure.inc'); $expected_constants['MYSQLI_SERVER_QUERY_WAS_SLOW'] = true; } + + /* First introduced in MySQL 6.0, backported to MySQL 5.5 */ + if ($version >= 50606 || $IS_MYSQLND) { + $expected_constants['MYSQLI_SERVER_PUBLIC_KEY'] = true; + } + if ($version > 50002) { $expected_constants = array_merge($expected_constants, array( "MYSQLI_TYPE_NEWDECIMAL"=> true, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: constify: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_auth.c ext/mysqlnd/mysqlnd_structs.h
Commit:225792c5db2306727710d232effb86a3abf09feb Author:Andrey Hristov Fri, 12 Oct 2012 10:20:09 +0200 Parents: 7a7b2a06420138d0e0f18a898cb36d007196a922 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=225792c5db2306727710d232effb86a3abf09feb Log: constify Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_auth.c M ext/mysqlnd/mysqlnd_structs.h Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index f5fe075..ad91212 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1924,7 +1924,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * co /* {{{ mysqlnd_conn_data::get_state */ static enum mysqlnd_connection_state -MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(MYSQLND_CONN_DATA * const conn TSRMLS_DC) +MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC) { DBG_ENTER("mysqlnd_conn_data::get_state"); DBG_RETURN(conn->state); diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index f2c5adc..3cae693 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -581,6 +581,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self if (conn->net->data->ssl) { + DBG_INF("simple clear text under SSL"); /* clear text under SSL */ *auth_data_len = passwd_len; ret = malloc(passwd_len); diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 7f512b7..28def72 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -463,7 +463,7 @@ typedef enum_func_status (*func_mysqlnd_conn_data__query_read_result_set_header) typedef MYSQLND_CONN_DATA * (*func_mysqlnd_conn_data__get_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_conn_data__free_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC); -typedef enum mysqlnd_connection_state (*func_mysqlnd_conn_data__get_state)(MYSQLND_CONN_DATA * const conn TSRMLS_DC); +typedef enum mysqlnd_connection_state (*func_mysqlnd_conn_data__get_state)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC); typedef void (*func_mysqlnd_conn_data__set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_conn_data__simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: update: NEWS UPGRADING
Commit:713a3fc58c12fae381c1e2fa81cd70ac05d4e86c Author:Andrey Hristov Thu, 4 Oct 2012 13:40:23 +0200 Parents: 61bee020e1fabc7ac8915025bff5e7b773382156 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=713a3fc58c12fae381c1e2fa81cd70ac05d4e86c Log: update Changed paths: M NEWS M UPGRADING Diff: diff --git a/NEWS b/NEWS index 00a2dd6..41ab1bb 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,8 @@ PHP NEWS - MySQLi . Dropped support for LOAD DATA LOCAL INFILE handlers when using libmysql. Known for stability problems. (Andrey) + . Added support for SHA256 authentication available with MySQL 5.6.6+. (Andrey) + - PCRE: . Deprecated the /e modifier diff --git a/UPGRADING b/UPGRADING index bc5773c..0e497f7 100755 --- a/UPGRADING +++ b/UPGRADING @@ -236,11 +236,16 @@ PHP X.Y UPGRADE NOTES 9. New Global Constants - +- mysqli + - Added MYSQLI_SERVER_PUBLIC_KEY constant to be used with mysqli_options() 10. Changes to INI File Handling +- mysqlnd + - Added mysqlnd.sha256_server_public_key INI PERDIR setting that affects all +APIs which use(are built) for mysqlnd. This allows ext/mysqli to be used + with the new auth protocol, although at coarser level. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add a check for libmysql: ext/mysqli/mysqli.c ext/mysqli/mysqli_api.c
Commit:06dfb96bf5a532e2af4a714f60b48a6874b9637a Author:Andrey Hristov Wed, 3 Oct 2012 14:14:59 +0200 Parents: 3262de2f62b9bca20e0d977e77df19bbf0e5bf78 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=06dfb96bf5a532e2af4a714f60b48a6874b9637a Log: add a check for libmysql Changed paths: M ext/mysqli/mysqli.c M ext/mysqli/mysqli_api.c Diff: diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 9eaac24..81bae23 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -699,7 +699,9 @@ PHP_MINIT_FUNCTION(mysqli) REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT); #endif +#if MYSQL_VERSION_ID > 50605 || defined(MYSQLI_USE_MYSQLND) REGISTER_LONG_CONSTANT("MYSQLI_SERVER_PUBLIC_KEY", MYSQL_SERVER_PUBLIC_KEY, CONST_CS | CONST_PERSISTENT); +#endif /* mysqli_real_connect flags */ REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_SSL", CLIENT_SSL, CONST_CS | CONST_PERSISTENT); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index dbdda9b..3940736 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1627,7 +1627,9 @@ static int mysqli_options_get_option_zval_type(int option) case MYSQL_INIT_COMMAND: case MYSQL_SET_CHARSET_NAME: case MYSQL_SET_CHARSET_DIR: +#if MYSQL_VERSION_ID > 50605 || defined(MYSQLI_USE_MYSQLND) case MYSQL_SERVER_PUBLIC_KEY: +#endif return IS_STRING; default: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: if ssl has been switched on transmit clear-text password: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_auth.c ext/mysqlnd/mysqlnd_net.c ext/mysqlnd/mysqlnd_structs.h
Commit:4c9e222f99731a851e20c6c0972246d079719095 Author:Andrey Hristov Wed, 3 Oct 2012 14:02:33 +0200 Parents: 5a385487c2dbf6a49b0edb140f9cb33c1f7299a1 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c9e222f99731a851e20c6c0972246d079719095 Log: if ssl has been switched on transmit clear-text password Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_auth.c M ext/mysqlnd/mysqlnd_net.c M ext/mysqlnd/mysqlnd_structs.h Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 557924c..f5fe075 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -874,6 +874,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, saved_compression = TRUE; net->data->compressed = FALSE; } + if (net->data->ssl) { + net->data->ssl = FALSE; + } } else { unsigned int max_allowed_size = MYSQLND_ASSEMBLED_PACKET_MAX_SIZE; conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size TSRMLS_CC); diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 72b2532..f2c5adc 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -579,33 +579,40 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self DBG_ENTER("mysqlnd_sha256_auth_get_auth_data"); DBG_INF_FMT("salt(%d)=[%.*s]", auth_plugin_data_len, auth_plugin_data_len, auth_plugin_data); - *auth_data_len = 0; - - server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options TSRMLS_CC); - if (server_public_key) { - int server_public_key_len; - char xor_str[passwd_len + 1]; - memcpy(xor_str, passwd, passwd_len); - xor_str[passwd_len] = '\0'; - mysqlnd_xor_string(xor_str, passwd_len, (char *) auth_plugin_data, auth_plugin_data_len); + if (conn->net->data->ssl) { + /* clear text under SSL */ + *auth_data_len = passwd_len; + ret = malloc(passwd_len); + memcpy(ret, passwd, passwd_len); + } else { + *auth_data_len = 0; + server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options TSRMLS_CC); + + if (server_public_key) { + int server_public_key_len; + char xor_str[passwd_len + 1]; + memcpy(xor_str, passwd, passwd_len); + xor_str[passwd_len] = '\0'; + mysqlnd_xor_string(xor_str, passwd_len, (char *) auth_plugin_data, auth_plugin_data_len); + + server_public_key_len = RSA_size(server_public_key); + /* + Because RSA_PKCS1_OAEP_PADDING is used there is a restriction on the passwd_len. + RSA_PKCS1_OAEP_PADDING is recommended for new applications. See more here: + http://www.openssl.org/docs/crypto/RSA_public_encrypt.html + */ + if ((size_t) server_public_key_len - 41 <= passwd_len) { + /* password message is to long */ + SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "password is too long"); + DBG_ERR("password is too long"); + DBG_RETURN(NULL); + } - server_public_key_len = RSA_size(server_public_key); - /* - Because RSA_PKCS1_OAEP_PADDING is used there is a restriction on the passwd_len. - RSA_PKCS1_OAEP_PADDING is recommended for new applications. See more here: - http://www.openssl.org/docs/crypto/RSA_public_encrypt.html - */ - if ((size_t) server_public_key_len - 41 <= passwd_len) { - /* password message is to long */ - SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "password is too long"); - DBG_ERR("password is too long"); - DBG_RETURN(NULL); + *auth_data_len = server_public_key_len; + ret = malloc(*auth_data_len); + RSA_public_encrypt(passwd_len + 1, (zend_uchar *) xor_str, ret, server_public_key, RSA_PKCS1_OAEP_PADDING); } - - *auth_data_len = server_public_key_len; - ret = malloc(*auth_data_len); - RSA_public_encrypt(passwd_len + 1, (zend_uchar *) xor_str, ret, server_public_key,
[PHP-CVS] com php-src: fix login failure with empty password. This is 5.5 specific - new code: ext/mysqlnd/mysqlnd.c
Commit:c540fe2064d23e7e9de665f12d5452ce914991ff Author:Andrey Hristov Fri, 28 Sep 2012 11:58:41 +0200 Parents: da96aa848fc4845399d4d7a7c396fa31ffb9ffba Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c540fe2064d23e7e9de665f12d5452ce914991ff Log: fix login failure with empty password. This is 5.5 specific - new code Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 3fa9d11..557924c 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -582,8 +582,8 @@ mysqlnd_run_authentication( scrambled_data = auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len, 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 (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, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: compile out example plugin in a release build: ext/mysqlnd/mysqlnd_auth.c ext/mysqlnd/mysqlnd_driver.c ext/mysqlnd/mysqlnd_plugin.c
Commit:da96aa848fc4845399d4d7a7c396fa31ffb9ffba Author:andrey Wed, 26 Sep 2012 17:13:46 +0200 Parents: 263b37bee1ea92e30791b15af710b509da4b8ca8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=da96aa848fc4845399d4d7a7c396fa31ffb9ffba Log: compile out example plugin in a release build Changed paths: M ext/mysqlnd/mysqlnd_auth.c M ext/mysqlnd/mysqlnd_driver.c M ext/mysqlnd/mysqlnd_plugin.c Diff: diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index ce03be4..72b2532 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -558,7 +558,7 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, } php_stream_free(stream, PHP_STREAM_FREE_CLOSE); } - DBG_RETURN(ret) + DBG_RETURN(ret); } /* }}} */ diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c index e55a0bc..93f3d3f 100644 --- a/ext/mysqlnd/mysqlnd_driver.c +++ b/ext/mysqlnd/mysqlnd_driver.c @@ -81,7 +81,9 @@ PHPAPI void mysqlnd_library_init(TSRMLS_D) mysqlnd_plugin_core.plugin_header.plugin_stats.values = mysqlnd_global_stats; mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core TSRMLS_CC); } +#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 mysqlnd_example_plugin_register(TSRMLS_C); +#endif mysqlnd_debug_trace_plugin_register(TSRMLS_C); mysqlnd_register_builtin_authentication_plugins(TSRMLS_C); diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c index 2dbb57d..61ab197 100644 --- a/ext/mysqlnd/mysqlnd_plugin.c +++ b/ext/mysqlnd/mysqlnd_plugin.c @@ -26,7 +26,7 @@ #include "mysqlnd_debug.h" /**/ - +#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 static enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC); static MYSQLND_STATS * mysqlnd_plugin_example_stats = NULL; @@ -87,7 +87,7 @@ mysqlnd_example_plugin_register(TSRMLS_D) mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin TSRMLS_CC); } /* }}} */ - +#endif /* defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 */ /**/ static HashTable mysqlnd_registered_plugins; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: change public key setting to PERDIR and finish code that allows to set the key file programatically per mysqli_options(): ext/mysqli/mysqli.c ext/mysqli/mysqli_api.c ext/mysqlnd
Commit:263b37bee1ea92e30791b15af710b509da4b8ca8 Author:andrey Tue, 25 Sep 2012 18:26:02 +0200 Parents: 6074df91c6ab80a1fae7c7e8ff5be1c1db342af0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=263b37bee1ea92e30791b15af710b509da4b8ca8 Log: change public key setting to PERDIR and finish code that allows to set the key file programatically per mysqli_options() Changed paths: M ext/mysqli/mysqli.c M ext/mysqli/mysqli_api.c M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_auth.c M ext/mysqlnd/mysqlnd_net.c M ext/mysqlnd/php_mysqlnd.c Diff: diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 0e7e048..9eaac24 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -699,6 +699,8 @@ PHP_MINIT_FUNCTION(mysqli) REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT); #endif + REGISTER_LONG_CONSTANT("MYSQLI_SERVER_PUBLIC_KEY", MYSQL_SERVER_PUBLIC_KEY, CONST_CS | CONST_PERSISTENT); + /* mysqli_real_connect flags */ REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_SSL", CLIENT_SSL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_COMPRESS",CLIENT_COMPRESS, CONST_CS | CONST_PERSISTENT); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 22eae7e..dbdda9b 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1587,10 +1587,10 @@ static int mysqli_options_get_option_zval_type(int option) #endif /* MYSQLI_USE_MYSQLND */ case MYSQL_OPT_CONNECT_TIMEOUT: #ifdef MYSQL_REPORT_DATA_TRUNCATION -case MYSQL_REPORT_DATA_TRUNCATION: + case MYSQL_REPORT_DATA_TRUNCATION: #endif -case MYSQL_OPT_LOCAL_INFILE: -case MYSQL_OPT_NAMED_PIPE: + case MYSQL_OPT_LOCAL_INFILE: + case MYSQL_OPT_NAMED_PIPE: #ifdef MYSQL_OPT_PROTOCOL case MYSQL_OPT_PROTOCOL: #endif /* MySQL 4.1.0 */ @@ -1606,7 +1606,7 @@ static int mysqli_options_get_option_zval_type(int option) case MYSQL_OPT_RECONNECT: #endif /* MySQL 5.0.13 */ #ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT -case MYSQL_OPT_SSL_VERIFY_SERVER_CERT: + case MYSQL_OPT_SSL_VERIFY_SERVER_CERT: #endif /* MySQL 5.0.23 */ #ifdef MYSQL_OPT_COMPRESS case MYSQL_OPT_COMPRESS: @@ -1627,6 +1627,7 @@ static int mysqli_options_get_option_zval_type(int option) case MYSQL_INIT_COMMAND: case MYSQL_SET_CHARSET_NAME: case MYSQL_SET_CHARSET_DIR: + case MYSQL_SERVER_PUBLIC_KEY: return IS_STRING; default: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 65f6a18..3fa9d11 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2270,6 +2270,7 @@ 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; #ifdef MYSQLND_STRING_TO_INT_CONVERSION diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index d4373cf..ce03be4 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -488,7 +488,9 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, MYSQLND_G(sha256_server_public_key); php_stream * stream; DBG_ENTER("mysqlnd_sha256_get_rsa_key"); - + DBG_INF_FMT("options_s256_pk=[%s] MYSQLND_G(sha256_server_public_key)=[%s]", +net_options->sha256_server_public_key? net_options->sha256_server_public_key:"n/a", +MYSQLND_G(sha256_server_public_key)? MYSQLND_G(sha256_server_public_key):"n/a"); if (!fname || fname[0] == '\0') { MYSQLND_PACKET_SHA256_PK_REQUEST * pk_req_packet = NULL; MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * pk_resp_packet = NULL; @@ -539,6 +541,7 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, DBG_RETURN(NULL); } else { char * key_str = NULL; + DBG_INF_FMT("Key in a file. [%s]", fname); stream = php_stream_open_wrapper((char *) fname, "rb", REPORT_ERRORS, NULL); if (stream) { @@ -546,6 +549,7 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, BIO * bio = BIO_new_mem_buf(key_str, len); ret = PEM_read_bio_RSA_PUBKEY(bio, NULL, NULL, NULL); BIO_free(bio); + DBG_INF("Succe
[PHP-CVS] com php-src: Add SHA256 authentication support - password hashing to mysqlnd Automatic switchover to SSL with plain-text password is not part of this: ext/mysqli/mysqli_nonapi.c ext/mysqlnd/
ount > max_set_count) { max_set_count = set_count; diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 30d4257..b0db48f 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -277,6 +277,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) longdebug_malloc_fail_threshold; longdebug_calloc_fail_threshold; longdebug_realloc_fail_threshold; + char * sha256_server_public_key; ZEND_END_MODULE_GLOBALS(mysqlnd) PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd) diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 10c932a..295b6a3 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -360,7 +360,9 @@ mysqlnd_native_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, - const MYSQLND_OPTIONS * const options, unsigned long mysql_flags + const MYSQLND_OPTIONS * const options, + const MYSQLND_NET_OPTIONS * const net_options, + unsigned long mysql_flags TSRMLS_DC) { zend_uchar * ret = NULL; @@ -418,7 +420,9 @@ mysqlnd_pam_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self, size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, - const MYSQLND_OPTIONS * const options, unsigned long mysql_flags + const MYSQLND_OPTIONS * const options, + const MYSQLND_NET_OPTIONS * const net_options, + unsigned long mysql_flags TSRMLS_DC) { zend_uchar * ret = NULL; @@ -442,7 +446,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_pam_authentication_plugin MYSQLND_VERSION_ID, MYSQLND_VERSION, "PHP License 3.01", - "Andrey Hristov , Ulf Wendel , Georg Richter ", + "Andrey Hristov , Ulf Wendel , Georg Richter ", { NULL, /* no statistics , will be filled later if there are some */ NULL, /* no statistics */ @@ -457,12 +461,190 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_pam_authentication_plugin }; +/*** SHA256 Password ***/ +#ifdef MYSQLND_HAVE_SSL +static void +mysqlnd_xor_string(char * dst, const size_t dst_len, const char * xor_str, const size_t xor_str_len) +{ + unsigned int i; + for (i = 0; i <= dst_len; ++i) { + dst[i] ^= xor_str[i % xor_str_len]; + } +} + + +#include +#include +#include + + +/* {{{ mysqlnd_sha256_get_rsa_key */ +static RSA * +mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn, + const MYSQLND_OPTIONS * const options, + const MYSQLND_NET_OPTIONS * const net_options + TSRMLS_DC) +{ + RSA * ret = NULL; + int len; + const char * fname = (net_options->sha256_server_public_key && net_options->sha256_server_public_key[0] != '\0')? + net_options->sha256_server_public_key: + MYSQLND_G(sha256_server_public_key); + php_stream * stream; + DBG_ENTER("mysqlnd_sha256_get_rsa_key"); + + if (!fname || fname[0] == '\0') { + MYSQLND_PACKET_SHA256_PK_REQUEST * pk_req_packet = NULL; + MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * pk_resp_packet = NULL; + + do { + D
[PHP-CVS] com php-src: plug a leak when the server ask the client for a auth protocol, that the client doesn't understand. This is 5.5 specific bug, as a result of a refactoring in 5.5: ext/mysqlnd/my
Commit:815874c646468f73d4bba3619543ab047873b5e7 Author:andrey Wed, 22 Aug 2012 20:04:42 +0200 Parents: a90170e6f803f283d6c8e4e8d6b7bd8b7bd011a4 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=815874c646468f73d4bba3619543ab047873b5e7 Log: plug a leak when the server ask the client for a auth protocol, that the client doesn't understand. This is 5.5 specific bug, as a result of a refactoring in 5.5 Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 9a907a5..d7462f7 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -622,19 +622,19 @@ mysqlnd_run_authentication( } DBG_INF_FMT("conn->error_info->error_no = %d", conn->error_info->error_no); } while (ret == FAIL && conn->error_info->error_no == 0 && switch_to_auth_protocol != NULL); - if (plugin_data) { - mnd_efree(plugin_data); - } if (ret == PASS) { DBG_INF_FMT("saving requested_protocol=%s", requested_protocol); conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC); } - +end: + if (plugin_data) { + mnd_efree(plugin_data); + } if (requested_protocol) { mnd_efree(requested_protocol); } -end: + DBG_RETURN(ret); } /* }}} */ @@ -838,6 +838,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, MYSQLND_NET * net = conn->net; DBG_ENTER("mysqlnd_conn_data::connect"); + DBG_INF_FMT("conn=%p", conn); if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { goto err; @@ -1149,7 +1150,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, query); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::query"); - DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); + DBG_INF_FMT("conn=%p conn=%llu query=%s", conn, conn->thread_id, query); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { if (PASS == conn->m->send_query(conn, query, query_len TSRMLS_CC) && @@ -1883,10 +1884,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR Fall-through */ CONN_SET_STATE(conn, CONN_QUIT_SENT); - net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC); /* Fall-through */ case CONN_QUIT_SENT: /* The user has killed its own connection */ + net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC); break; } @@ -2446,7 +2447,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn T MYSQLND_RES * result = NULL; DBG_ENTER("mysqlnd_conn_data::store_result"); - DBG_INF_FMT("conn=%llu", conn->thread_id); + DBG_INF_FMT("conn=%llu conn=%p", conn->thread_id, conn); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { do { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix crashes with filenames that don't contain directory separator - generated files like scanners/parsers.: ext/mysqlnd/mysqlnd_alloc.c
Commit:79c6c93e0d7ed360e8b1f0209c5f3e10692309ac Author:andrey Mon, 30 Jul 2012 21:50:13 +0300 Parents: 06e06f026d14e7d61f2ceb14445a683abbbf91bb Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=79c6c93e0d7ed360e8b1f0209c5f3e10692309ac Log: Fix crashes with filenames that don't contain directory separator - generated files like scanners/parsers. Changed paths: M ext/mysqlnd/mysqlnd_alloc.c diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 65423e4..e681d33 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -81,9 +81,11 @@ void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold); #endif + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_emalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", + (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); #if PHP_DEBUG /* -1 is also "true" */ @@ -116,9 +118,10 @@ void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold); #endif + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name); TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", - strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno,persistent); + (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno, persistent); #if PHP_DEBUG /* -1 is also "true" */ @@ -154,8 +157,10 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold); #endif + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", + (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); #if PHP_DEBUG @@ -189,9 +194,10 @@ void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent M #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold); #endif + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name); TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", - strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno, persistent); + (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno, persistent); #if PHP_DEBUG /* -1 is also "true" */ @@ -228,8 +234,10 @@ void * _mysqlnd_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold); #endif + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_erealloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", + (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size); #if PHP_DEBUG @@ -263,8 +271,10 @@ void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQL #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold); #endif + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_perealloc_name); - TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", + (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn + 1:__zend_orig_filename, __zend_orig_lineno); TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent); #if PHP_DEBUG @@ -297,8 +307,10 @@ void _mysqlnd_efree(void *ptr MYSQLND_MEM_D) { size_t free_amount = 0; zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); + char * fn = NULL; TRACE_ALLOC_ENTER(mysqlnd_efree_name); - TRACE
[PHP-CVS] com php-src: fix valgrind warning: ext/mysqlnd/mysqlnd.c
Commit:049abdfb2635f4f05bb4c51eccc246ffcdfa0dfe Author:andrey Mon, 9 Jul 2012 18:13:35 +0300 Parents: f76bb148146b3669c8949e92eb7601f14359b494 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=049abdfb2635f4f05bb4c51eccc246ffcdfa0dfe Log: fix valgrind warning Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 417ff5e..9a907a5 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -581,7 +581,7 @@ 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=[%*.s]", plugin_data_len - 1, 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, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix valgrind warning: ext/mysqlnd/mysqlnd.c
Commit:555db7dc4ecaffdbfb4a10f4d00ddd81c0f89ef6 Author:andrey Mon, 9 Jul 2012 17:59:23 +0300 Parents: ed1f058591778103ea852324ad6cd847a10b2911 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=555db7dc4ecaffdbfb4a10f4d00ddd81c0f89ef6 Log: fix valgrind warning Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 4a63681..900f820 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2184,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 = -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd.c
Commit:b7dbcbd41f286846ffb1b3aeba537e600b1c34e4 Author:andrey Fri, 29 Jun 2012 14:48:37 +0300 Parents: a614f8edea0b5bbdfc8f57e6a3c58dce167d1517 8fe87e7feaab2c031998d553585ba8cabf077499 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b7dbcbd41f286846ffb1b3aeba537e600b1c34e4 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqlnd/mysqlnd.c Diff: diff --cc ext/mysqlnd/mysqlnd.c index 797cadd,b539c51..81ecd33 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@@ -764,7 -680,15 +764,14 @@@ MYSQLND_METHOD(mysqlnd_conn_data, conne 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 |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS; mysql_flags |= MYSQLND_CAPABILITIES; if (db) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: merge: ext/mysqlnd/mysqlnd.c
Commit:c51fbbe4b4e2c047d1be76d8bffc6391203adbdd Author:andrey Fri, 29 Jun 2012 16:58:53 +0300 Parents: 2abf2738f4f5b271b6a2dff3bcb767ac292c40f7 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c51fbbe4b4e2c047d1be76d8bffc6391203adbdd Log: merge Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index cc3a391..417ff5e 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -789,6 +789,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(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; + } if (FAIL == mysqlnd_connect_run_authentication(conn, user, passwd, db, db_len, (size_t) passwd_len, greet_packet, conn->options, mysql_flags TSRMLS_CC)) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix Bug #62273 Segmentation Fault in Mysqli/Mysqlnd: ext/mysqlnd/mysqlnd.c
Commit:8fe87e7feaab2c031998d553585ba8cabf077499 Author:andrey Fri, 29 Jun 2012 14:42:36 +0300 Parents: 1ac611f24f03728e4d9cd717e83331e2e17184d2 Branches: PHP-5.3 PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8fe87e7feaab2c031998d553585ba8cabf077499 Log: fix Bug #62273 Segmentation Fault in Mysqli/Mysqlnd Bugs: https://bugs.php.net/62273 Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index cc2dd06..b539c51 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -680,6 +680,13 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * 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 |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS; mysql_flags |= MYSQLND_CAPABILITIES; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: merge: ext/mysqlnd/mysqlnd.c
Commit:ed1f058591778103ea852324ad6cd847a10b2911 Author:andrey Fri, 29 Jun 2012 16:32:55 +0300 Parents: b7dbcbd41f286846ffb1b3aeba537e600b1c34e4 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ed1f058591778103ea852324ad6cd847a10b2911 Log: merge Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 81ecd33..4a63681 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -767,7 +767,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, 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, + 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; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: new charsets: ext/mysqlnd/mysqlnd_charset.c
Commit:f826ea093f8317dda2e5476db128dc5ad3eba442 Author:andrey Fri, 29 Jun 2012 12:42:54 +0300 Parents: 4662151ea7d7b6920d115cf2a2d6e9d4232727a3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f826ea093f8317dda2e5476db128dc5ad3eba442 Log: new charsets Changed paths: M ext/mysqlnd/mysqlnd_charset.c diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index 5b60711..704c119 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -449,20 +449,27 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 6, "hp8", "hp8_english_ci", 1, 1, "", NULL, NULL}, { 7, "koi8r", "koi8r_general_ci", 1, 1, "", NULL, NULL}, { 8, "latin1", "latin1_swedish_ci", 1, 1, "", NULL, NULL}, + { 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, /* should be after 0x9 because swedish_ci is the default collation */ { 9, "latin2", "latin2_general_ci", 1, 1, "", NULL, NULL}, + { 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, /* should be after 0x9 because general_ci is the default collation */ { 10, "swe7", "swe7_swedish_ci", 1, 1, "", NULL, NULL}, { 11, "ascii", "ascii_general_ci", 1, 1, "", NULL, NULL}, { 12, "ujis", "ujis_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis}, { 13, "sjis", "sjis_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_sjis, check_mb_sjis}, { 16, "hebrew", "hebrew_general_ci", 1, 1, "", NULL, NULL}, + { 17, "filename", "filename", 1, 5, "", NULL, NULL}, { 18, "tis620", "tis620_thai_ci", 1, 1, "", NULL, NULL}, { 19, "euckr", "euckr_korean_ci", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr}, + { 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL}, + { 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL}, { 22, "koi8u", "koi8u_general_ci", 1, 1, "", NULL, NULL}, { 24, "gb2312", "gb2312_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gb2312, check_mb_gb2312}, { 25, "greek", "greek_general_ci", 1, 1, "", NULL, NULL}, { 26, "cp1250", "cp1250_general_ci", 1, 1, "", NULL, NULL}, { 28, "gbk", "gbk_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gbk, check_mb_gbk}, { 30, "latin5", "latin5_turkish_ci", 1, 1, "", NULL, NULL}, + { 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL}, + { 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL}, { 32, "armscii8", "armscii8_general_ci", 1, 1, "", NULL, NULL}, { 33, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 35, "ucs2", "ucs2_general_ci", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, @@ -472,22 +479,11 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 39, "macroman", "macroman_general_ci", 1, 1, "", NULL, NULL}, { 40, "cp852", "cp852_general_ci", 1, 1, "", NULL, NULL}, { 41, "latin7", "latin7_general_ci", 1, 1, "", NULL, NULL}, - { 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL}, + { 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL}, { 57, "cp1256", "cp1256_general_ci", 1, 1, "", NULL, NULL}, { 59, "cp1257", "cp1257_general_ci", 1, 1, "", NULL, NULL}, { 63, "binary", "binary", 1, 1, "", NULL, NULL}, - { 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL}, - { 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, { 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, - { 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, - { 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, - { 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL}, - { 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL}, - { 17, "filename", "filename", 1, 5, "", NULL, NULL}, - { 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL}, - { 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL}, - { 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL}, - { 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL}, { 29, "cp1257", "cp1257_lithunian_ci", 1, 1, "", NULL, NULL}, { 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL}, { 34, "cp1250", "cp1250_czech_cs", 1, 1, "", NULL, NULL}, @@ -499,6 +495,9 @@ const MYSQLND_CHARSET mysqlnd_charsets[] = { 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL}, { 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL}, { 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL}, + { 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL}, + { 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL}, + { 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL}, { 50, "
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd_charset.c
Commit:08f4b3c3acf1d3264f8c2f67533bf5c27910644f Author:andrey Fri, 29 Jun 2012 12:43:14 +0300 Parents: d372b33c9b941be9a795bf3705bd22dc5f6092c3 f826ea093f8317dda2e5476db128dc5ad3eba442 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=08f4b3c3acf1d3264f8c2f67533bf5c27910644f Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqlnd/mysqlnd_charset.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: trace allocations in a file: ext/mysqlnd/mysqlnd.h ext/mysqlnd/mysqlnd_alloc.c ext/mysqlnd/mysqlnd_debug.c ext/mysqlnd/mysqlnd_debug.h ext/mysqlnd/php_mysqlnd.c
Commit:6e648e934052c784eeb7ee3784aea0cf52bf4898 Author:andrey Wed, 27 Jun 2012 16:51:07 +0300 Parents: a027ba3afe8b6f5144f928f510d9af8ffe10a532 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6e648e934052c784eeb7ee3784aea0cf52bf4898 Log: trace allocations in a file Changed paths: M ext/mysqlnd/mysqlnd.h M ext/mysqlnd/mysqlnd_alloc.c M ext/mysqlnd/mysqlnd_debug.c M ext/mysqlnd/mysqlnd_debug.h M ext/mysqlnd/php_mysqlnd.c diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 8cf..30d4257 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -262,8 +262,10 @@ PHPAPI void _mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_L ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) zend_bool collect_statistics; zend_bool collect_memory_statistics; - char* debug; /* The actual string */ - MYSQLND_DEBUG *dbg; /* The DBG object */ + char * debug; /* The actual string */ + char * trace_alloc_settings; /* The actual string */ + MYSQLND_DEBUG * dbg;/* The DBG object for standard tracing */ + MYSQLND_DEBUG * trace_alloc;/* The DBG object for allocation tracing */ longnet_cmd_buffer_size; longnet_read_buffer_size; longlog_mask; diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index f156137..65423e4 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -81,9 +81,9 @@ void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold); #endif - DBG_ENTER(mysqlnd_emalloc_name); + TRACE_ALLOC_ENTER(mysqlnd_emalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); #if PHP_DEBUG /* -1 is also "true" */ @@ -97,13 +97,13 @@ void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D) } #endif - DBG_INF_FMT("size=%lu ptr=%p", size, ret); + TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret); if (ret && collect_memory_statistics) { *(size_t *) ret = size; MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_EMALLOC_COUNT, 1, STAT_MEM_EMALLOC_AMOUNT, size); } - DBG_RETURN(FAKE_PTR(ret)); + TRACE_ALLOC_RETURN(FAKE_PTR(ret)); } /* }}} */ @@ -116,8 +116,9 @@ void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = persistent? &MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold); #endif - DBG_ENTER(mysqlnd_pemalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4dpersistent=%u", + strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno,persistent); #if PHP_DEBUG /* -1 is also "true" */ @@ -131,7 +132,7 @@ void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) } #endif - DBG_INF_FMT("size=%lu ptr=%p persistent=%u", size, ret, persistent); + TRACE_ALLOC_INF_FMT("size=%lu ptr=%p persistent=%u", size, ret, persistent); if (ret && collect_memory_statistics) { enum mysqlnd_collected_stats s1 = persistent? STAT_MEM_MALLOC_COUNT:STAT_MEM_EMALLOC_COUNT; @@ -140,7 +141,7 @@ void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(s1, 1, s2, size); } - DBG_RETURN(FAKE_PTR(ret)); + TRACE_ALLOC_RETURN(FAKE_PTR(ret)); } /* }}} */ @@ -153,9 +154,9 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) #if PHP_DEBUG long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold); #endif - DBG_ENTER(mysqlnd_ecalloc_name); - DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); - DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); + TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name); + TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR) + 1, __zend_orig_lineno); + TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC)); #if PHP_DEBUG /* -1 is also "true" */ @@ -169,13 +170,13 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) } #endif - DBG_INF_FMT("after : %lu", zend_memory_
[PHP-CVS] com php-src: close the underlying stream as early as possible and so notify the NET layer: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_net.c
Commit:2c230fb574fb2b3e17a74b6678ab36b6572a3c7a Author:andrey Fri, 1 Jun 2012 22:12:08 +0300 Parents: ad60e181d6829c740abc5cf0c2bd283e77484f18 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2c230fb574fb2b3e17a74b6678ab36b6572a3c7a Log: close the underlying stream as early as possible and so notify the NET layer Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_net.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 705dac3..cc3a391 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1849,8 +1849,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR DBG_INF("Connection clean, sending COM_QUIT"); if (net_stream) { ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE TSRMLS_CC); + net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC); } - /* Do nothing */ + CONN_SET_STATE(conn, CONN_QUIT_SENT); break; case CONN_SENDING_LOAD_DATA: /* @@ -1866,6 +1867,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR Do nothing, the connection will be brutally closed and the server will catch it and free close from its side. */ + /* Fall-through */ case CONN_ALLOCED: /* Allocated but not connected or there was failure when trying @@ -1873,16 +1875,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR Fall-through */ + CONN_SET_STATE(conn, CONN_QUIT_SENT); + net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC); + /* Fall-through */ case CONN_QUIT_SENT: /* The user has killed its own connection */ break; } - /* - We hold one reference, and every other object which needs the - connection does increase it by 1. - */ - CONN_SET_STATE(conn, CONN_QUIT_SENT); - net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC); DBG_RETURN(ret); } diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index a641a41..7458f76 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -239,17 +239,19 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net, { php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC); DBG_ENTER("mysqlnd_net::post_connect_set_opt"); - if (net->data->options.timeout_read) { - struct timeval tv; - DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->data->options.timeout_read); - tv.tv_sec = net->data->options.timeout_read; - tv.tv_usec = 0; - php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv); - } + if (net_stream) { + if (net->data->options.timeout_read) { + struct timeval tv; + DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->data->options.timeout_read); + tv.tv_sec = net->data->options.timeout_read; + tv.tv_usec = 0; + php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv); + } - if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) { - /* TCP -> Set TCP_NODELAY */ - mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC); + if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) { + /* TCP -> Set TCP_NODELAY */ + mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC); + } } DBG_VOID_RETURN; @@ -1051,6 +1053,7 @@ static php_stream * MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC) { DBG_ENTER("mysqlnd_net::get_stream"); + DBG_INF_FMT("%p", net? net->data->stream:NULL); DBG_RETURN(net? net->data->stream:NULL); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: close the stream whenever possible, no need to keep it open altough the connection is marked as unusable: ext/mysqlnd/mysqlnd.c
Commit:f96d19fa7078df9a131f3bd0dd6e5a4429ee7037 Author:andrey Fri, 1 Jun 2012 11:22:19 +0300 Parents: 9a64a23caf0ad65cfe553569e2b010797ac5dca7 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f96d19fa7078df9a131f3bd0dd6e5a4429ee7037 Log: close the stream whenever possible, no need to keep it open altough the connection is marked as unusable Changed paths: M ext/mysqlnd/mysqlnd.c Diff: diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 02a2401..705dac3 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -354,6 +354,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA php_error(E_WARNING, "Error while sending %s packet. PID=%d", mysqlnd_command_to_text[command], getpid()); } CONN_SET_STATE(conn, CONN_QUIT_SENT); + conn->m->send_close(conn TSRMLS_CC); DBG_ERR("Server is gone"); ret = FAIL; } @@ -468,6 +469,7 @@ mysqlnd_switch_to_ssl_if_needed( DBG_INF("Switching to SSL"); if (!PACKET_WRITE(auth_packet, conn)) { CONN_SET_STATE(conn, CONN_QUIT_SENT); + conn->m->send_close(conn TSRMLS_CC); SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); goto end; } @@ -1732,6 +1734,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p SET_ERROR_AFF_ROWS(conn); } else if (PASS == (ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_LAST, FALSE, TRUE TSRMLS_CC))) { CONN_SET_STATE(conn, CONN_QUIT_SENT); + conn->m->send_close(conn TSRMLS_CC); } conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); @@ -1879,6 +1882,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR connection does increase it by 1. */ CONN_SET_STATE(conn, CONN_QUIT_SENT); + net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC); DBG_RETURN(ret); } @@ -2118,6 +2122,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS DBG_ERR_FMT("Serious error. %s::%u", __FILE__, __LINE__); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious error. PID=%d", getpid()); CONN_SET_STATE(conn, CONN_QUIT_SENT); + conn->m->send_close(conn TSRMLS_CC); } else { DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info->error_no, conn->error_info->error); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: more refactoring stuff. Reduced code duplication in the authentication code: ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd_structs.h
Commit:0d1bc3e8e57977265f1543e35d877b632b56cce9 Author:andrey Thu, 31 May 2012 15:46:26 +0300 Parents: 56532895a851851b4eacebb58cd3a0c7294031b3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0d1bc3e8e57977265f1543e35d877b632b56cce9 Log: more refactoring stuff. Reduced code duplication in the authentication code Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_structs.h diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index fc0e46a..02a2401 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -303,17 +303,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D /* }}} */ -/* {{{ mysqlnd_conn_data::simple_command */ +/* {{{ mysqlnd_conn_data::simple_command_send_request */ static enum_func_status -MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, - const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, - zend_bool ignore_upsert_status TSRMLS_DC) +MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, + const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC) { enum_func_status ret = PASS; MYSQLND_PACKET_COMMAND * cmd_packet; - DBG_ENTER("mysqlnd_conn_data::simple_command"); - DBG_INF_FMT("command=%s ok_packet=%u silent=%u", mysqlnd_command_to_text[command], ok_packet, silent); + DBG_ENTER("mysqlnd_conn_data::simple_command_send_request"); + DBG_INF_FMT("command=%s silent=%u", mysqlnd_command_to_text[command], silent); switch (CONN_GET_STATE(conn)) { case CONN_READY: @@ -357,11 +356,27 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum CONN_SET_STATE(conn, CONN_QUIT_SENT); DBG_ERR("Server is gone"); ret = FAIL; - } else if (ok_packet != PROT_LAST) { + } + PACKET_FREE(cmd_packet); + DBG_RETURN(ret); +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::simple_command */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, + const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, + zend_bool ignore_upsert_status TSRMLS_DC) +{ + enum_func_status ret; + DBG_ENTER("mysqlnd_conn_data::simple_command"); + + ret = conn->m->simple_command_send_request(conn, command, arg, arg_len, silent, ignore_upsert_status TSRMLS_CC); + if (PASS == ret && ok_packet != PROT_LAST) { ret = conn->m->simple_command_handle_response(conn, ok_packet, silent, command, ignore_upsert_status TSRMLS_CC); } - PACKET_FREE(cmd_packet); DBG_INF(ret == PASS ? "PASS":"FAIL"); DBG_RETURN(ret); } @@ -472,132 +487,150 @@ end: /* }}} */ -/* {{{ mysqlnd_connect_run_authentication */ +/* {{{ mysqlnd_conn_data::fetch_auth_plugin_by_name */ +static struct st_mysqlnd_authentication_plugin * +MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC) +{ + struct st_mysqlnd_authentication_plugin * auth_plugin; + char * plugin_name = NULL; + DBG_ENTER("mysqlnd_conn_data::fetch_auth_plugin_by_name"); + + mnd_sprintf(&plugin_name, 0, "auth_plugin_%s", requested_protocol); + DBG_INF_FMT("looking for %s auth plugin", plugin_name); + auth_plugin = mysqlnd_plugin_find(plugin_name); + mnd_sprintf_free(plugin_name); + + DBG_RETURN(auth_plugin); +} +/* }}} */ + + +/* {{{ mysqlnd_run_authentication */ static enum_func_status -mysqlnd_connect_run_authentication( +mysqlnd_run_authentication( MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, + const size_t passwd_len, const char * const db, - size_t db_len, - size_t passwd_len, - const MYSQLND_PACKET_GREET * const greet_packet, + const size_t db_len, + const zend_uchar * const auth_plugin_data, + const size_t auth_plugin_data_len, + const char * const auth_protocol, + unsigned int charset_no, const MYSQLND_OPTIONS * const options, - unsigned long mysql_flags + unsigned long mysql_flags, + zend_bool silent, + zend_bool is_change_user
[PHP-CVS] com php-src: small refactoring - factour out code from connection establishment. Add a define for the default authentication protocol - get away from the hardcoded magic value: ext/mysqlnd/m
Commit:5a2578a333aaa5f72216f28510705ae0676e9266 Author:andrey Wed, 30 May 2012 15:24:17 +0300 Parents: fde8762e9034f006826bec12bc6c0aac6b450055 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5a2578a333aaa5f72216f28510705ae0676e9266 Log: small refactoring - factour out code from connection establishment. Add a define for the default authentication protocol - get away from the hardcoded magic value Changed paths: M ext/mysqlnd/mysqlnd.c M ext/mysqlnd/mysqlnd_debug.h M ext/mysqlnd/mysqlnd_enum_n_def.h M ext/mysqlnd/mysqlnd_structs.h diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 300a7ee..fc0e46a 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -605,6 +605,148 @@ end: /* }}} */ +/* {{{ mysqlnd_conn_data::execute_init_commands */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC) +{ + enum_func_status ret = PASS; + + DBG_ENTER("mysqlnd_conn_data::execute_init_commands"); + if (conn->options->init_commands) { + unsigned int current_command = 0; + for (; current_command < conn->options->num_commands; ++current_command) { + const char * const command = conn->options->init_commands[current_command]; + if (command) { + MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT); + if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) { + MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT); + ret = FAIL; + break; + } + if (conn->last_query_type == QUERY_SELECT) { + MYSQLND_RES * result = conn->m->use_result(conn TSRMLS_CC); + if (result) { + result->m.free_result(result, TRUE TSRMLS_CC); + } + } + } + } + } + DBG_RETURN(ret); +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::get_updated_connect_flags */ +static unsigned int +MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC) +{ + MYSQLND_NET * net = conn->net; + + DBG_ENTER("mysqlnd_conn_data::get_updated_connect_flags"); + /* we allow load data local infile by default */ + mysql_flags |= MYSQLND_CAPABILITIES; + + if (PG(open_basedir) && strlen(PG(open_basedir))) { + mysql_flags ^= CLIENT_LOCAL_FILES; + } + +#ifndef MYSQLND_COMPRESSION_ENABLED + if (mysql_flags & CLIENT_COMPRESS) { + mysql_flags &= ~CLIENT_COMPRESS; + } +#else + if (net && net->data->options.flags & MYSQLND_NET_FLAG_USE_COMPRESSION) { + mysql_flags |= CLIENT_COMPRESS; + } +#endif +#ifndef MYSQLND_SSL_SUPPORTED + if (mysql_flags & CLIENT_SSL) { + mysql_flags &= ~CLIENT_SSL; + } +#else + if (net && (net->data->options.ssl_key || net->data->options.ssl_cert || + net->data->options.ssl_ca || net->data->options.ssl_capath || net->data->options.ssl_cipher)) + { + mysql_flags |= CLIENT_SSL; + } +#endif + + DBG_RETURN(mysql_flags); +} +/* }}} */ + + +/* {{{ mysqlnd_conn_data::connect_handshake */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn, + const char * const host, const char * const user, + const char * const passwd, const unsigned int passwd_len, + const char * const db, const unsigned int db_len, + const unsigned int mysql_flags TSRMLS_DC) +{ + MYSQLND_PACKET_GREET * greet_packet; + MYSQLND_NET * net = conn->net; + + DBG_ENTER("mysqlnd_conn_data::connect_handshake"); + + greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE TSRMLS_CC); + if (!greet_packet) { + SET_OOM_ERROR(*conn->error_info); + DBG_RETURN(FAIL); /* OOM */ + } + + if (FAIL == net->data->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent, + conn->stats, conn->error_info TSRMLS_CC)) + { + goto err; + } + + DBG_INF_FMT("stream=%p", net->data->m.get_stream(net TSRMLS_CC)); + + if (FAIL == PACKET_READ(greet_packet, conn)) { + DBG_ERR(
[PHP-CVS] com php-src: Fix for bug#62046: ext/mysqli/tests/bug62046.phpt ext/mysqlnd/mysqlnd_ps.c
Commit:d4afbd487abbe9e5f3e4fc6c44974639e123406a Author:andrey Wed, 16 May 2012 14:28:55 +0200 Parents: 93c91c733cf2259263e4d8c0f3ccc254246d404d Branches: PHP-5.3 PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d4afbd487abbe9e5f3e4fc6c44974639e123406a Log: Fix for bug#62046 Bug#62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset(). Stmt's state was changed to STMT_PREPARED and leads the driver to think that the stmt was just prepared. Because result set exist also for only prepared but not executed sets, the check for stmt->result isn't any good. There is a result set, because as response for COM_PREPARE the server sends metadata and metadata is part of a result set. After COM_EXECUTE the server sends metadata again, which could be different and in this case more correct. Bugs: https://bugs.php.net/62046 Changed paths: A ext/mysqli/tests/bug62046.phpt M ext/mysqlnd/mysqlnd_ps.c Diff: diff --git a/ext/mysqli/tests/bug62046.phpt b/ext/mysqli/tests/bug62046.phpt new file mode 100644 index 000..31a7328 --- /dev/null +++ b/ext/mysqli/tests/bug62046.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset() +--SKIPIF-- + +--FILE-- +prepare('SELECT 42'))) { + printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + } + if (FALSE === $stmt->execute()) { + printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + if (FALSE === $stmt->store_result()) { + printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + $one = NULL; + if (FALSE === $stmt->bind_result($one)) { + printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + if (FALSE === $stmt->reset()) { + printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + while ($stmt->fetch()) { + var_dump($one); + } + $stmt->close(); + $link->close(); + echo "done!"; +?> +--EXPECT-- +int(42) +done! \ No newline at end of file diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 2044390..d762689 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1265,8 +1265,6 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC) stmt->error_info = conn->error_info; } stmt->upsert_status = conn->upsert_status; - - stmt->state = MYSQLND_STMT_PREPARED; } DBG_INF(ret == PASS? "PASS":"FAIL"); DBG_RETURN(ret); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd_ps.c
Commit:4d2d8e871771be0342869e6710ef4e74346db1e7 Author:andrey Wed, 16 May 2012 15:59:39 +0200 Parents: 1abcd81872978026d269532c2f5f1e0f35dcb729 d4afbd487abbe9e5f3e4fc6c44974639e123406a Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4d2d8e871771be0342869e6710ef4e74346db1e7 Log: Merge branch 'PHP-5.3' into PHP-5.4 Conflicts: ext/mysqlnd/mysqlnd_ps.c merge fix for bug#62046 Bugs: https://bugs.php.net/62046 Changed paths: MM ext/mysqlnd/mysqlnd_ps.c Diff: diff --cc ext/mysqlnd/mysqlnd_ps.c index 90e6856,d762689..1b48ba1 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@@ -636,9 -657,9 +636,11 @@@ MYSQLND_METHOD(mysqlnd_stmt, execute)(M have it again. */ stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC); ++ ++ stmt->state = MYSQLND_STMT_PREPARED; } else if (stmt->state < MYSQLND_STMT_PREPARED) { /* Only initted - error */ - SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, + SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); SET_STMT_ERROR(stmt, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); DBG_INF("FAIL"); @@@ -1205,45 -1233,6 +1207,43 @@@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYS } } + s->m->flush(s TSRMLS_CC); + + /* +Don't free now, let the result be usable. When the stmt will again be +executed then the result set will be cleaned, the bound variables will +be separated before that. + */ + + int4store(cmd_buf, stmt->stmt_id); + if (CONN_GET_STATE(conn) == CONN_READY && + FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf, + sizeof(cmd_buf), PROT_OK_PACKET, + FALSE, TRUE TSRMLS_CC))) { + COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); + } + *stmt->upsert_status = *conn->upsert_status; - - stmt->state = MYSQLND_STMT_PREPARED; + } + DBG_INF(ret == PASS? "PASS":"FAIL"); + DBG_RETURN(ret); +} +/* }}} */ + + +/* {{{ mysqlnd_stmt::flush */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC) +{ + MYSQLND_STMT_DATA * stmt = s? s->data:NULL; + enum_func_status ret = PASS; + + DBG_ENTER("mysqlnd_stmt::flush"); + if (!stmt || !stmt->conn) { + DBG_RETURN(FAIL); + } + DBG_INF_FMT("stmt=%lu", stmt->stmt_id); + + if (stmt->stmt_id) { /* If the user decided to close the statement right after execute() We have to call the appropriate use_result() or store_result() and @@@ -1261,8 -1250,21 +1261,6 @@@ stmt->result->m.skip_result(stmt->result TSRMLS_CC); } } while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS); -- - stmt->state = MYSQLND_STMT_PREPARED; - /* -Don't free now, let the result be usable. When the stmt will again be -executed then the result set will be cleaned, the bound variables will -be separated before that. - */ - - int4store(cmd_buf, stmt->stmt_id); - if (CONN_GET_STATE(conn) == CONN_READY && - FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, (char *)cmd_buf, - sizeof(cmd_buf), PROT_OK_PACKET, - FALSE, TRUE TSRMLS_CC))) { - stmt->error_info = conn->error_info; - } - stmt->upsert_status = conn->upsert_status; } DBG_INF(ret == PASS? "PASS":"FAIL"); DBG_RETURN(ret); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: these methods should return a stream. This makes it easier to intercept the return value: ext/mysqlnd/mysqlnd_net.c ext/mysqlnd/mysqlnd_structs.h
Commit:c75cbd62dda8a1fab2a0e68ed07ea73ca5e2b1d2 Author:andrey Mon, 7 May 2012 15:32:00 +0200 Parents: 68536a41672ead2d2872af01af4d4167c47366c0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c75cbd62dda8a1fab2a0e68ed07ea73ca5e2b1d2 Log: these methods should return a stream. This makes it easier to intercept the return value Changed paths: M ext/mysqlnd/mysqlnd_net.c M ext/mysqlnd/mysqlnd_structs.h Diff: diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index b2fe662..a641a41 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -105,7 +105,7 @@ MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zen /* }}} */ /* {{{ mysqlnd_net::open_pipe */ -static enum_func_status +static php_stream * MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC) @@ -125,7 +125,7 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con net_stream = php_stream_open_wrapper((char*) scheme + sizeof("pipe://") - 1, "r+", streams_options, NULL); if (!net_stream) { SET_CLIENT_ERROR(*error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, "Unknown errror while connecting"); - DBG_RETURN(FAIL); + DBG_RETURN(NULL); } /* Streams are not meant for C extensions! Thus we need a hack. Every connected stream will @@ -136,15 +136,14 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con zend_hash_index_del(&EG(regular_list), net_stream->rsrc_id); net_stream->in_free = 0; - (void) net->data->m.set_stream(net, net_stream TSRMLS_CC); - DBG_RETURN(PASS); + DBG_RETURN(net_stream); } /* }}} */ /* {{{ mysqlnd_net::open_tcp_or_unix */ -static enum_func_status +static php_stream * MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC) @@ -191,7 +190,7 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha /* no mnd_ since we don't allocate it */ efree(errstr); } - DBG_RETURN(FAIL); + DBG_RETURN(NULL); } if (hashed_details) { /* @@ -227,8 +226,7 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha zend_hash_index_del(&EG(regular_list), net_stream->rsrc_id); net_stream->in_free = 0; - (void) net->data->m.set_stream(net, net_stream TSRMLS_CC); - DBG_RETURN(PASS); + DBG_RETURN(net_stream); } /* }}} */ @@ -300,8 +298,11 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info TSRMLS_CC); if (open_stream) { - if (PASS == (ret = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC))) { + php_stream * net_stream = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC); + if (net_stream) { + (void) net->data->m.set_stream(net, net_stream TSRMLS_CC); net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info TSRMLS_CC); + ret = PASS; } } diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 6dcb8b3..b355a0d 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -283,7 +283,7 @@ typedef enum_func_status (*func_mysqlnd_net__init)(MYSQLND_NET * const net, MYSQ typedef void (*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC); typedef enum_func_status (*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC); typedef void (*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS
[PHP-CVS] com php-src: comment for the #else: ext/mysqlnd/mysqlnd_debug.h
Commit:68536a41672ead2d2872af01af4d4167c47366c0 Author:andrey Mon, 7 May 2012 13:55:40 +0200 Parents: 9927cc5f4b0e626e601d542b0b50e82c54650ac8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=68536a41672ead2d2872af01af4d4167c47366c0 Log: comment for the #else Changed paths: M ext/mysqlnd/mysqlnd_debug.h Diff: diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h index d805178..3372e73 100644 --- a/ext/mysqlnd/mysqlnd_debug.h +++ b/ext/mysqlnd/mysqlnd_debug.h @@ -141,7 +141,7 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); -#else +#else /* defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) */ static inline void DBG_INF_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} static inline void DBG_ERR_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} static inline void DBG_INF_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: bump mysqlnd versions: ext/mysqlnd/mysqlnd.h
Commit:267f691a45cc18a819bc2742b87dc7eae91934bc Author:andrey Thu, 3 May 2012 15:33:47 +0200 Parents: b850fa14e0fc75cc025972ab1582fbf56f9d2770 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=267f691a45cc18a819bc2742b87dc7eae91934bc Log: bump mysqlnd versions Changed paths: M ext/mysqlnd/mysqlnd.h Diff: diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index c32ac72..8cf 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -22,10 +22,10 @@ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION "mysqlnd 5.0.10-dev - 20111026 - $Id$" -#define MYSQLND_VERSION_ID 50010 +#define MYSQLND_VERSION "mysqlnd 5.0.11-dev - 20120503 - $Id$" +#define MYSQLND_VERSION_ID 50011 -#define MYSQLND_PLUGIN_API_VERSION 1 +#define MYSQLND_PLUGIN_API_VERSION 2 #define MYSQLND_STRING_TO_INT_CONVERSION /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: phoenix from the ashes: ext/mysqli/tests/local_infile_tools.inc
Commit:b850fa14e0fc75cc025972ab1582fbf56f9d2770 Author:andrey Thu, 3 May 2012 13:34:26 +0200 Parents: 0ce37188cd06d498049d009af3db579ebe0ce298 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b850fa14e0fc75cc025972ab1582fbf56f9d2770 Log: phoenix from the ashes Changed paths: A ext/mysqli/tests/local_infile_tools.inc Diff: diff --git a/ext/mysqli/tests/local_infile_tools.inc b/ext/mysqli/tests/local_infile_tools.inc new file mode 100644 index 000..bb9872f --- /dev/null +++ b/ext/mysqli/tests/local_infile_tools.inc @@ -0,0 +1,156 @@ +errno) { + return $link->error; + } + } + mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name)); + return ""; + } + + function create_standard_csv($offset, $verbose = true) { + // create a CVS file + $file = tempnam(sys_get_temp_dir(), 'mysqli_test'); + if (!$fp = fopen($file, 'w')) { + if ($verbose) + printf("[%03d + 1] Cannot create CVS file '%s'\n", $offset, $file); + return NULL; + } else { + /* Looks ugly? No, handy if you have crashes... */ + register_shutdown_function("shutdown_clean", $file); + } + + if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) { + if (!fwrite($fp, (binary)"'97';'x';\n") || + !fwrite($fp, (binary)"'98';'y';\n") || + !fwrite($fp, (binary)"99;'z';\n")) { + if ($verbose) + printf("[%03d + 2] Cannot write CVS file '%s'\n", $offset, $file); + return NULL; + } + } else { + if (!fwrite($fp, "97;'x';\n") || + !fwrite($fp, "98;'y';\n") || + !fwrite($fp, "99;'z';\n")) { + if ($verbose) + printf("[%03d + 3] Cannot write CVS file '%s'\n", $offset, $file); + return NULL; + } + } + + fclose($fp); + + if (!chmod($file, 0644)) { + if ($verbose) + printf("[%03d + 4] Cannot change the file perms of '%s' from 0600 to 0644, MySQL might not be able to read it\n", + $offset, $file); + return NULL; + } + return $file; + } + + function try_handler($offset, $link, $file, $handler, $expected = null) { + + if ('default' == $handler) { + mysqli_set_local_infile_default($link); + } else if (!mysqli_set_local_infile_handler($link, $handler)) { + printf("[%03d] Cannot set infile handler to '%s'\n", $offset, $handler); + return false; + } + printf("Callback set to '%s'\n", $handler); + + if (!mysqli_query($link, sprintf("DELETE FROM test"))) { + printf("[%03d] Cannot remove records, [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link)); + return false; + } + + if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s' + INTO TABLE test + FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\'' + LINES TERMINATED BY '\n'", + mysqli_real_escape_string($link, $file { + printf("[%03d] LOAD DATA failed, [%d] %s\n", + $offset + 2, + mysqli_errno($link), mysqli_error($link)); + } + + if (!$res = mysqli_query($link, "SELECT id, label FROM test ORDER BY id")) { + printf("[%03d] [%d] %s\n", $offset + 3, mysqli_errno($link), mysqli_error($link)); + return false; + } + + if (!is_array($expected)) + return true; + + foreach ($expected as $k => $values) { + if (!$tmp = mysqli_fetch_assoc($res)) { + printf("[%03d/%d] [%d] '%s'\n", $offset + 4, $k, mysqli_errno($link), mysqli_error($link)); + return false; + } + if ($values['id'] != $tmp['id']) { + printf("[%03d/%d] Expecting %s got %s\n", + $offset + 5, $k, + $values['id'], $tmp['id']); +
[PHP-CVS] com php-src: here comes the news: NEWS
Commit:0ce37188cd06d498049d009af3db579ebe0ce298 Author:andrey Thu, 3 May 2012 13:02:34 +0200 Parents: e0c7ed91a4e14ff1a166dd46fceaf6ae4af0fd19 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0ce37188cd06d498049d009af3db579ebe0ce298 Log: here comes the news Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index ff5a31d..42c2f83 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,10 @@ PHP NEWS still exists for backward compatibility but is doing nothing). (Pierrick) . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick) +- MySQLi + . Dropped support for LOAD DATA LOCAL INFILE handlers when using libmysql. +Known for stability problems. (Andrey) + - PCRE: . Deprecated the /e modifier (https://wiki.php.net/rfc/remove_preg_replace_eval_modifier). (Nikita Popov) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: remove dead and unused for more than 8 years code: ext/mysqli/mysqli_report.h ext/mysqli/package.xml ext/mysqli/php_mysqli_structs.h
Commit:57f7bd0d858542cfc23a35b9f619137489c873f9 Author:andrey Thu, 3 May 2012 12:22:25 +0200 Parents: 62de1cfe3386190eeb9fc3f4cd9067e58fd88f18 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=57f7bd0d858542cfc23a35b9f619137489c873f9 Log: remove dead and unused for more than 8 years code Changed paths: D ext/mysqli/mysqli_report.h M ext/mysqli/package.xml M ext/mysqli/php_mysqli_structs.h Diff: diff --git a/ext/mysqli/mysqli_report.h b/ext/mysqli/mysqli_report.h deleted file mode 100644 index 4035a4b..000 --- a/ext/mysqli/mysqli_report.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +--+ - | PHP Version 5| - +--+ - | Copyright (c) 1997-2012 The PHP Group| - +--+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is| - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | lice...@php.net so we can mail you a copy immediately. | - +--+ - | Author: Georg Richter | - +--+ - - $Id$ -*/ - -#ifndef __HAVE_MYSQLI_PROFILER_H__ -#define __HAVE_MYSQLI_PROFILER_H__ - -#ifdef PHP_WIN32 -#include -#include -#include "win32/time.h" -#else -#include -#include -#include -#include -#include -#endif - -typedef struct { - struct timeval starttime, - endtime;/* execution time */ -} PR_TIME_INFO; - - -#define MYSQLI_PR_REPORT_STDERR1 -#define MYSQLI_PR_REPORT_PORT 2 - - - -/*** PROFILER MACROS ***/ -#define MYSQLI_PROFILER_STARTTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.starttime, NULL) -#define MYSQLI_PROFILER_ENDTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.endtime, NULL) -#define MYSQLI_PROFILER_REPORT(_type, _time, ptr) if (MyG(profiler.mode)) php_mysqli_profiler_report(_type, _time, (void *)ptr) - - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/package.xml b/ext/mysqli/package.xml index 6de81d7..c27316a 100644 --- a/ext/mysqli/package.xml +++ b/ext/mysqli/package.xml @@ -43,7 +43,6 @@ package.xml added to support installation using pear installer - diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index ed468e2..32e3e1e 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -131,12 +131,6 @@ typedef struct { } MY_MYSQL; typedef struct { - int mode; - int socket; - FILE*fp; -} PROFILER; - -typedef struct { void*ptr; /* resource: (mysql, result, stmt) */ void*info; /* additional buffer */ enum mysqli_status status; /* object status */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php