Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/run-tests.php branches/PHP_5_3/run-tests.php trunk/run-tests.php
Hi Kalle, + if ($value{$len - 1} == '') { + $value{0} = '; + $value{$len - 1} = '; + } Aren't curly braces deprecated? ;) Cheers -- Matteo Beccati Development Consulting - http://www.beccati.com/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_exceptions.h
sas Tue, 17 Aug 2010 12:14:52 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302385 Log: align declaration with definition (patch by kalle) Changed paths: U php/php-src/trunk/Zend/zend_exceptions.h Modified: php/php-src/trunk/Zend/zend_exceptions.h === --- php/php-src/trunk/Zend/zend_exceptions.h2010-08-17 12:00:29 UTC (rev 302384) +++ php/php-src/trunk/Zend/zend_exceptions.h2010-08-17 12:14:52 UTC (rev 302385) @@ -30,7 +30,7 @@ ZEND_API void zend_exception_save(TSRMLS_D); ZEND_API void zend_exception_restore(TSRMLS_D); -void zend_throw_exception_internal(zval *exception TSRMLS_DC); +ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC); void zend_register_default_exception(TSRMLS_D); -- 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/NEWS branches/PHP_5_3/ext/standard/file.c branches/PHP_5_3/ext/standard/file.h trunk/ext/standard/basic_functions.c trunk/ext/standard/file.c trunk/ext/st
kalleTue, 17 Aug 2010 12:17:28 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302386 Log: Fixed the $context parameter on copy() to have an effect (approved for 5.3 by Johannes) # To not change a PHPAPI in a point release, a new function have been added to support contexts: # php_copy_file_ctx(), php_copy_file_ex() now simply wraps to that Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/file.c U php/php-src/branches/PHP_5_3/ext/standard/file.h U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/file.c U php/php-src/trunk/ext/standard/file.h Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-08-17 12:14:52 UTC (rev 302385) +++ php/php-src/branches/PHP_5_3/NEWS 2010-08-17 12:17:28 UTC (rev 302386) @@ -9,6 +9,7 @@ - Changed deprecated ini options on startup from E_WARNING to E_DEPRECATED. (Kalle) +- Changed the $context parameter on copy() to actually have an effect. (Kalle) - Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe) - Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values). Modified: php/php-src/branches/PHP_5_3/ext/standard/file.c === --- php/php-src/branches/PHP_5_3/ext/standard/file.c2010-08-17 12:14:52 UTC (rev 302385) +++ php/php-src/branches/PHP_5_3/ext/standard/file.c2010-08-17 12:17:28 UTC (rev 302386) @@ -1694,7 +1694,7 @@ context = php_stream_context_from_zval(zcontext, 0); - if (php_copy_file(source, target TSRMLS_CC) == SUCCESS) { + if (php_copy_file_ctx(source, target, 0, context TSRMLS_CC) == SUCCESS) { RETURN_TRUE; } else { RETURN_FALSE; @@ -1702,21 +1702,31 @@ } /* }}} */ -PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC) /* {{{ */ +/* {{{ php_copy_file + */ +PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC) { - return php_copy_file_ex(src, dest, ENFORCE_SAFE_MODE TSRMLS_CC); + return php_copy_file_ctx(src, dest, ENFORCE_SAFE_MODE, NULL TSRMLS_CC); } /* }}} */ -/* {{{ php_copy_file +/* {{{ php_copy_file_ex */ PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC) { + return php_copy_file_ctx(src, dest, ENFORCE_SAFE_MODE, NULL TSRMLS_CC); +} +/* }}} */ + +/* {{{ php_copy_file_ctx + */ +PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_chk, php_stream_context *context TSRMLS_DC) +{ php_stream *srcstream = NULL, *deststream = NULL; int ret = FAILURE; php_stream_statbuf src_s, dest_s; - switch (php_stream_stat_path_ex(src, 0, src_s, NULL)) { + switch (php_stream_stat_path_ex(src, 0, src_s, context)) { case -1: /* non-statable stream */ goto safe_to_copy; @@ -1731,7 +1741,7 @@ return FAILURE; } - switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, dest_s, NULL)) { + switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, dest_s, context)) { case -1: /* non-statable stream */ goto safe_to_copy; @@ -1781,13 +1791,13 @@ } safe_to_copy: - srcstream = php_stream_open_wrapper(src, rb, src_chk | REPORT_ERRORS, NULL); + srcstream = php_stream_open_wrapper_ex(src, rb, src_chk | REPORT_ERRORS, NULL, context); if (!srcstream) { return ret; } - deststream = php_stream_open_wrapper(dest, wb, ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); + deststream = php_stream_open_wrapper_ex(dest, wb, ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); if (srcstream deststream) { ret = php_stream_copy_to_stream_ex(srcstream, deststream, PHP_STREAM_COPY_ALL, NULL); Modified: php/php-src/branches/PHP_5_3/ext/standard/file.h === --- php/php-src/branches/PHP_5_3/ext/standard/file.h2010-08-17 12:14:52 UTC (rev 302385) +++ php/php-src/branches/PHP_5_3/ext/standard/file.h2010-08-17 12:17:28 UTC (rev 302386) @@ -76,6 +76,7 @@ PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC); PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC); PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC); +PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_chk, php_stream_context *context TSRMLS_DC); PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC); PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC); PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value
[PHP-CVS] svn: /php/php-src/trunk/main/ SAPI.c main.c rfc1867.c snprintf.c streams/glob_wrapper.c
kalleTue, 17 Aug 2010 12:49:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302387 Log: Fixed compiler warnings in main/ Changed paths: U php/php-src/trunk/main/SAPI.c U php/php-src/trunk/main/main.c U php/php-src/trunk/main/rfc1867.c U php/php-src/trunk/main/snprintf.c U php/php-src/trunk/main/streams/glob_wrapper.c Modified: php/php-src/trunk/main/SAPI.c === --- php/php-src/trunk/main/SAPI.c 2010-08-17 12:17:28 UTC (rev 302386) +++ php/php-src/trunk/main/SAPI.c 2010-08-17 12:49:19 UTC (rev 302387) @@ -570,7 +570,6 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) { - int retval; sapi_header_struct sapi_header; char *colon_offset; long myuid = 0L; Modified: php/php-src/trunk/main/main.c === --- php/php-src/trunk/main/main.c 2010-08-17 12:17:28 UTC (rev 302386) +++ php/php-src/trunk/main/main.c 2010-08-17 12:49:19 UTC (rev 302387) @@ -1621,7 +1621,7 @@ zend_bool send_buffer = SG(request_info).headers_only ? 0 : 1; if (CG(unclean_shutdown) PG(last_error_type) == E_ERROR - PG(memory_limit) zend_memory_usage(1 TSRMLS_CC) + (size_t)PG(memory_limit) zend_memory_usage(1 TSRMLS_CC) ) { send_buffer = 0; } Modified: php/php-src/trunk/main/rfc1867.c === --- php/php-src/trunk/main/rfc1867.c2010-08-17 12:17:28 UTC (rev 302386) +++ php/php-src/trunk/main/rfc1867.c2010-08-17 12:49:19 UTC (rev 302387) @@ -769,7 +769,7 @@ int fd = -1; zend_llist header; void *event_extra_data = NULL; - int llen = 0; + unsigned int llen = 0; int upload_cnt = INI_INT(max_file_uploads); if (SG(post_max_size) 0 SG(request_info).content_length SG(post_max_size)) { @@ -1066,12 +1066,12 @@ } } - if (PG(upload_max_filesize) 0 (total_bytes+blen) PG(upload_max_filesize)) { + if (PG(upload_max_filesize) 0 (long)(total_bytes+blen) PG(upload_max_filesize)) { #if DEBUG_FILE_UPLOAD sapi_module.sapi_error(E_NOTICE, upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved, PG(upload_max_filesize), param, filename); #endif cancel_upload = UPLOAD_ERROR_A; - } else if (max_file_size ((total_bytes+blen) max_file_size)) { + } else if (max_file_size ((long)(total_bytes+blen) max_file_size)) { #if DEBUG_FILE_UPLOAD sapi_module.sapi_error(E_NOTICE, MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved, max_file_size, param, filename); #endif Modified: php/php-src/trunk/main/snprintf.c === --- php/php-src/trunk/main/snprintf.c 2010-08-17 12:17:28 UTC (rev 302386) +++ php/php-src/trunk/main/snprintf.c 2010-08-17 12:49:19 UTC (rev 302387) @@ -1220,7 +1220,7 @@ PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */ { - int cc; + unsigned int cc; va_list ap; va_start(ap, format); @@ -1236,7 +1236,7 @@ PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */ { - int cc; + unsigned int cc; strx_printv(cc, buf, len, format, ap); if (cc = len) { Modified: php/php-src/trunk/main/streams/glob_wrapper.c === --- php/php-src/trunk/main/streams/glob_wrapper.c 2010-08-17 12:17:28 UTC (rev 302386) +++ php/php-src/trunk/main/streams/glob_wrapper.c 2010-08-17 12:49:19 UTC (rev 302387) @@ -144,7 +144,7 @@ /* avoid problems if someone mis-uses the stream */ if (count == sizeof(php_stream_dirent) pglob) { - if (pglob-index pglob-glob.gl_pathc) { + if (pglob-index (size_t)pglob-glob.gl_pathc) { php_glob_stream_path_split(pglob, pglob-glob.gl_pathv[pglob-index++], pglob-flags GLOB_APPEND, path TSRMLS_CC); PHP_STRLCPY(ent-d_name, path, sizeof(ent-d_name), strlen(path)); return sizeof(php_stream_dirent); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/win32/ glob.c
kalleTue, 17 Aug 2010 12:57:04 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302388 Log: Fixed compiler warning Changed paths: U php/php-src/trunk/win32/glob.c Modified: php/php-src/trunk/win32/glob.c === --- php/php-src/trunk/win32/glob.c 2010-08-17 12:49:19 UTC (rev 302387) +++ php/php-src/trunk/win32/glob.c 2010-08-17 12:57:04 UTC (rev 302388) @@ -519,8 +519,7 @@ } static int -compare(p, q) - const void *p, *q; +compare(const void *p, const void *q) { return(strcmp(*(char **)p, *(char **)q)); } -- 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/standard/ basic_functions.c
kalleTue, 17 Aug 2010 13:34:11 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302389 Log: Fix my fix for arginfo, trunk patch will follow shortly Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2010-08-17 12:57:04 UTC (rev 302388) +++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2010-08-17 13:34:11 UTC (rev 302389) @@ -1210,7 +1210,7 @@ ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_copy, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_copy, 0, 0, 2) ZEND_ARG_INFO(0, source_file) ZEND_ARG_INFO(0, destination_file) ZEND_ARG_INFO(0, context) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/run-tests.php branches/PHP_5_3/run-tests.php trunk/run-tests.php
Hi Matteo 2010/8/17 Matteo Beccati p...@beccati.com: Hi Kalle Aren't curly braces deprecated? ;) After reading the manual, yeah in 5.3+ they are. They don't however throw an E_DEPRECATED notice so unless consulting the manual I don't think so many are aware of it, including myself. As for changing it, I will commit a patch for changing it back sometime later this week. On another plan, I for one like to keep the syntax, since PHP is a loosely typed language it can quickly create confusion whether you are reading with an array or string index, plus I think its just as readable. But I will probably end up doing an RFC for this some later time this month, as I'm an extensive user of curly braces for string indexes in all my string based parsers. -- regards, Kalle Sommer Nielsen ka...@php.net -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysql/ php_mysql.c tests/mysql_db_name.phpt tests/mysql_list_dbs.phpt
andrey Tue, 17 Aug 2010 15:37:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302392 Log: Deprecate mysql_list_dbs, as mysql_list_tables is already deprecated. As well as mysql_list Changed paths: U php/php-src/trunk/ext/mysql/php_mysql.c U php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt U php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt Modified: php/php-src/trunk/ext/mysql/php_mysql.c === --- php/php-src/trunk/ext/mysql/php_mysql.c 2010-08-17 15:15:35 UTC (rev 302391) +++ php/php-src/trunk/ext/mysql/php_mysql.c 2010-08-17 15:37:44 UTC (rev 302392) @@ -1575,11 +1575,13 @@ id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); CHECK_LINK(id); } + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, This function is deprecated; use mysql_query() with SHOW DATABASES instead); ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, MySQL-Link, le_link, le_plink); PHPMY_UNBUFFERED_QUERY_CHECK(); + if ((mysql_result=mysql_list_dbs(mysql-conn, NULL))==NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to save MySQL query result); RETURN_FALSE; Modified: php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt === --- php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt2010-08-17 15:15:35 UTC (rev 302391) +++ php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt2010-08-17 15:37:44 UTC (rev 302392) @@ -58,6 +58,8 @@ print done!\n; ? --EXPECTF-- +Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d + Warning: mysql_db_name(): Unable to jump to row -1 on MySQL result index %d in %s on line %d Warning: mysql_db_name(): Unable to jump to row %d on MySQL result index %d in %s on line %d Modified: php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt === --- php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt 2010-08-17 15:15:35 UTC (rev 302391) +++ php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt 2010-08-17 15:37:44 UTC (rev 302392) @@ -51,4 +51,7 @@ require_once(clean_table.inc); ? --EXPECTF-- +Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d + +Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d done! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS
andrey Tue, 17 Aug 2010 15:39:26 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302393 Log: here comes the news Changed paths: U php/php-src/trunk/NEWS Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-08-17 15:37:44 UTC (rev 302392) +++ php/php-src/trunk/NEWS 2010-08-17 15:39:26 UTC (rev 302393) @@ -89,6 +89,8 @@ - Removed support for linking against MySQL client libraries older 4.1 from PDO_mysql. (Johannes) +- Deprecated mysql_list_dbs() (Request #50667). (Andrey) + - Implemented FR #52555 (Ability to get HTTP response code). (Paul Dragoonis) - Implemented FR #51295 (SQLite3::busyTimeout not existing). (Mark) - Implemented FR #48632 (OpenSSL AES support). (yonas dot y -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysql/ php_mysql.c tests/mysql_db_name.phpt tests/mysql_list_dbs.phpt
andrey Tue, 17 Aug 2010 17:40:31 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302395 Log: Use PHP_DEP_FE - good for reflection Changed paths: U php/php-src/trunk/ext/mysql/php_mysql.c U php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt U php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt Modified: php/php-src/trunk/ext/mysql/php_mysql.c === --- php/php-src/trunk/ext/mysql/php_mysql.c 2010-08-17 17:14:33 UTC (rev 302394) +++ php/php-src/trunk/ext/mysql/php_mysql.c 2010-08-17 17:40:31 UTC (rev 302395) @@ -251,8 +251,8 @@ #endif /* NETWARE */ PHP_FE(mysql_query, arginfo_mysql_query) PHP_FE(mysql_unbuffered_query, arginfo_mysql_query) - PHP_FE(mysql_db_query, arginfo_mysql_db_query) - PHP_FE(mysql_list_dbs, arginfo__optional_mysql_link) + PHP_DEP_FE(mysql_db_query, arginfo_mysql_db_query) + PHP_DEP_FE(mysql_list_dbs, arginfo__optional_mysql_link) PHP_DEP_FE(mysql_list_tables, arginfo_mysql_select_db) PHP_FE(mysql_list_fields, arginfo_mysql_list_fields) PHP_FE(mysql_list_processes, arginfo__optional_mysql_link) Modified: php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt === --- php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt2010-08-17 17:14:33 UTC (rev 302394) +++ php/php-src/trunk/ext/mysql/tests/mysql_db_name.phpt2010-08-17 17:40:31 UTC (rev 302395) @@ -58,6 +58,8 @@ print done!\n; ? --EXPECTF-- +Deprecated: Function mysql_list_dbs() is deprecated in %s on line %d + Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d Warning: mysql_db_name(): Unable to jump to row -1 on MySQL result index %d in %s on line %d Modified: php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt === --- php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt 2010-08-17 17:14:33 UTC (rev 302394) +++ php/php-src/trunk/ext/mysql/tests/mysql_list_dbs.phpt 2010-08-17 17:40:31 UTC (rev 302395) @@ -51,6 +51,8 @@ require_once(clean_table.inc); ? --EXPECTF-- +Deprecated: Function mysql_list_dbs() is deprecated in %s on line 15 + Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d -- 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/mysql/ php_mysql.c tests/mysql_trace_mode.phpt
andrey Tue, 17 Aug 2010 18:07:11 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302396 Log: Update with PHP_DEF_FE, also update the test Changed paths: U php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c U php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_trace_mode.phpt Modified: php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c === --- php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c 2010-08-17 17:40:31 UTC (rev 302395) +++ php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c 2010-08-17 18:07:11 UTC (rev 302396) @@ -251,7 +251,7 @@ #endif /* NETWARE */ PHP_FE(mysql_query, arginfo_mysql_query) PHP_FE(mysql_unbuffered_query, arginfo_mysql_query) - PHP_FE(mysql_db_query, arginfo_mysql_db_query) + PHP_DEP_FE(mysql_db_query, arginfo_mysql_db_query) PHP_FE(mysql_list_dbs, arginfo__optional_mysql_link) PHP_DEP_FE(mysql_list_tables, arginfo_mysql_select_db) PHP_FE(mysql_list_fields, arginfo_mysql_list_fields) Modified: php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_trace_mode.phpt === --- php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_trace_mode.phpt 2010-08-17 17:40:31 UTC (rev 302395) +++ php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_trace_mode.phpt 2010-08-17 18:07:11 UTC (rev 302396) @@ -29,6 +29,8 @@ require_once(clean_table.inc); ? --EXPECTF-- +Deprecated: Function mysql_db_query() is deprecated in %s on line %d + Deprecated: mysql_db_query(): %s Deprecated: mysql_escape_string(): %s -- 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_result.c trunk/ext/mysqlnd/mysqlnd_result.c
andrey Tue, 17 Aug 2010 18:08:25 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302398 Log: Fix for Bug #52613 crash in mysqlnd Bug: http://bugs.php.net/52613 (Assigned) crash in mysqlnd Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c 2010-08-17 18:07:19 UTC (rev 302397) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c 2010-08-17 18:08:25 UTC (rev 302398) @@ -91,7 +91,11 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, enum_mysqlnd_res_type type, zend_bool * copy_ctor_called TSRMLS_DC) { DBG_ENTER(mysqlnd_palloc_zval_ptr_dtor); - + if (!zv || !*zv) { + *copy_ctor_called = FALSE; + DBG_ERR_FMT(zv was NULL); + DBG_VOID_RETURN; + } /* This zval is not from the cache block. Thus the refcount is -1 than of a zval from the cache, @@ -158,17 +162,16 @@ for (i = 0; i result-field_count; i++) { mysqlnd_palloc_zval_ptr_dtor((unbuf-last_row_data[i]), result-type, copy_ctor_called TSRMLS_CC); if (copy_ctor_called) { - ctor_called_count++; + ++ctor_called_count; } } DBG_INF_FMT(copy_ctor_called_count=%u, ctor_called_count); /* By using value3 macros we hold a mutex only once, there is no value2 */ - MYSQLND_INC_CONN_STATISTIC_W_VALUE3(global_stats, + MYSQLND_INC_CONN_STATISTIC_W_VALUE2(global_stats, STAT_COPY_ON_WRITE_PERFORMED, ctor_called_count, STAT_COPY_ON_WRITE_SAVED, - result-field_count - ctor_called_count, - STAT_COPY_ON_WRITE_PERFORMED, 0); + result-field_count - ctor_called_count); /* Free last row's zvals */ mnd_efree(unbuf-last_row_data); @@ -199,6 +202,8 @@ DBG_INF(Freeing data row_buffer); if (set-data) { + unsigned int copy_on_write_performed = 0; + unsigned int copy_on_write_saved = 0; DBG_INF_FMT(before: real_usage=%lu usage=%lu, zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC)); for (row = set-row_count - 1; row = 0; row--) { @@ -206,16 +211,21 @@ MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set-row_buffers[row]; int col; - for (col = field_count - 1; col = 0; --col) { - zend_bool copy_ctor_called; - if (current_row == NULL || current_row[0] == NULL) { - break;/* row that was never initialized */ - } - mysqlnd_palloc_zval_ptr_dtor((current_row[col]), result-type, copy_ctor_called TSRMLS_CC); + if (current_row != NULL) { + for (col = field_count - 1; col = 0; --col) { + if (current_row[col]) { + zend_bool copy_ctor_called; + mysqlnd_palloc_zval_ptr_dtor((current_row[col]), result-type, copy_ctor_called TSRMLS_CC); #if MYSQLND_DEBUG_MEMORY - DBG_INF_FMT(Copy_ctor_called=%u, copy_ctor_called); + DBG_INF_FMT(Copy_ctor_called=%u, copy_ctor_called); #endif - MYSQLND_INC_GLOBAL_STATISTIC(copy_ctor_called? STAT_COPY_ON_WRITE_PERFORMED: STAT_COPY_ON_WRITE_SAVED); + if (copy_ctor_called) { + ++copy_on_write_performed; + } else { + ++copy_on_write_saved; + } + } + } } #if MYSQLND_DEBUG_MEMORY DBG_INF(Freeing
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
andrey Tue, 17 Aug 2010 18:10:08 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302399 Log: here comes the news Changed paths: U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-08-17 18:08:25 UTC (rev 302398) +++ php/php-src/branches/PHP_5_3/NEWS 2010-08-17 18:10:08 UTC (rev 302399) @@ -11,6 +11,7 @@ (Kalle) - Changed the $context parameter on copy() to actually have an effect. (Kalle) +- Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey) - Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe) - Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values). (Felipe) -- 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/Zend/zend_compile.c branches/PHP_5_3/ext/spl/spl_directory.c branches/PHP_5_3/ext/spl/tests/bug52573.phpt trunk/Zend/zend_compile.c trunk/ext/spl/spl_dire
felipe Wed, 18 Aug 2010 01:59:37 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302420 Log: - Improved fix for bug #52573 Bug: http://bugs.php.net/52573 (Closed) SplFileObject::fscanf Segmentation fault Changed paths: U php/php-src/branches/PHP_5_3/Zend/zend_compile.c U php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c U php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt U php/php-src/trunk/Zend/zend_compile.c U php/php-src/trunk/ext/spl/spl_directory.c U php/php-src/trunk/ext/spl/tests/bug52573.phpt Modified: php/php-src/branches/PHP_5_3/Zend/zend_compile.c === --- php/php-src/branches/PHP_5_3/Zend/zend_compile.c2010-08-18 01:28:15 UTC (rev 302419) +++ php/php-src/branches/PHP_5_3/Zend/zend_compile.c2010-08-18 01:59:37 UTC (rev 302420) @@ -2551,7 +2551,8 @@ return 0; } - if (proto-common.pass_rest_by_reference + if (fe-common.type != ZEND_USER_FUNCTION +proto-common.pass_rest_by_reference !fe-common.pass_rest_by_reference) { return 0; } Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c === --- php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c2010-08-18 01:28:15 UTC (rev 302419) +++ php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c2010-08-18 01:59:37 UTC (rev 302420) @@ -2583,7 +2583,7 @@ ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 1, 0, 1) ZEND_ARG_INFO(0, format) ZEND_END_ARG_INFO() Modified: php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt === --- php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt2010-08-18 01:28:15 UTC (rev 302419) +++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug52573.phpt2010-08-18 01:59:37 UTC (rev 302420) @@ -1,12 +1,18 @@ --TEST-- Bug #52573 (SplFileObject::fscanf Segmentation fault) --FILE-- -?php +?php // test $result = null; $f = new SplFileObject(__FILE__, 'r'); -$f-fscanf('?php // %s', $result); - +var_dump($f-fscanf('?php // %s', $result)); +var_dump($result); +var_dump($f-fscanf('?php // %s')); ? --EXPECTF-- -Warning: Parameter 3 to fscanf() expected to be a reference, value given in %s on line 5 +int(1) +string(4) test +array(1) { + [0]= + NULL +} Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-08-18 01:28:15 UTC (rev 302419) +++ php/php-src/trunk/Zend/zend_compile.c 2010-08-18 01:59:37 UTC (rev 302420) @@ -2922,7 +2922,8 @@ return 0; } - if (proto-common.pass_rest_by_reference + if (fe-common.type != ZEND_USER_FUNCTION +proto-common.pass_rest_by_reference !fe-common.pass_rest_by_reference) { return 0; } Modified: php/php-src/trunk/ext/spl/spl_directory.c === --- php/php-src/trunk/ext/spl/spl_directory.c 2010-08-18 01:28:15 UTC (rev 302419) +++ php/php-src/trunk/ext/spl/spl_directory.c 2010-08-18 01:59:37 UTC (rev 302420) @@ -2586,7 +2586,7 @@ ZEND_ARG_INFO(0, allowable_tags) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 1, 0, 1) ZEND_ARG_INFO(0, format) ZEND_END_ARG_INFO() Modified: php/php-src/trunk/ext/spl/tests/bug52573.phpt === --- php/php-src/trunk/ext/spl/tests/bug52573.phpt 2010-08-18 01:28:15 UTC (rev 302419) +++ php/php-src/trunk/ext/spl/tests/bug52573.phpt 2010-08-18 01:59:37 UTC (rev 302420) @@ -1,12 +1,18 @@ --TEST-- Bug #52573 (SplFileObject::fscanf Segmentation fault) --FILE-- -?php +?php // test $result = null; $f = new SplFileObject(__FILE__, 'r'); -$f-fscanf('?php // %s', $result); - +var_dump($f-fscanf('?php // %s', $result)); +var_dump($result); +var_dump($f-fscanf('?php // %s')); ? --EXPECTF-- -Warning: Parameter 3 to fscanf() expected to be a reference, value given in %s on line 5 +int(1) +string(4) test +array(1) { + [0]= + NULL +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php