php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tepkeev at gmail dot com
New email:
PHP Version: OS:

 

 [2010-10-03 12:25 UTC] tepkeev at gmail dot com
Description:
------------
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=127.0.0.1;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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-13 11:12 UTC] aharvey@php.net
-Status: Open +Status: Bogus
 [2010-10-13 11:12 UTC] aharvey@php.net
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: Thu Oct 31 22:01:27 2024 UTC