Bug #76019 [Opn->Nab]: PDO::ATTR_AUTOCOMMIT attribut via the connect
| From: | cmb@php.net | Date: | Wed, 30 Sep 2020 08:29:11 +0000 |
| Subject: | Bug #76019 [Opn->Nab]: PDO::ATTR_AUTOCOMMIT attribut via the connect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229281@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76019&edit=1
ID: 76019
Updated by: cmb@php.net
Reported by: scriviaoscar at yahoo dot it
Summary: PDO::ATTR_AUTOCOMMIT attribut via the connect
-Status: Open
+Status: Not a bug
Type: Bug
Package: PDO ODBC
Operating System: centos 7.4
PHP Version: 7.2.3
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
From <https://www.php.net/manual/en/pdo.setattribute.php>:
| PDO::ATTR_AUTOCOMMIT (available in OCI, Firebird and MySQL)
Previous Comments:
------------------------------------------------------------------------
[2018-03-02 14:32:29] scriviaoscar at yahoo dot it
In PHP 7.2.3 I have seen issues when trying to set the
PDO::ATTR_AUTOCOMMIT attribut via the connect.
This issue was not apparent in 7.2.0 I have reproduced the same issue with the following PDO based
extensions
$db = new PDO("ibm:db", "uname", "***", array(PDO::ATTR_AUTOCOMMIT
=> 0));
if ($db) print "Connection Established";
'PDOException' with message 'The auto-commit mode cannot be changed for this
driver'
------------------------------------------------------------------------
[2018-02-27 14:16:36] scriviaoscar at yahoo dot it
Description:
------------
---
From manual page: http://www.php.net/ref.pdo-odbc
---
In PHP 7.2.2 I have seen issues when trying to set the
PDO::ATTR_AUTOCOMMIT attribut via the connect.
This issue was not apparent in 7.2.0 I have reproduced the same issue with the following PDO based
extensions:
- PDO_ODBC
Reproduce code:
---------------
<?php
$db = new PDO("ibm:db", "uname", "***", array(PDO::ATTR_AUTOCOMMIT
=> 0));
if ($db) print "Connection Established";
?>
Expected result:
----------------
Connection Established
Test script:
---------------
$conn = new PDO ( "odbc:" . $this->nameDB, $this->utente, $this->pass, array (
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"
) );
if (! $conn) {
Logger::getInstance ()->logMessage ( 'Connessione Sap fallita.', Logger::ERROR );
throw new Exception ( 'Connessione Sap fallita.',
GlobalConstants::EXCEPTION_MESSAGE_FROM_SERVER );
}
$conn->setAttribute ( PDO::ATTR_AUTOCOMMIT, 0 );
Expected result:
----------------
'PDOException' with message 'The auto-commit mode cannot be changed for this
driver'
Actual result:
--------------
'PDOException' with message 'The auto-commit mode cannot be changed for this
driver'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76019&edit=1