[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ configure.in
tony2001 Fri, 25 Sep 2009 07:10:29 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288722 Log: MFH: save LDFLAGS in EXTRA_LDFLAGS before unsetting this patch makes sure that LDFLAGS are taken into account when configuring the build Changed paths: U php/php-src/branches/PHP_5_2/configure.in Modified: php/php-src/branches/PHP_5_2/configure.in === --- php/php-src/branches/PHP_5_2/configure.in 2009-09-25 07:04:39 UTC (rev 288721) +++ php/php-src/branches/PHP_5_2/configure.in 2009-09-25 07:10:29 UTC (rev 288722) @@ -965,6 +965,7 @@ esac EXTRA_LIBS=$EXTRA_LIBS $DLIBS $LIBS +EXTRA_LDFLAGS=$EXTRA_LDFLAGS $LDFLAGS dnl this has to be here to prevent the openssl crypt() from dnl overriding the system provided crypt(). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd.c trunk/ext/mysqlnd/mysqlnd.c
andrey Fri, 25 Sep 2009 10:37:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288741 Log: Fix possible crash when conn is NULL Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c U php/php-src/trunk/ext/mysqlnd/mysqlnd.c Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c 2009-09-25 10:36:42 UTC (rev 288740) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c 2009-09-25 10:37:44 UTC (rev 288741) @@ -508,8 +508,8 @@ host?host:, user?user:, db?db:, port, mysql_flags, conn? conn-persistent:0, conn? CONN_GET_STATE(conn):-1); - DBG_INF_FMT(state=%d, CONN_GET_STATE(conn)); if (conn CONN_GET_STATE(conn) CONN_ALLOCED CONN_GET_STATE(conn) ) { + DBG_INF_FMT(state=%d, CONN_GET_STATE(conn)); DBG_INF(Connecting on a connected handle.); if (CONN_GET_STATE(conn) CONN_QUIT_SENT) { Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd.c 2009-09-25 10:36:42 UTC (rev 288740) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c 2009-09-25 10:37:44 UTC (rev 288741) @@ -508,8 +508,8 @@ host?host:, user?user:, db?db:, port, mysql_flags, conn? conn-persistent:0, conn? CONN_GET_STATE(conn):-1); - DBG_INF_FMT(state=%d, CONN_GET_STATE(conn)); if (conn CONN_GET_STATE(conn) CONN_ALLOCED CONN_GET_STATE(conn) ) { + DBG_INF_FMT(state=%d, CONN_GET_STATE(conn)); DBG_INF(Connecting on a connected handle.); if (CONN_GET_STATE(conn) CONN_QUIT_SENT) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/mysqli_api.c trunk/ext/mysqli/mysqli_api.c
andrey Fri, 25 Sep 2009 10:52:29 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288743 Log: Fix error code checking for mysql_stmt_attr_set. There is a test that checks this. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c U php/php-src/trunk/ext/mysqli/mysqli_api.c Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c === --- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c2009-09-25 10:42:09 UTC (rev 288742) +++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c2009-09-25 10:52:29 UTC (rev 288743) @@ -2128,7 +2128,11 @@ } mode = mode_in; - if ((rc = mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode))) { +#if !defined(MYSQLI_USE_MYSQLND) + if (mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { +#else + if (FAIL == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { +#endif RETURN_FALSE; } RETURN_TRUE; Modified: php/php-src/trunk/ext/mysqli/mysqli_api.c === --- php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-25 10:42:09 UTC (rev 288742) +++ php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-25 10:52:29 UTC (rev 288743) @@ -2190,7 +2190,11 @@ } mode = mode_in; - if ((rc = mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode))) { +#if !defined(MYSQLI_USE_MYSQLND) + if (mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { +#else + if (FAIL == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { +#endif RETURN_FALSE; } RETURN_TRUE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/connect.inc branches/PHP_5_3/ext/mysqli/tests/mysqli_connect_errno.phpt branches/PHP_5_3/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt
uw Fri, 25 Sep 2009 10:54:16 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288745 Log: Replacing MYSQL_TEST_COMPRESS env var with more generic MYSQL_TEST_CONNECT_FLAGS to be able to test all connection flags. Fixing some test. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqli/tests/connect.inc U php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_connect_errno.phpt U php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt U php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_max_links.phpt U php/php-src/trunk/ext/mysqli/tests/connect.inc U php/php-src/trunk/ext/mysqli/tests/mysqli_connect_errno.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_max_links.phpt Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/connect.inc === --- php/php-src/branches/PHP_5_3/ext/mysqli/tests/connect.inc 2009-09-25 10:53:58 UTC (rev 288744) +++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/connect.inc 2009-09-25 10:54:16 UTC (rev 288745) @@ -16,7 +16,7 @@ $engine= getenv(MYSQL_TEST_ENGINE) ? getenv(MYSQL_TEST_ENGINE) : MyISAM; $socket= getenv(MYSQL_TEST_SOCKET) ? getenv(MYSQL_TEST_SOCKET) : null; $skip_on_connect_failure = getenv(MYSQL_TEST_SKIP_CONNECT_FAILURE) ? getenv(MYSQL_TEST_SKIP_CONNECT_FAILURE) : true; - $test_compress = getenv(MYSQL_TEST_COMPRESS) ? (boolean)getenv(MYSQL_TEST_COMPRESS) : false; + $connect_flags = getenv(MYSQL_TEST_CONNECT_FLAGS) ? (int)getenv(MYSQL_TEST_CONNECT_FLAGS) : 0; /* Development setting: test experimal features and/or feature requests that never worked before? */ $TEST_EXPERIMENTAL = (in_array(getenv(MYSQL_TEST_EXPERIMENTAL), array(0, 1))) ? @@ -51,6 +51,7 @@ /* unknown */ $MYSQLND_VERSION = -1; } + } if (!function_exists('sys_get_temp_dir')) { @@ -76,17 +77,17 @@ /** * Whenever possible, please use this wrapper to make testing ot MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible * - * @param compress mixed: -1 = use global default, false - no compression, true - compression + * @param enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS)? */ - function my_mysqli_connect($host, $user, $passwd, $db, $port, $socket, $compress = -1) { - global $test_compress; + function my_mysqli_connect($host, $user, $passwd, $db, $port, $socket, $enable_env_flags = true) { + global $connect_flags; - if (-1 == $compress) - $compress = $test_compress; + $flags = ($enable_env_flags) ? $connect_flags : false; - if ($compress) { + if ($flags !== false) { $link = mysqli_init(); - mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, 0 MYSQLI_CLIENT_COMPRESS); + if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags)) +$link = false; } else { $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); } @@ -97,27 +98,26 @@ /** * Whenever possible, please use this wrapper to make testing ot MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible * - * @param compress mixed: -1 = use global default, false - no compression, true - compression + * @param enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS) */ - function my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags = 0, $compress = -1) { - global $test_compress; + function my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags = 0, $enable_env_flags = true) { + global $connect_flags; - if (-1 == $compress) - $compress = $test_compress; + if ($enable_env_flags) + $flags $connect_flags; - return mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags MYSQLI_CLIENT_COMPRESS); + return mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags); } class my_mysqli extends mysqli { - public function __construct($host, $user, $passwd, $db, $port, $socket, $compress = -1) { - global $test_compress; + public function __construct($host, $user, $passwd, $db, $port, $socket, $enable_env_flags = true) { + global $connect_flags; - if (-1 == $compress) -$compress = $test_compress; + $flags = ($enable_env_flags) ? $connect_flags : false; - if ($compress) { + if ($flags !== false) { parent::init(); -$this-real_connect($host, $user, $passwd, $db, $port, $socket, 0 MYSQLI_CLIENT_COMPRESS); +$this-real_connect($host, $user, $passwd, $db, $port, $socket, $flags); } else { parent::__construct($host, $user, $passwd, $db, $port, $socket); } Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_connect_errno.phpt === ---
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/mysqli_api.c trunk/ext/mysqli/mysqli_api.c
andrey Fri, 25 Sep 2009 10:55:06 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288746 Log: Remove unused variable Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c U php/php-src/trunk/ext/mysqli/mysqli_api.c Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c === --- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c2009-09-25 10:54:16 UTC (rev 288745) +++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c2009-09-25 10:55:06 UTC (rev 288746) @@ -2115,7 +2115,6 @@ longmode_in; ulong mode; ulong attr; - int rc; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), Oll, mysql_stmt, mysqli_stmt_class_entry, attr, mode_in) == FAILURE) { return; Modified: php/php-src/trunk/ext/mysqli/mysqli_api.c === --- php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-25 10:54:16 UTC (rev 288745) +++ php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-25 10:55:06 UTC (rev 288746) @@ -2177,7 +2177,6 @@ longmode_in; ulong mode; ulong attr; - int rc; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), Oll, mysql_stmt, mysqli_stmt_class_entry, attr, mode_in) == FAILURE) { return; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt
uw Fri, 25 Sep 2009 10:56:17 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288747 Log: Large package to check how compression handles package queues. Changed paths: A php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt A php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt Added: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt === --- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt 2009-09-25 10:56:17 UTC (rev 288747) @@ -0,0 +1,100 @@ +--TEST-- +mysqli_fetch_array() - large packages (to test compression) +--SKIPIF-- +?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +? +--FILE-- +?php + include connect.inc; + + function mysqli_fetch_array_large($offset, $link, $package_size) { + + /* we are aiming for maximum compression to test MYSQLI_CLIENT_COMPRESS */ + $random_char = str_repeat('a', 255); + $sql = INSERT INTO test(label) VALUES ; + + while (strlen($sql) ($package_size - 259)) + $sql .= sprintf(('%s'), , $random_char); + + $sql = substr($sql, 0, -2); + assert(strlen($sql) $package_size); + + if (!mysqli_query($link, $sql)) { + printf([%03d + 1] [%d] %s\n, $offset, mysqli_errno($link), mysqli_error($link)); + return false; + } + + /* buffered result set - let's hope we do not run into PHP memory limit... */ + if (!$res = mysqli_query($link, SELECT id, label FROM test)) { + printf([%03d + 2] [%d] %s\n, $offset, mysqli_errno($link), mysqli_error($link)); + return false; + } + + while ($row = mysqli_fetch_assoc($res)) { + if ($row['label'] != $random_char) { + printf([%03d + 3] Wrong results - expecting '%s' got '%s', [%d] %s\n, + $offset, $random_char, $row['label'], mysqli_errno($link), mysqli_error($link)); + return false; + } + } + mysqli_free_result($res); + + if (!$stmt = mysqli_prepare($link, SELECT id, label FROM test)) { + printf([%03d + 4] [%d] %s\n, $offset, mysqli_errno($link), mysqli_error($link)); + return false; + } + + /* unbuffered result set */ + if (!mysqli_stmt_execute($stmt)) { + printf([%03d + 5] [%d] %s\n, $offset, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); + return false; + } + + $id = $label = NULL; + if (!mysqli_stmt_bind_result($stmt, $id, $label)) { + printf([%03d + 6] [%d] %s\n, $offset, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); + return false; + } + + while (mysqli_stmt_fetch($stmt)) { + if ($label != $random_char) { + printf([%03d + 7] Wrong results - expecting '%s' got '%s', [%d] %s\n, + $offset, $random_char, $label, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); + return false; + } + } + + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + + return true; + } + + + if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { + printf([001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n, + $host, $user, $db, $port, $socket); + } + + if (!mysqli_query($link, DROP TABLE IF EXISTS test) || + !mysqli_query($link, sprintf(CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, label VARCHAR(255)) ENGINE = %s, $engine))) + printf([002] [%d] %s\n, mysqli_errno($link), mysqli_error($link)); + + $package_size = 32768; + $offset = 3; + $limit = (0 ini_get('memory_limit')) ? pow(2, 32) : ini_get('memory_limit'); + while (($package_size $limit) mysqli_fetch_array_large($offset++, $link, $package_size)) + $package_size += $package_size; + + mysqli_close($link); + print done!; +? +--CLEAN-- +?php + require_once(clean_table.inc); +? +--EXPECTF-- +[%d + 1] [1153] Got a packet bigger than 'max_allowed_packet' bytes +done! \ No newline at end of file
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c trunk/ext/mysqli/mysqli_nonapi.c
andrey Fri, 25 Sep 2009 11:38:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288749 Log: Fix a crash in the rare case when a persistent connection is found dead, after CHNG_USER. mysql-mysql will be NULL and segfault will follow. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c U php/php-src/trunk/ext/mysqli/mysqli_nonapi.c Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c === --- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c 2009-09-25 11:10:55 UTC (rev 288748) +++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c 2009-09-25 11:38:19 UTC (rev 288749) @@ -217,7 +217,7 @@ MyG(num_active_persistent) + MyG(num_inactive_persistent)); goto err; } - if (!is_real_connect !mysql-mysql) { + if (!mysql-mysql) { #if !defined(MYSQLI_USE_MYSQLND) if (!(mysql-mysql = mysql_init(NULL))) { #else Modified: php/php-src/trunk/ext/mysqli/mysqli_nonapi.c === --- php/php-src/trunk/ext/mysqli/mysqli_nonapi.c2009-09-25 11:10:55 UTC (rev 288748) +++ php/php-src/trunk/ext/mysqli/mysqli_nonapi.c2009-09-25 11:38:19 UTC (rev 288749) @@ -216,7 +216,7 @@ MyG(num_active_persistent) + MyG(num_inactive_persistent)); goto err; } - if (!is_real_connect !mysql-mysql) { + if (!mysql-mysql) { #if !defined(MYSQLI_USE_MYSQLND) if (!(mysql-mysql = mysql_init(NULL))) { #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/mysqli_api.c branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_attr_set.phpt trunk/ext/mysqli/mysqli_api.c trunk/ext/mysqli/tests/mysqli_stmt_attr_
andrey Fri, 25 Sep 2009 12:25:54 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288784 Log: Fix mysqli_stmt_attr_set in libmysql mode. mysql_stmt_attr_set returns my_bool instead of int. If it was int, then 0 is success and !0 is failure, but for my_bool 0 (FALSE) is failure and !0 is success. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c U php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_attr_set.phpt U php/php-src/trunk/ext/mysqli/mysqli_api.c U php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_attr_set.phpt Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c === --- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c2009-09-25 12:05:15 UTC (rev 288783) +++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c2009-09-25 12:25:54 UTC (rev 288784) @@ -2128,7 +2128,7 @@ mode = mode_in; #if !defined(MYSQLI_USE_MYSQLND) - if (mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { + if (FALSE == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { #else if (FAIL == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { #endif Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_attr_set.phpt === --- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_attr_set.phpt 2009-09-25 12:05:15 UTC (rev 288783) +++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_attr_set.phpt 2009-09-25 12:25:54 UTC (rev 288784) @@ -58,7 +58,7 @@ do { $invalid_attr = mt_rand(-1 * PHP_INT_MAX + 1, PHP_INT_MAX); } while (in_array($invalid_attr, $valid_attr)); - if (true !== ($tmp = @mysqli_stmt_attr_set($stmt, $invalid_attr, 0))) + if (false !== ($tmp = @mysqli_stmt_attr_set($stmt, $invalid_attr, 0))) /* Although it may be desired to get false neither the MySQL Client Library nor mysqlnd are supposed to detect invalid codes */ printf([006b] Expecting boolean/true for attribute %d, got %s/%s\n, $invalid_attr, gettype($tmp), $tmp); } @@ -265,4 +265,4 @@ require_once(clean_table.inc); ? --EXPECTF-- -done! \ No newline at end of file +done! Modified: php/php-src/trunk/ext/mysqli/mysqli_api.c === --- php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-25 12:05:15 UTC (rev 288783) +++ php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-25 12:25:54 UTC (rev 288784) @@ -2190,7 +2190,7 @@ mode = mode_in; #if !defined(MYSQLI_USE_MYSQLND) - if (mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { + if (FALSE == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { #else if (FAIL == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { #endif Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_attr_set.phpt === --- php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_attr_set.phpt 2009-09-25 12:05:15 UTC (rev 288783) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_attr_set.phpt 2009-09-25 12:25:54 UTC (rev 288784) @@ -58,7 +58,7 @@ do { $invalid_attr = mt_rand(-1 * PHP_INT_MAX + 1, PHP_INT_MAX); } while (in_array($invalid_attr, $valid_attr)); - if (true !== ($tmp = @mysqli_stmt_attr_set($stmt, $invalid_attr, 0))) + if (false !== ($tmp = @mysqli_stmt_attr_set($stmt, $invalid_attr, 0))) /* Although it may be desired to get false neither the MySQL Client Library nor mysqlnd are supposed to detect invalid codes */ printf([006b] Expecting boolean/true for attribute %d, got %s/%s\n, $invalid_attr, gettype($tmp), $tmp); } @@ -265,4 +265,4 @@ require_once(clean_table.inc); ? --EXPECTF-- -done! \ No newline at end of file +done! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/mysqli/ mysqli_api.c
andrey Fri, 25 Sep 2009 12:35:58 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288789 Log: Fix returned value, if mysql_stmt_attr_set fails then mysqli returns true, otherwise false. Wrong logic. Changed paths: U php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c Modified: php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c === --- php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c2009-09-25 12:33:27 UTC (rev 288788) +++ php/php-src/branches/PHP_5_2/ext/mysqli/mysqli_api.c2009-09-25 12:35:58 UTC (rev 288789) @@ -1848,14 +1848,13 @@ zval*mysql_stmt; ulong mode; ulong attr; - int rc; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), Oll, mysql_stmt, mysqli_stmt_class_entry, attr, mode) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt, MYSQLI_STATUS_VALID); - if ((rc = mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode))) { + if (FALSE == mysql_stmt_attr_set(stmt-stmt, attr, (void *)mode)) { RETURN_FALSE; } RETURN_TRUE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt
uw Fri, 25 Sep 2009 13:21:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288793 Log: Trying to respect time limit to please Andrey who must be using slooow hardware... Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt === --- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt 2009-09-25 13:01:19 UTC (rev 288792) +++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_fetch_array_large.phpt 2009-09-25 13:21:44 UTC (rev 288793) @@ -21,7 +21,11 @@ $sql = substr($sql, 0, -2); assert(strlen($sql) $package_size); - if (!mysqli_query($link, $sql)) { + if (!...@mysqli_query($link, $sql)) { + if (1153 == mysqli_errno($link) || stristr(mysqli_error($link), 'max_allowed_packet')) + /* [1153] Got a packet bigger than 'max_allowed_packet' bytes */ + return false; + printf([%03d + 1] [%d] %s\n, $offset, mysqli_errno($link), mysqli_error($link)); return false; } @@ -72,7 +76,26 @@ return true; } + function parse_memory_limit($limit) { + $val = trim($limit); + $last = strtolower($val[strlen($val)-1]); + + switch($last) { + // The 'G' modifier is available since PHP 5.1.0 + case 'g': + $val *= 1024; + case 'm': + $val *= 1024; + case 'k': + $val *= 1024; + default: + break; + } + return $val; + } + + if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { printf([001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n, $host, $user, $db, $port, $socket); @@ -82,12 +105,39 @@ !mysqli_query($link, sprintf(CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, label VARCHAR(255)) ENGINE = %s, $engine))) printf([002] [%d] %s\n, mysqli_errno($link), mysqli_error($link)); - $package_size = 32768; + $package_size = 524288; $offset = 3; - $limit = (0 ini_get('memory_limit')) ? pow(2, 32) : ini_get('memory_limit'); - while (($package_size $limit) mysqli_fetch_array_large($offset++, $link, $package_size)) + $limit = (ini_get('memory_limit') 0) ? parse_memory_limit(ini_get('memory_limit')) : pow(2, 32); + + /* try to respect php.ini but make run time a soft limit */ + $max_runtime = (ini_get('max_execution_time') 0) ? ini_get('max_execution_time') : 30; + set_time_limit(0); + + do { + if ($package_size $limit) { + printf(stop: memory limit - %s vs. %s\n, $package_size, $limit); + break; + } + + $start = microtime(true); + if (!mysqli_fetch_array_large($offset++, $link, $package_size)) { + printf(stop: packet size - %d\n, $package_size); + break; + } + + $duration = microtime(true) - $start; + $max_runtime -= $duration; + if ($max_runtime ($duration * 3)) { + /* likely the next iteration will not be within max_execution_time */ + printf(stop: time limit - %2.2fs\n, $max_runtime); + break; + } + $package_size += $package_size; + } while (true); + + mysqli_close($link); print done!; ? @@ -96,5 +146,5 @@ require_once(clean_table.inc); ? --EXPECTF-- -[%d + 1] [1153] Got a packet bigger than 'max_allowed_packet' bytes +stop: %s done! \ No newline at end of file Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt === --- php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt 2009-09-25 13:01:19 UTC (rev 288792) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_array_large.phpt 2009-09-25 13:21:44 UTC (rev 288793) @@ -21,7 +21,11 @@ $sql = substr($sql, 0, -2); assert(strlen($sql) $package_size); - if (!mysqli_query($link, $sql)) { + if
[PHP-CVS] svn: /SVNROOT/ global_avail
philip Fri, 25 Sep 2009 19:24:45 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288815 Log: - phpdoc karma for Alan Collison (ajcollison) Changed paths: U SVNROOT/global_avail Modified: SVNROOT/global_avail === --- SVNROOT/global_avail 2009-09-25 19:18:34 UTC (rev 288814) +++ SVNROOT/global_avail 2009-09-25 19:24:45 UTC (rev 288815) @@ -47,7 +47,7 @@ # The PHP Documentation Group maintains the documentation and its # translations. -avail|lucas,jmertic,bobby,takagi,gcc,cem,mfp,ansriniv,jsgoupil,mazzanet,frogger,coldocean,fleaslob,torben,lynch,kk,ted,paul,mbritton,bibi,mrobinso,perugini,tzwenny,drews,paulsen,hartmann,leon,jonen,tschuer,tfromm,manuel,danbeck,sli,jmcastagnetto,mohrt,samesch,soneca,ronabop,glace,latoserver,rafael,jcmeloni,chrullrich,mk,troels,mathieu,phaethon,mj,corean,pandach,cycle98,vizvil,regina,cynic,jpm,dams,karoora,pcraft,suvia,zimt,ftfuture,ag315,bbonev,afortaleza,neotron,cg,delrom,jkj,hellekin,kgergely,cnewbill,fuzzy74,bjoern,fams,smasiello,dim,lucasr,cpereira,ernani,theseer,noribsd,subjective,ufux,hadar_p,asautins,dbenson,aleczapka,tom,amiller,cortesi,rarruda,betz,alindeman,thyla,cucinato,zyprexia,tpug,mitja,conni,sts,nmav,subbie,leszek,spheroid,slawek,alan_dangelo,ae,nohn,kaser01,visualmind,kurtz,luk,tronic,moh,gerzson,webler,spooky,cece,daniel,boo,nhoizey,joerg,hakan,chief977,shlomi,raful,yuval,tomer,barak,ido,mork,lior,gal,adiju,cr_depend,florian,kappu,muricaru,dt,critix,ck,costra,fancao0515,tibee,eriksson,wenz,bs,anderson,matroz,ave,adu,mmeier,wentzel,scaro,aspinei,lmaxcar,manuzhai,darvina,peter,maxim,romakhin,n0nick,attila,sagi,kai,microbrain,rhheo,shimi,djworld,emil,lboshell,netholic,dmitry83,progcom,verdana,yincheng,surfmax,nicos,bbd,cyril,gregory,hudzilla,klean,mignoni,wiesemann,xqi,mersal,zruya,sean,staybyte,aber_sabeel,alzahrani,thomaslio,jippie,antonio,ahxiao,akcakayaa,allhibi,aner,black,class007,digo,dima,dorons,eshare,hpop1,itay,juppie,mrmatrix,saad,thomasgm,xbite,tobsn,jome,analytik,outsider,heymarcel,asmodean,bader,elmaystro,sp,truelight,gnuhacker,_batman_,sachat,dallas,dejan,zer0fill,steve3d,lm92,bradmssw,tahani,victor,erica,simonh,phpman,mrphp,notarius,joseph,mmkhajah,mohammed,proton,klootz,takashima,leoca,ahmad,abobader,fboudot,wurm,hakawy,felix,ahmedss,mahrous2020,yorgo,gal_ga,abodive,ama,andras,hassen,jkhdk,okamura,popov,xman,fernandoc,avenger,hwin,tix,alrehawi_,liuming,ramysaweres,astone,shiflett,jaenecke,bdensley,adamchan,jingfs,murphy,potatotsang,the_q,jsheets,xelis,equerci,phpcatala,tofanini,umut,kriga,ray,royhuggins,logician,almanar,alexws,gonik,haiaw,lkwang_cn,shadowwulf,telecart,pongsakorn,naveed,shivas,tularis,angela,decorj,hitcho,kevinkee,nmee,thx1140,crotalus,didou,novotnyr,sil,traduim,gui,mgf,ivanr,michal,tsirman,momo,cysoft,firefox,kouber,mipac,muslem,tomysk,vemarkov,garth,lord_lele,stone,laacz,retnug,ernestyang,hatem,house,luisdaniel,nizar,nvivo,seth,tomh,danguer,adam,nio,wassago,beeven,colacino,zvaranka,cesarguru,chubu,dark2907,portoban,reven,wizzard,sywr,koendw83,rylin,webstudio,jsjohnst,dmanusset,et,pitiphan,mbr,cdalar,alrashoudi,hafid,enough,zhouhao007,jnorbi,lorenzohgh,denisr,coder03,jcclaros,thomas,freeman,rioter,jschultz,davey,belleto,jtacon,yuw,elfyn,noam,nathan,salman,cheezy,ene,rezaiqbal,purnomo,dufiga_php,ftp_geo,udhien,prio,luckyguy354,maf,handi,meme,satiri,maddankara,rildo,hd,ali,lpj,adhitama,engkongs,preilly,dave,marcelo,curt,fd,javi,mrmaster,fa,vrana,apaxx,pjotrik,marduk,narcotia1234,enloma,trizo,xmadda,redshift,alifikri,coder,dodol_maniac,eflorin,adywarna,kyokpae,milans,lovchy,spermwhale,phaze,baoengb,derek,yannick,daan,xxiengb,ott,mg,kennyt,tomsommer,poz,zamolxe,bishmila,ph1,irchtml,rogamer,bortolini,sapfir,guru,ahmed,robinhood,sohli,amt,romain,hlecuanda,thessoro,nforbes,jolan,laze,bagilevi,young,shakaali,chokobo,portalufpa,teecee,blindman,holst,schst,mnv,sodhi,aidan,jellybob,lauer,shenkong,jad,robert,peterhuewe,ogre,techtonik,narigone,realtebo,krid,mclay,dasch,miwaniec,abdshomad,sammywg,aeoris,mez,jed,hsc,luckec,dmytton,choudesh,phpvcn,simp,michael,grantc,atex,katja,sthulbourn,mikl,kevinsz,roast,tessus,gavinfo,rant,ramsey,arkadius,erinet,omar,oliver,rquadling,timo,shadda,joeaccord,ezyang,ljbuesch,knut,asonge,ron,nicobn,jacques,void,mcbrown,simionea,preinheimer,stanprog,msaraujo,asbjornit,philippe,sezer,rmlr,hradtke,alan,danielc,danbrown,alexxed,psalehpoor,loudi,abedford,morgue,nilgun,saltybeagle,dedemorton,eniac2008,jawed,ch,mgdm,ericstewart,mager,keito,juxecl,salathe,chx,vito,beverloo,joris,mumumu,brandon,santiago|phpdoc,phd,web/doc,web/doc-editor
[PHP-CVS] svn: /SVNROOT/ global_avail
philip Fri, 25 Sep 2009 19:37:28 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288818 Log: - phpdoc karma for Rich Bowen (rbowen) Changed paths: U SVNROOT/global_avail Modified: SVNROOT/global_avail === --- SVNROOT/global_avail 2009-09-25 19:32:12 UTC (rev 288817) +++ SVNROOT/global_avail 2009-09-25 19:37:28 UTC (rev 288818) @@ -47,7 +47,7 @@ # The PHP Documentation Group maintains the documentation and its # translations. -avail|lucas,jmertic,bobby,takagi,gcc,cem,mfp,ansriniv,jsgoupil,mazzanet,frogger,coldocean,fleaslob,torben,lynch,kk,ted,paul,mbritton,bibi,mrobinso,perugini,tzwenny,drews,paulsen,hartmann,leon,jonen,tschuer,tfromm,manuel,danbeck,sli,jmcastagnetto,mohrt,samesch,soneca,ronabop,glace,latoserver,rafael,jcmeloni,chrullrich,mk,troels,mathieu,phaethon,mj,corean,pandach,cycle98,vizvil,regina,cynic,jpm,dams,karoora,pcraft,suvia,zimt,ftfuture,ag315,bbonev,afortaleza,neotron,cg,delrom,jkj,hellekin,kgergely,cnewbill,fuzzy74,bjoern,fams,smasiello,dim,lucasr,cpereira,ernani,theseer,noribsd,subjective,ufux,hadar_p,asautins,dbenson,aleczapka,tom,amiller,cortesi,rarruda,betz,alindeman,thyla,cucinato,zyprexia,tpug,mitja,conni,sts,nmav,subbie,leszek,spheroid,slawek,alan_dangelo,ae,nohn,kaser01,visualmind,kurtz,luk,tronic,moh,gerzson,webler,spooky,cece,daniel,boo,nhoizey,joerg,hakan,chief977,shlomi,raful,yuval,tomer,barak,ido,mork,lior,gal,adiju,cr_depend,florian,kappu,muricaru,dt,critix,ck,costra,fancao0515,tibee,eriksson,wenz,bs,anderson,matroz,ave,adu,mmeier,wentzel,scaro,aspinei,lmaxcar,manuzhai,darvina,peter,maxim,romakhin,n0nick,attila,sagi,kai,microbrain,rhheo,shimi,djworld,emil,lboshell,netholic,dmitry83,progcom,verdana,yincheng,surfmax,nicos,bbd,cyril,gregory,hudzilla,klean,mignoni,wiesemann,xqi,mersal,zruya,sean,staybyte,aber_sabeel,alzahrani,thomaslio,jippie,antonio,ahxiao,akcakayaa,allhibi,aner,black,class007,digo,dima,dorons,eshare,hpop1,itay,juppie,mrmatrix,saad,thomasgm,xbite,tobsn,jome,analytik,outsider,heymarcel,asmodean,bader,elmaystro,sp,truelight,gnuhacker,_batman_,sachat,dallas,dejan,zer0fill,steve3d,lm92,bradmssw,tahani,victor,erica,simonh,phpman,mrphp,notarius,joseph,mmkhajah,mohammed,proton,klootz,takashima,leoca,ahmad,abobader,fboudot,wurm,hakawy,felix,ahmedss,mahrous2020,yorgo,gal_ga,abodive,ama,andras,hassen,jkhdk,okamura,popov,xman,fernandoc,avenger,hwin,tix,alrehawi_,liuming,ramysaweres,astone,shiflett,jaenecke,bdensley,adamchan,jingfs,murphy,potatotsang,the_q,jsheets,xelis,equerci,phpcatala,tofanini,umut,kriga,ray,royhuggins,logician,almanar,alexws,gonik,haiaw,lkwang_cn,shadowwulf,telecart,pongsakorn,naveed,shivas,tularis,angela,decorj,hitcho,kevinkee,nmee,thx1140,crotalus,didou,novotnyr,sil,traduim,gui,mgf,ivanr,michal,tsirman,momo,cysoft,firefox,kouber,mipac,muslem,tomysk,vemarkov,garth,lord_lele,stone,laacz,retnug,ernestyang,hatem,house,luisdaniel,nizar,nvivo,seth,tomh,danguer,adam,nio,wassago,beeven,colacino,zvaranka,cesarguru,chubu,dark2907,portoban,reven,wizzard,sywr,koendw83,rylin,webstudio,jsjohnst,dmanusset,et,pitiphan,mbr,cdalar,alrashoudi,hafid,enough,zhouhao007,jnorbi,lorenzohgh,denisr,coder03,jcclaros,thomas,freeman,rioter,jschultz,davey,belleto,jtacon,yuw,elfyn,noam,nathan,salman,cheezy,ene,rezaiqbal,purnomo,dufiga_php,ftp_geo,udhien,prio,luckyguy354,maf,handi,meme,satiri,maddankara,rildo,hd,ali,lpj,adhitama,engkongs,preilly,dave,marcelo,curt,fd,javi,mrmaster,fa,vrana,apaxx,pjotrik,marduk,narcotia1234,enloma,trizo,xmadda,redshift,alifikri,coder,dodol_maniac,eflorin,adywarna,kyokpae,milans,lovchy,spermwhale,phaze,baoengb,derek,yannick,daan,xxiengb,ott,mg,kennyt,tomsommer,poz,zamolxe,bishmila,ph1,irchtml,rogamer,bortolini,sapfir,guru,ahmed,robinhood,sohli,amt,romain,hlecuanda,thessoro,nforbes,jolan,laze,bagilevi,young,shakaali,chokobo,portalufpa,teecee,blindman,holst,schst,mnv,sodhi,aidan,jellybob,lauer,shenkong,jad,robert,peterhuewe,ogre,techtonik,narigone,realtebo,krid,mclay,dasch,miwaniec,abdshomad,sammywg,aeoris,mez,jed,hsc,luckec,dmytton,choudesh,phpvcn,simp,michael,grantc,atex,katja,sthulbourn,mikl,kevinsz,roast,tessus,gavinfo,rant,ramsey,arkadius,erinet,omar,oliver,rquadling,timo,shadda,joeaccord,ezyang,ljbuesch,knut,asonge,ron,nicobn,jacques,void,mcbrown,simionea,preinheimer,stanprog,msaraujo,asbjornit,philippe,sezer,rmlr,hradtke,alan,danielc,danbrown,alexxed,psalehpoor,loudi,abedford,morgue,nilgun,saltybeagle,dedemorton,eniac2008,jawed,ch,mgdm,ericstewart,mager,keito,juxecl,salathe,chx,vito,beverloo,joris,mumumu,brandon,santiago,ajcollison|phpdoc,phd,web/doc,web/doc-editor
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/date/php_date.c branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c
rasmus Sat, 26 Sep 2009 00:53:59 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288834 Log: Refix bug #49558 as per bug #49676 Bugs: http://bugs.php.net/49558 (Closed) Sunrise Problems around 91 degree zenith http://bugs.php.net/49676 (Closed) date_sunrise() off by several minutes Changed paths: U php/php-src/branches/PHP_5_2/ext/date/php_date.c U php/php-src/branches/PHP_5_3/ext/date/php_date.c U php/php-src/trunk/ext/date/php_date.c Modified: php/php-src/branches/PHP_5_2/ext/date/php_date.c === --- php/php-src/branches/PHP_5_2/ext/date/php_date.c2009-09-26 00:40:56 UTC (rev 288833) +++ php/php-src/branches/PHP_5_2/ext/date/php_date.c2009-09-26 00:53:59 UTC (rev 288834) @@ -2456,7 +2456,7 @@ } timelib_unixtime2local(t, time); - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, calc_sunset?0:1, h_rise, h_set, rise, set, transit); + rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, 1, h_rise, h_set, rise, set, transit); timelib_time_dtor(t); if (rs != 0) { Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c === --- php/php-src/branches/PHP_5_3/ext/date/php_date.c2009-09-26 00:40:56 UTC (rev 288833) +++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2009-09-26 00:53:59 UTC (rev 288834) @@ -3927,7 +3927,7 @@ } timelib_unixtime2local(t, time); - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, calc_sunset?0:1, h_rise, h_set, rise, set, transit); + rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, 1, h_rise, h_set, rise, set, transit); timelib_time_dtor(t); if (rs != 0) { Modified: php/php-src/trunk/ext/date/php_date.c === --- php/php-src/trunk/ext/date/php_date.c 2009-09-26 00:40:56 UTC (rev 288833) +++ php/php-src/trunk/ext/date/php_date.c 2009-09-26 00:53:59 UTC (rev 288834) @@ -4049,7 +4049,7 @@ } timelib_unixtime2local(t, time); - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, calc_sunset?0:1, h_rise, h_set, rise, set, transit); + rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, 1, h_rise, h_set, rise, set, transit); timelib_time_dtor(t); if (rs != 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php