[PHP-CVS] cvs: php-src(PHP_5_3) /ext/gmp gmp.c /ext/gmp/tests 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 01
stasThu Nov 1 00:46:13 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/gmpgmp.c /php-src/ext/gmp/tests 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 019.phpt 020.phpt 021.phpt 022.phpt 023.phpt 024.phpt 025.phpt 026.phpt 027.phpt 028.phpt 029.phpt 030.phpt 031.phpt 032.phpt 033.phpt 034.phpt 035.phpt 036.phpt 037.phpt 038.phpt 039.phpt Log: - Fix memory leaks (bug #42509) - Fix _gmp_binary_opl - Use modern parameter parsing http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/gmp.c?r1=1.49.2.2.2.11.2.1&r2=1.49.2.2.2.11.2.2&diff_format=u Index: php-src/ext/gmp/gmp.c diff -u php-src/ext/gmp/gmp.c:1.49.2.2.2.11.2.1 php-src/ext/gmp/gmp.c:1.49.2.2.2.11.2.2 --- php-src/ext/gmp/gmp.c:1.49.2.2.2.11.2.1 Thu Sep 27 18:00:39 2007 +++ php-src/ext/gmp/gmp.c Thu Nov 1 00:46:12 2007 @@ -423,16 +423,23 @@ /* Fetch zval to be GMP number. Initially, zval can be also number or string */ -#define FETCH_GMP_ZVAL(gmpnumber, zval) \ -if (Z_TYPE_PP(zval) == IS_RESOURCE) { \ - ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\ -} else {\ - if (convert_to_gmp(&gmpnumber, zval, 0 TSRMLS_CC) == FAILURE) {\ - RETURN_FALSE;\ - }\ - ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\ +#define FETCH_GMP_ZVAL(gmpnumber, zval, tmp_resource) \ +if (Z_TYPE_PP(zval) == IS_RESOURCE) { \ + ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp); \ + tmp_resource = 0; \ +} else { \ + if (convert_to_gmp(&gmpnumber, zval, 0 TSRMLS_CC) == FAILURE) { \ + RETURN_FALSE; \ + } \ + tmp_resource = ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp); \ } +#define FREE_GMP_TEMP(tmp_resource)\ + if(tmp_resource) { \ + zend_list_delete(tmp_resource); \ + } + + /* create a new initialized GMP number */ #define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); } #define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); } @@ -524,13 +531,14 @@ mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; unsigned long long_result = 0; int use_ui = 0; + int arga_tmp = 0, argb_tmp = 0; - FETCH_GMP_ZVAL(gmpnum_a, a_arg); + FETCH_GMP_ZVAL(gmpnum_a, a_arg, arga_tmp); if (gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { use_ui = 1; } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, argb_tmp); } if(check_b_zero) { @@ -543,6 +551,8 @@ if(b_is_zero) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); + FREE_GMP_TEMP(arga_tmp); + FREE_GMP_TEMP(argb_tmp); RETURN_FALSE; } } @@ -559,6 +569,9 @@ gmp_op(*gmpnum_result, *gmpnum_a, *gmpnum_b); } + FREE_GMP_TEMP(arga_tmp); + FREE_GMP_TEMP(argb_tmp); + if (use_ui && allow_ui_return) { FREE_GMP_NUM(gmpnum_result); RETURN_LONG((long)long_result); @@ -578,14 +591,15 @@ zval r; int use_ui = 0; unsigned long long_result = 0; + int arga_tmp = 0, argb_tmp = 0; - FETCH_GMP_ZVAL(gmpnum_a, a_arg); + FETCH_GMP_ZVAL(gmpnum_a, a_arg, arga_tmp); if (gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { /* use _ui function */ use_ui = 1; } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, argb_tmp); } if(check_b_zero) { @@ -598,6 +612,8 @@
Re: [PHP-CVS] Re: cvs: php-src /ext/pdo pdo_sql_parser.c pdo_sql_parser.re /ext/pdo/tests bug_43130.phpt
Lukas Kahwe Smith wrote: I talked to Christopher Jones (of Oracle fame) and Lorenzo (MDB2 maintainer). Its clear that the only named parameter supporting database I know does not support dash inside named parameters. Its also dangerous since it means that whitespace typos could have serious hard to spot issues. I think a safe regexp for bound parameters would look something like: /^[a-z0-9][a-z0-9_]{0,30}$/ Since I couldn't find any official reference in the oracle documentation, I did further tests. I can reproduce the following behaviour on two different machines (intel P4 and Core2Duo): - if the named parameter is all digits, it must be < 65536 or I get an "ORA-01745" error. - if the name starts with a digit, only digits are allowed (ORA-01036) - the hyphen ("-") is forbidden (ORA-01036) - the name can't start with an underscore (ORA-01036), but can contain it elsewhere - the (alpha-numeric) name must be <= 30 chars(ORA-00972) - trivia: some non-standard ASCII chars (àòùéèç#$!) are considered valid, but not all of them (°§£) HTH Best regards, -- Lorenzo Alberton http://pear.php.net/user/quipo Quipo Free Internet: sicuro e veloce senza costi di attivazione e senza canone, 2 e-mail da 25 Mb, 150 Mb di spazio web e molto di più! Registrati gratis: http://www.quipo.it -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] Re: cvs: php-src /ext/pdo pdo_sql_parser.c pdo_sql_parser.re /ext/pdo/tests bug_43130.phpt
On 30.10.2007, at 12:00, Johannes Schlüter wrote: Ilia, I don't think this is right. SQL operators shouldn't be part of a parameter name imo. I talked to Christopher Jones (of Oracle fame) and Lorenzo (MDB2 maintainer). Its clear that the only named parameter supporting database I know does not support dash inside named parameters. Its also dangerous since it means that whitespace typos could have serious hard to spot issues. I think a safe regexp for bound parameters would look something like: /^[a-z0-9][a-z0-9_]{0,30}$/ regards, Lukas -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cgi cgi_main.c
dmitry Wed Oct 31 18:24:42 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/cgi cgi_main.c Log: Added CGI SAPI -T option, to measure execution time of script repeated several times. http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.50&r2=1.267.2.15.2.51&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.51 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50 Mon Sep 24 11:40:05 2007 +++ php-src/sapi/cgi/cgi_main.c Wed Oct 31 18:24:42 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.50 2007/09/24 11:40:05 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.51 2007/10/31 18:24:42 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -141,6 +141,9 @@ {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, {'z', 1, "zend-extension"}, +#if PHP_FASTCGI + {'T', 1, "timing"}, +#endif {'-', 0, NULL} /* end of args */ }; @@ -682,7 +685,11 @@ " -s Display colour syntax highlighted source.\n" " -v Version number\n" " -w Display source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n", + " -z Load Zend extension .\n" +#if PHP_FASTCGI + " -TMeasure execution time of script repeated times.\n" +#endif + , prog, prog); } /* }}} */ @@ -1199,6 +1206,13 @@ char *bindpath = NULL; int fcgi_fd = 0; fcgi_request request; + int repeats = 1; + int benchmark = 0; +#if HAVE_GETTIMEOFDAY + struct timeval start, end; +#else + time_t start, end; +#endif #ifndef PHP_WIN32 int status = 0; #endif @@ -1488,6 +1502,17 @@ zend_first_try { while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1)) != -1) { switch (c) { +#if PHP_FASTCGI + case 'T': + benchmark = 1; + repeats = atoi(php_optarg); +#ifdef HAVE_GETTIMEOFDAY + gettimeofday(&start, NULL); +#else + time(&start); +#endif + break; +#endif case 'h': case '?': #if PHP_FASTCGI @@ -1890,7 +1915,19 @@ } #if PHP_FASTCGI - if (!fastcgi) break; + if (!fastcgi) { + if (benchmark) { + repeats--; + if (repeats > 0) { + script_file = NULL; + php_optind = orig_optind; + php_optarg = orig_optarg; + continue; + } + } + break; + } + /* only fastcgi will get here */ requests++; if (max_requests && (requests == max_requests)) { @@ -1920,6 +1957,29 @@ } zend_end_try(); out: +#if PHP_FASTCGI + if (benchmark) { + int sec; +#ifdef HAVE_GETTIMEOFDAY + int usec; + + gettimeofday(&end, NULL); + sec = (int)(end.tv_sec - start.tv_sec); + if (end.tv_usec >= start.tv_usec) { + usec = (int)(end.tv_usec - start.tv_usec); + } else { + sec -= 1; + usec = (int)(end.tv_usec + 100 - start.tv_usec); + } + fprintf(stderr, "\nElapsed time: %d.%06d sec\n", sec, usec); +#else + time(&end); + sec = (int)(end - start); + fprintf(stderr, "\nElapsed time: %d sec\n", sec); +#endif + } +#endif + SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); sapi_shutdown(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard array.c /ext/standard/tests/array max.phpt min.phpt /ext/standard/tests/file fgetc_basic.phpt fgetc_variation4.phpt
janiWed Oct 31 13:39:26 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard array.c /php-src/ext/standard/tests/array max.phpt min.phpt /php-src/ext/standard/tests/filefgetc_basic.phpt fgetc_variation4.phpt Log: MFH: fix typo http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.4&r2=1.308.2.21.2.37.2.5&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.4 php-src/ext/standard/array.c:1.308.2.21.2.37.2.5 --- php-src/ext/standard/array.c:1.308.2.21.2.37.2.4Thu Oct 18 14:33:14 2007 +++ php-src/ext/standard/array.cWed Oct 31 13:39:26 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.308.2.21.2.37.2.4 2007/10/18 14:33:14 scottmac Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.37.2.5 2007/10/31 13:39:26 jani Exp $ */ #include "php.h" #include "php_ini.h" @@ -964,7 +964,7 @@ zval **result; if (argc<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -977,7 +977,7 @@ if (zend_hash_minmax(Z_ARRVAL_PP(arr), array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) { RETVAL_ZVAL(*result, 1, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETURN_FALSE; } } else { @@ -1014,7 +1014,7 @@ zval **result; if (argc<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -1027,7 +1027,7 @@ if (zend_hash_minmax(Z_ARRVAL_PP(arr), array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) { RETVAL_ZVAL(*result, 1, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETURN_FALSE; } } else { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/max.phpt?r1=1.1.2.3&r2=1.1.2.3.2.1&diff_format=u Index: php-src/ext/standard/tests/array/max.phpt diff -u php-src/ext/standard/tests/array/max.phpt:1.1.2.3 php-src/ext/standard/tests/array/max.phpt:1.1.2.3.2.1 --- php-src/ext/standard/tests/array/max.phpt:1.1.2.3 Mon May 7 22:30:16 2007 +++ php-src/ext/standard/tests/array/max.phpt Wed Oct 31 13:39:26 2007 @@ -20,13 +20,13 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: max(): Atleast one value should be passed in %s on line %d +Warning: max(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for max() in %s on line %d NULL -Warning: max(): Array must contain atleast one element in %s on line %d +Warning: max(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for max() in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/min.phpt?r1=1.1.2.3&r2=1.1.2.3.2.1&diff_format=u Index: php-src/ext/standard/tests/array/min.phpt diff -u php-src/ext/standard/tests/array/min.phpt:1.1.2.3 php-src/ext/standard/tests/array/min.phpt:1.1.2.3.2.1 --- php-src/ext/standard/tests/array/min.phpt:1.1.2.3 Mon May 7 22:30:16 2007 +++ php-src/ext/standard/tests/array/min.phpt Wed Oct 31 13:39:26 2007 @@ -20,13 +20,13 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: min(): Atleast one value should be passed in %s on line %d +Warning: min(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for min() in %s on line %d NULL -Warning: min(): Array must contain atleast one element in %s on line %d +Warning: min(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for min() in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fgetc_basic.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: php-src/ext/standard/tests/file/fgetc_basic.phpt diff -u php-src/ext/standard/tests/file/fgetc_basic.phpt:1.1.2.1.2.1 php-src/ext/standard/tests/file/fgetc_basic.phpt:1.1.2.1.2.2 --- php-src/ext/standard/tests/file/fgetc_bas
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard array.c /ext/standard/tests/array max.phpt min.phpt /ext/standard/tests/file fgetc_basic.phpt fgetc_variation4.phpt
janiWed Oct 31 13:39:15 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard array.c /php-src/ext/standard/tests/array max.phpt min.phpt /php-src/ext/standard/tests/filefgetc_basic.phpt fgetc_variation4.phpt Log: MFH: fix typo http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.40&r2=1.308.2.21.2.41&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.40 php-src/ext/standard/array.c:1.308.2.21.2.41 --- php-src/ext/standard/array.c:1.308.2.21.2.40Thu Oct 18 14:39:08 2007 +++ php-src/ext/standard/array.cWed Oct 31 13:39:14 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.308.2.21.2.40 2007/10/18 14:39:08 scottmac Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.41 2007/10/31 13:39:14 jani Exp $ */ #include "php.h" #include "php_ini.h" @@ -964,7 +964,7 @@ zval **result; if (argc<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -977,7 +977,7 @@ if (zend_hash_minmax(Z_ARRVAL_PP(arr), array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) { RETVAL_ZVAL(*result, 1, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETURN_FALSE; } } else { @@ -1014,7 +1014,7 @@ zval **result; if (argc<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -1027,7 +1027,7 @@ if (zend_hash_minmax(Z_ARRVAL_PP(arr), array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) { RETVAL_ZVAL(*result, 1, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETURN_FALSE; } } else { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/max.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: php-src/ext/standard/tests/array/max.phpt diff -u php-src/ext/standard/tests/array/max.phpt:1.1.2.3 php-src/ext/standard/tests/array/max.phpt:1.1.2.4 --- php-src/ext/standard/tests/array/max.phpt:1.1.2.3 Mon May 7 22:30:16 2007 +++ php-src/ext/standard/tests/array/max.phpt Wed Oct 31 13:39:14 2007 @@ -20,13 +20,13 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: max(): Atleast one value should be passed in %s on line %d +Warning: max(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for max() in %s on line %d NULL -Warning: max(): Array must contain atleast one element in %s on line %d +Warning: max(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for max() in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/min.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: php-src/ext/standard/tests/array/min.phpt diff -u php-src/ext/standard/tests/array/min.phpt:1.1.2.3 php-src/ext/standard/tests/array/min.phpt:1.1.2.4 --- php-src/ext/standard/tests/array/min.phpt:1.1.2.3 Mon May 7 22:30:16 2007 +++ php-src/ext/standard/tests/array/min.phpt Wed Oct 31 13:39:14 2007 @@ -20,13 +20,13 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: min(): Atleast one value should be passed in %s on line %d +Warning: min(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for min() in %s on line %d NULL -Warning: min(): Array must contain atleast one element in %s on line %d +Warning: min(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for min() in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fgetc_basic.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-src/ext/standard/tests/file/fgetc_basic.phpt diff -u php-src/ext/standard/tests/file/fgetc_basic.phpt:1.1.2.2 php-src/ext/standard/tests/file/fgetc_basic.phpt:1.1.2.3 --- php-src/ext/standard/tests/file/fgetc_basic.phpt:1.1.2.2Thu Oct 11 11:53:16 2007 +++ php-src
[PHP-CVS] cvs: php-src /ext/standard array.c /ext/standard/tests/array max.phpt min.phpt /ext/standard/tests/file fgetc_basic.phpt fgetc_variation4.phpt
janiWed Oct 31 13:39:01 2007 UTC Modified files: /php-src/ext/standard array.c /php-src/ext/standard/tests/array max.phpt min.phpt /php-src/ext/standard/tests/filefgetc_basic.phpt fgetc_variation4.phpt Log: - Fix typo (bug #43125) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.422&r2=1.423&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.422 php-src/ext/standard/array.c:1.423 --- php-src/ext/standard/array.c:1.422 Sun Oct 7 05:15:06 2007 +++ php-src/ext/standard/array.cWed Oct 31 13:39:00 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.422 2007/10/07 05:15:06 davidw Exp $ */ +/* $Id: array.c,v 1.423 2007/10/31 13:39:00 jani Exp $ */ #include "php.h" #include "php_ini.h" @@ -946,7 +946,7 @@ zval **result; if (argc<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one value should be passed"); RETURN_NULL(); } php_set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -959,7 +959,7 @@ if (zend_hash_minmax(Z_ARRVAL_PP(arr), php_array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) { RETVAL_ZVAL(*result, 1, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETURN_FALSE; } } else { @@ -996,7 +996,7 @@ zval **result; if (argc<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one value should be passed"); RETURN_NULL(); } php_set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -1009,7 +1009,7 @@ if (zend_hash_minmax(Z_ARRVAL_PP(arr), php_array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) { RETVAL_ZVAL(*result, 1, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETURN_FALSE; } } else { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/max.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/array/max.phpt diff -u php-src/ext/standard/tests/array/max.phpt:1.2 php-src/ext/standard/tests/array/max.phpt:1.3 --- php-src/ext/standard/tests/array/max.phpt:1.2 Mon May 7 22:33:38 2007 +++ php-src/ext/standard/tests/array/max.phpt Wed Oct 31 13:39:00 2007 @@ -20,13 +20,13 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: max(): Atleast one value should be passed in %s on line %d +Warning: max(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for max() in %s on line %d NULL -Warning: max(): Array must contain atleast one element in %s on line %d +Warning: max(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for max() in %s on line %d @@ -40,13 +40,13 @@ bool(true) Done --UEXPECTF-- -Warning: max(): Atleast one value should be passed in %s on line %d +Warning: max(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for max() in %s on line %d NULL -Warning: max(): Array must contain atleast one element in %s on line %d +Warning: max(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for max() in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/min.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/array/min.phpt diff -u php-src/ext/standard/tests/array/min.phpt:1.2 php-src/ext/standard/tests/array/min.phpt:1.3 --- php-src/ext/standard/tests/array/min.phpt:1.2 Mon May 7 22:33:38 2007 +++ php-src/ext/standard/tests/array/min.phpt Wed Oct 31 13:39:00 2007 @@ -20,13 +20,13 @@ echo "Done\n"; ?> --EXPECTF-- -Warning: min(): Atleast one value should be passed in %s on line %d +Warning: min(): At least one value should be passed in %s on line %d NULL Warning: Wrong parameter count for min() in %s on line %d NULL -Warning: min(): Array must contain atleast one element in %s on line %d +Warning: min(): Array must contain at least one element in %s on line %d bool(false) Warning: Wrong parameter count for min() in %s on line %d @@ -40,13 +40,1
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/openssl openssl.c /ext/standard filestat.c php_filestat.h /ext/standard/tests/file 005_basic.phpt 005_error.phpt bug43137.phpt /main/streams plain_wrapp
janiWed Oct 31 13:23:07 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/filebug43137.phpt Modified files: /php-srcNEWS /php-src/ext/opensslopenssl.c /php-src/ext/standard filestat.c php_filestat.h /php-src/ext/standard/tests/file005_basic.phpt 005_error.phpt /php-src/main/streams plain_wrapper.c Log: MFH: - Fixed Bug #43137 (rmdir() and rename() do not clear statcache) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.992&r2=1.2027.2.547.2.993&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.992 php-src/NEWS:1.2027.2.547.2.993 --- php-src/NEWS:1.2027.2.547.2.992 Wed Oct 31 12:58:24 2007 +++ php-src/NEWSWed Oct 31 13:23:05 2007 @@ -3,6 +3,7 @@ ?? ??? 2007, PHP 5.2.5RC2 - Added ability to control memory consumption between request using ZEND_MM_COMPACT environment variable. (Dmitry) +- Fixed bug #43137 (rmdir() and rename() do not clear statcache). (Jani) 18 Oct 2007, PHP 5.2.5RC1 - Upgraded PCRE to version 7.3 (Nuno) http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.41&r2=1.98.2.5.2.42&diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.41 php-src/ext/openssl/openssl.c:1.98.2.5.2.42 --- php-src/ext/openssl/openssl.c:1.98.2.5.2.41 Wed Aug 8 06:29:46 2007 +++ php-src/ext/openssl/openssl.c Wed Oct 31 13:23:06 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.98.2.5.2.41 2007/08/08 06:29:46 pajoye Exp $ */ +/* $Id: openssl.c,v 1.98.2.5.2.42 2007/10/31 13:23:06 jani Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -46,6 +46,9 @@ #include #include +/* Common */ +#include + #define DEFAULT_KEY_LENGTH 512 #define MIN_KEY_LENGTH 384 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.136.2.8.2.14&r2=1.136.2.8.2.15&diff_format=u Index: php-src/ext/standard/filestat.c diff -u php-src/ext/standard/filestat.c:1.136.2.8.2.14 php-src/ext/standard/filestat.c:1.136.2.8.2.15 --- php-src/ext/standard/filestat.c:1.136.2.8.2.14 Fri Sep 21 14:05:18 2007 +++ php-src/ext/standard/filestat.c Wed Oct 31 13:23:06 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: filestat.c,v 1.136.2.8.2.14 2007/09/21 14:05:18 tony2001 Exp $ */ +/* $Id: filestat.c,v 1.136.2.8.2.15 2007/10/31 13:23:06 jani Exp $ */ #include "php.h" #include "safe_mode.h" @@ -698,14 +698,10 @@ /* }}} */ #endif -/* {{{ proto void clearstatcache(void) - Clear file stat cache */ -PHP_FUNCTION(clearstatcache) +/* {{{ php_clear_stat_cache() +*/ +PHPAPI void php_clear_stat_cache(TSRMLS_D) { - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - if (BG(CurrentStatFile)) { efree(BG(CurrentStatFile)); BG(CurrentStatFile) = NULL; @@ -718,6 +714,17 @@ } /* }}} */ +/* {{{ proto void clearstatcache(void) + Clear file stat cache */ +PHP_FUNCTION(clearstatcache) +{ + if (ZEND_NUM_ARGS()) { + WRONG_PARAM_COUNT; + } + php_clear_stat_cache(TSRMLS_C); +} +/* }}} */ + #define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT) #define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK) #define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_filestat.h?r1=1.24.2.4.2.1&r2=1.24.2.4.2.2&diff_format=u Index: php-src/ext/standard/php_filestat.h diff -u php-src/ext/standard/php_filestat.h:1.24.2.4.2.1 php-src/ext/standard/php_filestat.h:1.24.2.4.2.2 --- php-src/ext/standard/php_filestat.h:1.24.2.4.2.1Mon Jan 1 09:36:08 2007 +++ php-src/ext/standard/php_filestat.h Wed Oct 31 13:23:06 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_filestat.h,v 1.24.2.4.2.1 2007/01/01 09:36:08 sebastian Exp $ */ +/* $Id: php_filestat.h,v 1.24.2.4.2.2 2007/10/31 13:23:06 jani Exp $ */ #ifndef PHP_FILESTAT_H #define PHP_FILESTAT_H @@ -87,6 +87,7 @@ typedef int php_stat_len; #endif +PHPAPI void php_clear_stat_cache(TSRMLS_D); PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC); /* Switches for various filestat functions: */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/005_basic.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/standard/tests/file/005_basic.phpt diff -u php-src/ext/standard/tests/file/005_basic.phpt:1.1.2.1 php-src/ext/standard/tests/file/005_basic.phpt:1.1.2.2 --- php-src/ext/standard/tests/file/005_basic.phpt:
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/openssl openssl.c /ext/standard filestat.c php_filestat.h /ext/standard/tests/file 005_basic.phpt 005_error.phpt bug43137.phpt /main/streams plain_wrapper.c
janiWed Oct 31 13:22:45 2007 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/filebug43137.phpt Modified files: /php-src/ext/opensslopenssl.c /php-src/ext/standard filestat.c php_filestat.h /php-src/ext/standard/tests/file005_basic.phpt 005_error.phpt /php-src/main/streams plain_wrapper.c Log: MFH: - Fixed bug #43137 (rmdir() and rename() do not clear statcache) http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.41.2.2&r2=1.98.2.5.2.41.2.3&diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.2 php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.3 --- php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.2 Thu Sep 27 18:00:42 2007 +++ php-src/ext/openssl/openssl.c Wed Oct 31 13:22:44 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.98.2.5.2.41.2.2 2007/09/27 18:00:42 dmitry Exp $ */ +/* $Id: openssl.c,v 1.98.2.5.2.41.2.3 2007/10/31 13:22:44 jani Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -48,6 +48,9 @@ #include #include +/* Common */ +#include + #define DEFAULT_KEY_LENGTH 512 #define MIN_KEY_LENGTH 384 @@ -1233,7 +1236,7 @@ } /* }}} */ -/* {{{ proto int openssl_x509_checkpurpose(mixed x509cert, int purpose, array cainfo [, string untrustedfile]) +/* {{{ proto mixed openssl_x509_checkpurpose(mixed x509cert, int purpose, array cainfo [, string untrustedfile]) Checks the CERT to see if it can be used for the purpose in purpose. cainfo holds information about trusted CAs */ PHP_FUNCTION(openssl_x509_checkpurpose) { @@ -1244,10 +1247,9 @@ STACK_OF(X509) * untrustedchain = NULL; long purpose; char * untrusted = NULL; - int untrusted_len; + int untrusted_len, ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) - == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) { return; } @@ -1268,7 +1270,13 @@ if (cert == NULL) { goto clean_exit; } - RETVAL_LONG(check_cert(cainfo, cert, untrustedchain, purpose)); + + ret = check_cert(cainfo, cert, untrustedchain, purpose); + if (ret != 0 && ret != 1) { + RETVAL_LONG(ret); + } else { + RETVAL_BOOL(ret); + } clean_exit: if (certresource == 1 && cert) { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.136.2.8.2.14&r2=1.136.2.8.2.14.2.1&diff_format=u Index: php-src/ext/standard/filestat.c diff -u php-src/ext/standard/filestat.c:1.136.2.8.2.14 php-src/ext/standard/filestat.c:1.136.2.8.2.14.2.1 --- php-src/ext/standard/filestat.c:1.136.2.8.2.14 Fri Sep 21 14:05:18 2007 +++ php-src/ext/standard/filestat.c Wed Oct 31 13:22:44 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: filestat.c,v 1.136.2.8.2.14 2007/09/21 14:05:18 tony2001 Exp $ */ +/* $Id: filestat.c,v 1.136.2.8.2.14.2.1 2007/10/31 13:22:44 jani Exp $ */ #include "php.h" #include "safe_mode.h" @@ -698,14 +698,10 @@ /* }}} */ #endif -/* {{{ proto void clearstatcache(void) - Clear file stat cache */ -PHP_FUNCTION(clearstatcache) +/* {{{ php_clear_stat_cache() +*/ +PHPAPI void php_clear_stat_cache(TSRMLS_D) { - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - if (BG(CurrentStatFile)) { efree(BG(CurrentStatFile)); BG(CurrentStatFile) = NULL; @@ -718,6 +714,17 @@ } /* }}} */ +/* {{{ proto void clearstatcache(void) + Clear file stat cache */ +PHP_FUNCTION(clearstatcache) +{ + if (ZEND_NUM_ARGS()) { + WRONG_PARAM_COUNT; + } + php_clear_stat_cache(TSRMLS_C); +} +/* }}} */ + #define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT) #define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK) #define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_filestat.h?r1=1.24.2.4.2.1.2.1&r2=1.24.2.4.2.1.2.2&diff_format=u Index: php-src/ext/standard/php_filestat.h diff -u php-src/ext/standard/php_filestat.h:1.24.2.4.2.1.2.1 php-src/ext/standard/php_filestat.h:1.24.2.4.2.1.2.2 --- php-src/ext/standard/php_filestat.h:1.24.2.4.2.1.2.1Sun Oct 7 05:22:07 2007 +++ php-src/ext/standard/php_filestat.h Wed Oct 31 13:22:44 2007 @@ -16,7 +16,7 @@ +-
[PHP-CVS] cvs: php-src /ext/standard filestat.c php_filestat.h /ext/standard/tests/file 005_basic.phpt 005_error.phpt bug43137.phpt /main/streams plain_wrapper.c
janiWed Oct 31 13:22:18 2007 UTC Added files: /php-src/ext/standard/tests/filebug43137.phpt Modified files: /php-src/ext/standard filestat.c php_filestat.h /php-src/ext/standard/tests/file005_basic.phpt 005_error.phpt /php-src/main/streams plain_wrapper.c Log: - Fixed bug #43137 (rmdir() and rename() do not clear statcache) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.164&r2=1.165&diff_format=u Index: php-src/ext/standard/filestat.c diff -u php-src/ext/standard/filestat.c:1.164 php-src/ext/standard/filestat.c:1.165 --- php-src/ext/standard/filestat.c:1.164 Fri Sep 21 14:05:01 2007 +++ php-src/ext/standard/filestat.c Wed Oct 31 13:22:18 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: filestat.c,v 1.164 2007/09/21 14:05:01 tony2001 Exp $ */ +/* $Id: filestat.c,v 1.165 2007/10/31 13:22:18 jani Exp $ */ #include "php.h" #include "fopen_wrappers.h" @@ -751,14 +751,10 @@ /* }}} */ #endif -/* {{{ proto void clearstatcache(void) U - Clear file stat cache */ -PHP_FUNCTION(clearstatcache) +/* {{{ php_clear_stat_cache() +*/ +PHPAPI void php_clear_stat_cache(TSRMLS_D) { - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - if (BG(CurrentStatFile)) { efree(BG(CurrentStatFile)); BG(CurrentStatFile) = NULL; @@ -771,6 +767,17 @@ } /* }}} */ +/* {{{ proto void clearstatcache(void) + Clear file stat cache */ +PHP_FUNCTION(clearstatcache) +{ + if (ZEND_NUM_ARGS()) { + WRONG_PARAM_COUNT; + } + php_clear_stat_cache(TSRMLS_C); +} +/* }}} */ + #define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT) #define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK) #define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_filestat.h?r1=1.31&r2=1.32&diff_format=u Index: php-src/ext/standard/php_filestat.h diff -u php-src/ext/standard/php_filestat.h:1.31 php-src/ext/standard/php_filestat.h:1.32 --- php-src/ext/standard/php_filestat.h:1.31Sun Oct 7 05:15:06 2007 +++ php-src/ext/standard/php_filestat.h Wed Oct 31 13:22:18 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_filestat.h,v 1.31 2007/10/07 05:15:06 davidw Exp $ */ +/* $Id: php_filestat.h,v 1.32 2007/10/31 13:22:18 jani Exp $ */ #ifndef PHP_FILESTAT_H #define PHP_FILESTAT_H @@ -87,6 +87,7 @@ typedef int php_stat_len; #endif +PHPAPI void php_clear_stat_cache(TSRMLS_D); PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC); PHPAPI void php_u_stat(zend_uchar filename_type, const zstr filename, php_stat_len filename_length, int type, php_stream_context *context, zval *return_value TSRMLS_DC); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/005_basic.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/file/005_basic.phpt diff -u php-src/ext/standard/tests/file/005_basic.phpt:1.2 php-src/ext/standard/tests/file/005_basic.phpt:1.3 --- php-src/ext/standard/tests/file/005_basic.phpt:1.2 Mon Jun 11 16:40:27 2007 +++ php-src/ext/standard/tests/file/005_basic.phpt Wed Oct 31 13:22:18 2007 @@ -1,5 +1,5 @@ --TEST-- -Test fileatime(), filemtime(), filectime() & touch() functions: basic functionality +Test fileatime(), filemtime(), filectime() & touch() functions : basic functionality --FILE-- http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/005_error.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/file/005_error.phpt diff -u php-src/ext/standard/tests/file/005_error.phpt:1.2 php-src/ext/standard/tests/file/005_error.phpt:1.3 --- php-src/ext/standard/tests/file/005_error.phpt:1.2 Mon Jun 11 16:40:27 2007 +++ php-src/ext/standard/tests/file/005_error.phpt Wed Oct 31 13:22:18 2007 @@ -1,5 +1,5 @@ --TEST-- -Test fileatime(), filemtime(), filectime() & touch() functions: error conditions +Test fileatime(), filemtime(), filectime() & touch() functions : error conditions --FILE-- http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.90&r2=1.91&diff_format=u Index: php-src/main/streams/plain_wrapper.c diff -u php-src/main/streams/plain_wrapper.c:1.90 php-src/main/streams/plain_wrapper.c:1.91 --- php-src/main/streams/plain_wrapper.c:1.90 Wed Jul 25 16:34:27 2007 +++ php-src/main/streams/plain_wrapper.cWed Oct 31 13:22:18 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: plain_wrapper.c,v 1.90 2007/07/25 16:34:27 dmitry Exp $ */ +/*
[PHP-CVS] cvs: php-src /ext/pdo pdo_stmt.c /ext/pdo/tests bug_43139.phpt
iliaa Wed Oct 31 12:58:39 2007 UTC Modified files: /php-src/ext/pdo/tests bug_43139.phpt /php-src/ext/pdopdo_stmt.c Log: MFB: Fixed bug #43139 PDO ignores ATTR_DEFAULT_FETCH_MODE in some cases with fetchAll() http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43139.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/pdo/tests/bug_43139.phpt diff -u /dev/null php-src/ext/pdo/tests/bug_43139.phpt:1.2 --- /dev/null Wed Oct 31 12:58:39 2007 +++ php-src/ext/pdo/tests/bug_43139.phptWed Oct 31 12:58:39 2007 @@ -0,0 +1,34 @@ +--TEST-- +PDO Common: Bug #43139 (PDO ignore ATTR_DEFAULT_FETCH_MODE in some cases with fetchAll()) +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); +$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); + +var_dump($db->query('select 0 as abc, 1 as xyz, 2 as def')->fetchAll(PDO::FETCH_GROUP)); +?> +--EXPECT-- +array(1) { + [0]=> + array(1) { +[0]=> +array(2) { + ["xyz"]=> + string(1) "1" + ["def"]=> + string(1) "2" +} + } +} http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.179&r2=1.180&diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.179 php-src/ext/pdo/pdo_stmt.c:1.180 --- php-src/ext/pdo/pdo_stmt.c:1.179Mon Oct 8 04:05:22 2007 +++ php-src/ext/pdo/pdo_stmt.c Wed Oct 31 12:58:39 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo_stmt.c,v 1.179 2007/10/08 04:05:22 davidw Exp $ */ +/* $Id: pdo_stmt.c,v 1.180 2007/10/31 12:58:39 iliaa Exp $ */ /* The PDO Statement Handle Class */ @@ -1236,7 +1236,7 @@ } /* }}} */ -static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, int mode, int fetch_all TSRMLS_DC) /* {{{ */ +static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, long mode, int fetch_all TSRMLS_DC) /* {{{ */ { int flags = mode & PDO_FETCH_FLAGS; @@ -1522,6 +1522,10 @@ } } + if ((how & ~PDO_FETCH_FLAGS) == PDO_FETCH_USE_DEFAULT) { + how |= stmt->default_fetch_type & ~PDO_FETCH_FLAGS; + } + if (!error) { PDO_STMT_CLEAR_ERR(); MAKE_STD_ZVAL(data); @@ -1890,6 +1894,7 @@ case PDO_FETCH_OBJ: case PDO_FETCH_BOUND: case PDO_FETCH_NAMED: + case PDO_FETCH_KEY_PAIR: break; case PDO_FETCH_COLUMN: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/pdo pdo_stmt.c /ext/pdo/tests bug_43139.phpt
iliaa Wed Oct 31 12:58:24 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/pdo/tests bug_43139.phpt Modified files: /php-src/ext/pdopdo_stmt.c /php-srcNEWS Log: MFB: Fixed bug #43139 PDO ignores ATTR_DEFAULT_FETCH_MODE in some cases with fetchAll() http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.25&r2=1.118.2.38.2.26&diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.25 php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.26 --- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.25 Thu Oct 11 20:56:22 2007 +++ php-src/ext/pdo/pdo_stmt.c Wed Oct 31 12:58:24 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo_stmt.c,v 1.118.2.38.2.25 2007/10/11 20:56:22 iliaa Exp $ */ +/* $Id: pdo_stmt.c,v 1.118.2.38.2.26 2007/10/31 12:58:24 iliaa Exp $ */ /* The PDO Statement Handle Class */ @@ -1546,6 +1546,10 @@ } } + if ((how & ~PDO_FETCH_FLAGS) == PDO_FETCH_USE_DEFAULT) { + how |= stmt->default_fetch_type & ~PDO_FETCH_FLAGS; + } + if (!error) { PDO_STMT_CLEAR_ERR(); MAKE_STD_ZVAL(data); http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.991&r2=1.2027.2.547.2.992&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.991 php-src/NEWS:1.2027.2.547.2.992 --- php-src/NEWS:1.2027.2.547.2.991 Mon Oct 29 22:37:25 2007 +++ php-src/NEWSWed Oct 31 12:58:24 2007 @@ -40,6 +40,8 @@ - Fixed htmlentities/htmlspecialchars not to accept partial multibyte sequences. (Stas) +- Fixed bug #43139 (PDO ignores ATTR_DEFAULT_FETCH_MODE in some cases with + fetchAll()). (Ilia) - Fixed bug #43130 (Bound parameters cannot have - in their name). (Ilia) - Fixed bug #43099 (XMLWriter::endElement() does not check # of params). (Ilia) http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43139.phpt?view=markup&rev=1.1 Index: php-src/ext/pdo/tests/bug_43139.phpt +++ php-src/ext/pdo/tests/bug_43139.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c /ext/pdo/tests bug_43139.phpt
iliaa Wed Oct 31 12:57:51 2007 UTC Added files: (Branch: PHP_5_3) /php-src/ext/pdo/tests bug_43139.phpt Modified files: /php-src/ext/pdopdo_stmt.c Log: Fixed bug #43139 PDO ignores ATTR_DEFAULT_FETCH_MODE in some cases with fetchAll() http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.4&r2=1.118.2.38.2.24.2.5&diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.4 php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.5 --- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.4 Thu Oct 11 20:54:41 2007 +++ php-src/ext/pdo/pdo_stmt.c Wed Oct 31 12:57:51 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.4 2007/10/11 20:54:41 iliaa Exp $ */ +/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.5 2007/10/31 12:57:51 iliaa Exp $ */ /* The PDO Statement Handle Class */ @@ -1546,6 +1546,10 @@ } } + if ((how & ~PDO_FETCH_FLAGS) == PDO_FETCH_USE_DEFAULT) { + how |= stmt->default_fetch_type & ~PDO_FETCH_FLAGS; + } + if (!error) { PDO_STMT_CLEAR_ERR(); MAKE_STD_ZVAL(data); http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43139.phpt?view=markup&rev=1.1 Index: php-src/ext/pdo/tests/bug_43139.phpt +++ php-src/ext/pdo/tests/bug_43139.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php