From 63dae4ee74a4b6d4ffa05f899ba170937ee02ece Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 27 Nov 2005 21:01:58 +0000 Subject: [PATCH] Fix #35431; LAZY fetch and fetchAll == crash. Lazy makes no sense with fetchAll; disallow it. --- ext/pdo/pdo_stmt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index c29036f50b..a6f7d1f826 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1138,6 +1138,13 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, int mode, int fetch_all TSRMLS return 0; } return 1; + + case PDO_FETCH_LAZY: + if (fetch_all) { + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()" TSRMLS_CC); + return 0; + } + /* fall through */ default: if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) { -- 2.40.0