|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52978 setAttribute doesn`t raise an error
Submitted: 2010-10-03 12:25 UTC Modified: 2010-10-13 11:12 UTC
From: tepkeev at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.3.3 OS: MacOS 10.6.4
Private report: No CVE-ID: None
 [2010-10-03 12:25 UTC] tepkeev at gmail dot com
PDO::setAttribute must raise an error if an incorrect value is passed for the 
attribute but it doesn`t, see example

Test script:
$pdo = new \PDO('mysql:host=;dbname=db', 'login', 'pass');
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::CASE_NATURAL);

Expected result:
Warning: Incorrect value for PDO::ATTR_ERRMODE

Actual result:
nothing - just empty screen


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-13 11:12 UTC]
-Status: Open +Status: Bogus
 [2010-10-13 11:12 UTC]
PDO::CASE_NATURAL is simply an integer constant -- 0, in this case. That is actually a valid value for setting the PDO::ATTR_ERRMODE attribute -- it's the same as PDO::ERRMODE_SILENT.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 13:01:29 2024 UTC