php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57746 Throws warning if persistent connections are enabled
Submitted: 2007-07-13 12:23 UTC Modified: 2021-02-15 12:54 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: paul at yahoo dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 5.2.1 OS: Windows
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: paul at yahoo dot com
New email:
PHP Version: OS:

 

 [2007-07-13 12:23 UTC] paul at yahoo dot com
Description:
------------
When trying to use persistent PDO connections with ODBC back end following warning is shown:

Warning: PDO::__construct(): SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in C:\_debug_tmp.php on line 32

This bug is also described here: 

http://bugs.php.net/bug.php?id=39929

Reproduce code:
---------------
<?php
$dbh = new PDO('odbc:dsn', 'user', 'pass', array(PDO::ATTR_PERSISTENT =>
true));
?>

Expected result:
----------------
Warning should not be displayed.

Actual result:
--------------
Warning: PDO::__construct(): SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in C:\_debug_tmp.php on line 32

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-26 11:00 UTC] michal dot zglinski at gmail dot com
In php 5.2.4 (windows) (pdo_odbc) I try to run this script:

$attributes = array(
    "AUTOCOMMIT", "ERRMODE", "CASE", "CLIENT_VERSION", "CONNECTION_STATUS",
    "ORACLE_NULLS", "PERSISTENT", "PREFETCH", "SERVER_INFO", "SERVER_VERSION",
    "TIMEOUT"
);

foreach ($attributes as $val) {
    echo "PDO::ATTR_$val: ";
    echo $conn->getAttribute(constant("PDO::ATTR_$val")) . "\n";
}

For:

PDO::ATTR_AUTOCOMMIT, PDO::ATTR_CONNECTION_STATUS, PDO::ATTR_PREFETCH, PDO::ATTR_SERVER_INFO, PDO::ATTR_SERVER_VERSION, PDO::ATTR_TIMEOUT

I have warning:
Warning: PDO::getAttribute() [function.PDO-getAttribute]: SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in C:\path\to\file.php on line xx
 [2009-11-30 14:58 UTC] kabot at go2 dot pl
I have the same problem on linux, php 5.2.8

PHP Warning:  PDO::__construct() [<a href='pdo.--construct'>pdo.--construct</a>]: SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in db.php on line 41
 [2021-02-15 12:54 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: PDO_ODBC +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2021-02-15 12:54 UTC] cmb@php.net
I think this is fixed[1] as of PHP 5.3.0.

[1] <https://github.com/php/php-src/commit/77e914e6dcb511603cd3544ac2251fc1503a982e>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 14:01:35 2025 UTC