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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 08:01:29 2025 UTC