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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 7 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Apr 23 13:01:29 2024 UTC