iliaa Mon Dec 4 02:40:20 2006 UTC
Modified files:
/php-src/ext/pdo pdo_dbh.c
Log:
MFB: 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.136&r2=1.137&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.136 php-src/ext/pdo/pdo_dbh.c:1.137
--- php-src/ext/pdo/pdo_dbh.c:1.136 Sun Oct 8 13:34:23 2006
+++ php-src/ext/pdo/pdo_dbh.c Mon Dec 4 02:40:20 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dbh.c,v 1.136 2006/10/08 13:34:23 bjori Exp $ */
+/* $Id: pdo_dbh.c,v 1.137 2006/12/04 02:40:20 iliaa Exp $ */
/* The PDO Database Handle Class */
@@ -711,6 +711,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);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php