php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56300 Can't construct (DB doesn't like "AUTOCOMMIT")
Submitted: 2005-02-14 15:41 UTC Modified: 2005-02-21 11:10 UTC
From: sean at caedmon dot net Assigned: hartmut (profile)
Status: Closed Package: PDO_MYSQL (PECL)
PHP Version: 5.0.3 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sean at caedmon dot net
New email:
PHP Version: OS:

 

 [2005-02-14 15:41 UTC] sean at caedmon dot net
Description:
------------
(from CVS, ~15:00EDT, 2005.02.14)

When connecting to MySQL 3.23 (constructor), I get:
SQLSTATE[HY000] [1064] You have an error in your SQL syntax near 'AUTOCOMMIT=1' at line 1

When I exception->getMessage()

MySQL version:
3.23.49-log

S

Reproduce code:
---------------
try {
  $PDO = new PDO('mysql:dbname=php_commits;host=localhost', 'phpcommits', 'asdu34');
}
catch (PDOException $e) {
  echo 'Connection failed: ' . $e->getMessage();
}


Expected result:
----------------
no failure

Actual result:
--------------
SQLSTATE[HY000] [1064] You have an error in your SQL syntax near 'AUTOCOMMIT=1' at line 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-14 23:11 UTC] sean at caedmon dot net
Temporary fix (MySQL autocommits by default, anyway, according to the docs) -- couldn't find where SET AUTOCOMMIT=1 became valid syntax.

http://www.phpdoc.info/patches/fix_pdo_mysql.patch

(yes, I know that this isn't a real solution)

S
 [2005-02-15 00:40 UTC] wez@php.net
Hartmut, looks like we need to probe the mysql version before trying this.
 [2005-02-21 11:10 UTC] hholzgra@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC