php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76019 PDO::ATTR_AUTOCOMMIT attribut via the connect
Submitted: 2018-02-27 14:16 UTC Modified: 2020-09-30 08:29 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: scriviaoscar at yahoo dot it Assigned: cmb (profile)
Status: Not a bug Package: PDO ODBC
PHP Version: 7.2.3 OS: centos 7.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:
47 - 38 = ?
Subscribe to this entry?

 
 [2018-02-27 14:16 UTC] 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'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-27 14:18 UTC] cmb@php.net
-Type: Documentation Problem +Type: Bug
 [2018-03-02 14:32 UTC] scriviaoscar at yahoo dot it
-PHP Version: 7.2.2 +PHP Version: 7.2.3
 [2018-03-02 14:32 UTC] 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'
 [2020-09-30 08:29 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-09-30 08:29 UTC] cmb@php.net
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)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 15:01:29 2024 UTC