iliaa Thu Oct 11 20:56:23 2007 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/pdo/tests bug_42917.phpt
Modified files:
/php-src/ext/pdo pdo_stmt.c
/php-src NEWS
Log:
MFB: Fixed bug #42917 (PDO::FETCH_KEY_PAIR doesn't work with setFetchMode)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24&r2=1.118.2.38.2.25&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
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.24 Wed Sep 12 21:21:18 2007
+++ php-src/ext/pdo/pdo_stmt.c Thu Oct 11 20:56:22 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_stmt.c,v 1.118.2.38.2.24 2007/09/12 21:21:18 stas Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.38.2.25 2007/10/11 20:56:22 iliaa Exp $ */
/* The PDO Statement Handle Class */
@@ -1260,7 +1260,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;
@@ -1549,7 +1549,9 @@
if (!error) {
PDO_STMT_CLEAR_ERR();
MAKE_STD_ZVAL(data);
- if ((how & PDO_FETCH_GROUP) || how == PDO_FETCH_KEY_PAIR) {
+ if ( (how & PDO_FETCH_GROUP) || how == PDO_FETCH_KEY_PAIR ||
+ (how == PDO_FETCH_USE_DEFAULT &&
stmt->default_fetch_type == PDO_FETCH_KEY_PAIR)
+ ) {
array_init(return_value);
return_all = return_value;
} else {
@@ -1565,7 +1567,7 @@
do {
MAKE_STD_ZVAL(data);
} while (do_fetch(stmt, TRUE, data, how,
PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
- } else if (how == PDO_FETCH_KEY_PAIR) {
+ } else if (how == PDO_FETCH_KEY_PAIR || (how ==
PDO_FETCH_USE_DEFAULT && stmt->default_fetch_type == PDO_FETCH_KEY_PAIR)) {
while (do_fetch(stmt, TRUE, data, how,
PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
} else {
array_init(return_value);
@@ -1916,6 +1918,7 @@
case PDO_FETCH_OBJ:
case PDO_FETCH_BOUND:
case PDO_FETCH_NAMED:
+ case PDO_FETCH_KEY_PAIR:
break;
case PDO_FETCH_COLUMN:
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.973&r2=1.2027.2.547.2.974&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.973 php-src/NEWS:1.2027.2.547.2.974
--- php-src/NEWS:1.2027.2.547.2.973 Wed Oct 10 00:35:52 2007
+++ php-src/NEWS Thu Oct 11 20:56:22 2007
@@ -32,6 +32,8 @@
- Fixed htmlentities/htmlspecialchars not to accept partial multibyte
sequences. (Stas)
+- Fixed bug #42917 (PDO::FETCH_KEY_PAIR doesn't work with setFetchMode).
+ (Ilia)
- Fixed bug #42890 (Constant "LIST" defined by mysqlclient and c-client).
(Andrey)
- Fixed bug #42869 (automatic session id insertion adds sessions id to
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_42917.phpt?view=markup&rev=1.1
Index: php-src/ext/pdo/tests/bug_42917.phpt
+++ php-src/ext/pdo/tests/bug_42917.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php