PHP :: Bug #38252 :: Incorrect PDO error message
| Bug #38252 | Incorrect PDO error message | ||||
|---|---|---|---|---|---|
| Submitted: | 2006-07-29 18:06 UTC | Modified: | 2006-12-04 02:40 UTC | ||
| From: | stochnagara at hotmail dot com | Assigned: | |||
| Status: | Closed | Package: | PDO related | ||
| PHP Version: | 5.2.0RC1 | OS: | windows xp | ||
| Private report: | No | CVE-ID: | None | ||
[2006-07-29 18:06 UTC] stochnagara at hotmail dot com
Description:
------------
PDO gives an inconsisten error message when I use the new PDO::ATTR_DEFAULT_FETCH_MODE in combination with PDO::FETCH_INTO.
Reproduce code:
---------------
<?
$pdo = new PDO ('sqlite::memory:');
$pdo->exec ("create table test (id integer primary key, n text)");
$pdo->exec ("INSERT INTO test (n) VALUES ('hi')");
$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, array (PDO::FETCH_INTO, $a));
$stmt = $pdo->prepare ("SELECT * FROM test");
$stmt->execute();
var_dump($stmt->fetchAll());
Expected result:
----------------
i don't know exactly
Actual result:
--------------
Warning: PDOStatement::fetchAll() [function.PDOStatement-fetchAll]: SQLSTATE[HY000]: General error: PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll() in ... on line 11
bool(false)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-07-29 18:14 UTC] stochnagara at hotmail dot com
[2006-07-29 18:23 UTC] pajoye@php.net
[2006-12-04 02:40 UTC] iliaa@php.net