iliaa Mon Dec 4 02:40:09 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/pdo pdo_dbh.c
/php-src NEWS
Log:
Fixed bug #38252 (Incorrect PDO error message on invalid default fetch mode).
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.31.2.7&r2=1.82.2.31.2.8&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.7
php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.8
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.7 Mon Aug 21 16:53:50 2006
+++ php-src/ext/pdo/pdo_dbh.c Mon Dec 4 02:40:08 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dbh.c,v 1.82.2.31.2.7 2006/08/21 16:53:50 iliaa Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.8 2006/12/04 02:40:08 iliaa Exp $ */
/* The PDO Database Handle Class */
@@ -706,6 +706,15 @@
return SUCCESS;
case PDO_ATTR_DEFAULT_FETCH_MODE:
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ zval **tmp;
+ if (zend_hash_index_find(Z_ARRVAL_P(value), 0,
(void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) {
+ if (Z_LVAL_PP(tmp) == PDO_FETCH_INTO ||
Z_LVAL_PP(tmp) == PDO_FETCH_CLASS) {
+ pdo_raise_impl_error(dbh, NULL,
"HY000", "FETCH_INTO and FETCH_CLASS are not yet supported as default fetch
modes" TSRMLS_CC);
+ return FAILURE;
+ }
+ }
+ }
convert_to_long(value);
if (Z_LVAL_P(value) == PDO_FETCH_USE_DEFAULT) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"invalid fetch mode type" TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.395&r2=1.2027.2.547.2.396&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.395 php-src/NEWS:1.2027.2.547.2.396
--- php-src/NEWS:1.2027.2.547.2.395 Mon Dec 4 00:38:46 2006
+++ php-src/NEWS Mon Dec 4 02:40:08 2006
@@ -131,6 +131,8 @@
(Dmitry)
- Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php
ErrorDocument). (Ilia)
+- Fixed bug #38252 (Incorrect PDO error message on invalid default fetch
+ mode). (Ilia)
- Fixed bug #37773 (iconv_substr() gives "Unknown error" when string length =
1").
(Ilia)
- Fixed bug #36975 (natcasesort() causes array_pop() to misbehave). (Hannes)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php