#44173 [Opn->Asn]: PDO->query() parameter parsing/checking needs an update
| From: | mbeccati@php.net | Date: | Wed, 01 Apr 2009 18:14:13 +0000 |
| Subject: | #44173 [Opn->Asn]: PDO->query() parameter parsing/checking needs an update | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135461@lists.php.net to get a copy of this message | ||
ID: 44173
Updated by: mbeccati@php.net
Reported By: uwendel at mysql dot com
-Status: Open
+Status: Assigned
Bug Type: PDO related
-Operating System: Linux
+Operating System: Irrelevant
PHP Version: 5.3CVS-2008-02-19 (CVS)
-Assigned To:
+Assigned To: mbeccati
Previous Comments:
------------------------------------------------------------------------
[2009-03-22 19:36:38] matteo at beccati dot com
The following patch also removes the goto from the function, as
suggested by Johannes:
http://www.beccati.com/misc/php/pdo_pgsql_bug44173_php_5.3_v2.patch
------------------------------------------------------------------------
[2009-03-22 17:59:16] matteo at beccati dot com
Fix is available here:
http://www.beccati.com/misc/php/pdo_pgsql_bug44173_php_5.3.patch
------------------------------------------------------------------------
[2008-02-19 16:25:01] uwendel at mysql dot com
And a last one...
[7] PDO->query('SELECT....', PDO::FETCH_CLASS) -> proper error message
nixnutz@ulflinux:~/php53> sapi/cli/php -r 'error_reporting(E_ALL);
$pdo=new PDO("sqlite:/tmp/foo.db");
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@$pdo->exec("DROP TABLE test"); $pdo->exec("CREATE TABLE test(id INT)");
$pdo->exec("INSERT INTO test(id) VALUES (1)");
var_dump($pdo->query("SELECT id FROM test", PDO::FETCH_CLASS,
"unknown"));'
Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in Command line
code on line 1
bool(false)
I have not checked other error modes of PDO. I do not know if PDO shall
raise an exception for every warning it prints, if that's intended at
all.
------------------------------------------------------------------------
[2008-02-19 16:21:04] uwendel at mysql dot com
[6] PDO->query("SELECT", PDO::FETCH_COLUMN) -> error message could be
better
nixnutz@ulflinux:~/php53> sapi/cli/php -r 'error_reporting(E_ALL);
$pdo=new PDO("sqlite:/tmp/foo.db");
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@$pdo->exec("DROP TABLE test"); $pdo->exec("CREATE TABLE test(id INT)");
$pdo->exec("INSERT INTO test(id) VALUES (1)");
var_dump($pdo->query("SELECT id FROM test", PDO::FETCH_COLUMN));'
Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in Command line
code on line 1
bool(false)
------------------------------------------------------------------------
[2008-02-19 16:18:07] uwendel at mysql dot com
[5] PDO->query('SELECT ...', PDO::FETCH_INTO) -> no proper error
message
nixnutz@ulflinux:~/php53> sapi/cli/php -r 'error_reporting(E_ALL);
$pdo=new PDO("sqlite:/tmp/foo.db");
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@$pdo->exec("DROP TABLE test"); $pdo->exec("CREATE TABLE test(id INT)");
$pdo->exec("INSERT INTO test(id) VALUES (1)");
var_dump($pdo->query("SELECT id FROM test", PDO::FETCH_INTO));'
Warning: PDO::query(): SQLSTATE[]: <<Unknown error>> in Command line
code on line 1
bool(false)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/44173
--
Edit this bug report at http://bugs.php.net/?id=44173&edit=1