Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #13180 MySQL driver tells savepoint is supported for MyISAM tables
Submitted: 2008-02-23 04:34 UTC
From: ifeghali Assigned: quipo
Status: Closed Package: MDB2 (version 2.4.1)
PHP Version: 5.2.4 OS: Mac OS 10.5
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


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 : 20 - 5 = ?

 
 [2008-02-23 04:34 UTC] ifeghali (Igor Feghali)
Description: ------------ MDB2 doesn't checks the engine when telling whether savepoints are supported. Line 806 of Driver/mysql.php (2.4.1) only checks the mysql version which leads to an error when executing queries on a MyISAM table. That being said, IMHO, maybe the best approach would be to disable transactions for MySQL unless the user explicitly enables it. Test script: --------------- $support_transactions = $this->db->supports('transactions'); if ($support_transactions && PEAR::isError($res = $this->db->beginNestedTransaction())) { return $res; } $result = $this->db->exec($query); if (PEAR::isError($result)) { return $result; } if ($support_transactions && PEAR::isError($res = $this->db->completeNestedTransaction())) { return $res; } Expected result: ---------------- transactions not supported. Actual result: -------------- beginTransaction(1): Starting transaction/savepoint query(1): SAVEPOINT MDB2_SAVEPOINT_2 query(1): INSERT INTO `People` (`name`, `birthdate`, `occupation`, `updated`) VALUES ('Igor', '1984-05-23', 'engineer', CURRENT_TIMESTAMP) commit(1): Committing transaction/savepoint query(1): RELEASE SAVEPOINT MDB2_SAVEPOINT_2 commit(1): Committing transaction/savepoint query(1): COMMIT

Comments

 [2008-03-05 09:45 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.