Req #58600 [Com]: Support for transactions -mssql
| From: | programmer at finner dot de | Date: | Sat, 10 Mar 2012 17:36:41 +0000 |
| Subject: | Req #58600 [Com]: Support for transactions -mssql | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168338@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=58600&edit=1
ID: 58600
Comment by: programmer at finner dot de
Reported by: sigurdne at online dot no
Summary: Support for transactions -mssql
Status: Closed
Type: Feature/Change Request
Package: *General Issues
Operating System: Ubuntu 8.10
PHP Version: 5.2.6
Assigned To: ssufficool
Block user comment: N
Private report: N
New Comment:
This issue is identical to #38955 (from 2006-09-25!!!). Obviously nobody
recognized, that the OP referred to MSSQL via DBLIB/FreeTds, NOT to MySQL. I did
not find anything about issues #38955 or #58600, or anything about a fix of lack
of transactions in the changelogs up to 5.4, and with 5.3.10 I got this error
myself today. Therefore, this issue should remain open until it is really fixed.
Issue #38955 is also closed due to "No developer cares about it", which is quite
arrogant.
Previous Comments:
------------------------------------------------------------------------
[2011-12-01 05:38:26] ssufficool@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Try 5.4 RC2
------------------------------------------------------------------------
[2009-03-30 02:26:16] sigurdne at online dot no
By looking at the pdo_mysql - it looks like something like this could work.
However there seems to be a problem that the transaction state is not reported correctly - so when
it comes to the commit - it claims that it is not in a transaction.
Anyone that could help out?
diff -aburN --exclude='.svn*' --exclude='CVS*' PDO_DBLIB-1.0.org/dblib_driver.c
PDO_DBLIB-1.0/dblib_driver.c
--- PDO_DBLIB-1.0.org/dblib_driver.c 2005-10-16 16:58:50.000000000 +0200
+++ PDO_DBLIB-1.0/dblib_driver.c 2009-03-27 13:10:14.000000000 +0100
@@ -166,14 +166,30 @@
return 1;
}
+static int dblib_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return 0 <= dblib_handle_doer(dbh, ZEND_STRL("BEGIN TRAN") TSRMLS_CC);
+}
+
+static int dblib_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return 0 <= dblib_handle_doer(dbh, ZEND_STRL("COMMIT TRAN") TSRMLS_CC);
+}
+
+static int dblib_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return 0 <= dblib_handle_doer(dbh, ZEND_STRL("ROLLBACK TRAN") TSRMLS_CC);
+}
+
+
static struct pdo_dbh_methods dblib_methods = {
dblib_handle_closer,
dblib_handle_preparer,
dblib_handle_doer,
dblib_handle_quoter,
- NULL,
- NULL,
- NULL,
+ dblib_handle_begin,
+ dblib_handle_commit,
+ dblib_handle_rollback,
NULL,
NULL, /* last insert */
dblib_fetch_error, /* fetch error */
------------------------------------------------------------------------
[2009-03-27 04:57:32] sigurdne at online dot no
Description:
------------
Would be nice to support transactions for mssql.
Tried both the precompiled ubuntu packages and custom built from pecl with the same result:
'This driver doesn't support transactions'
Cutom built:
versions:
* PDO-1.0.3
* PDO_DBLIB-1.0
* FreeTDS 0.82
To allow configure to work:
$ touch /usr/include/tds.h
$ touch /usr/lib/libtds.a
configure:
$ ./configure --with-mssql
Reproduce code:
---------------
$this->db = new PDO("dblib:host={$this->Host};dbname={$this->Database}",
$this->User, $this->Password, array(PDO::ATTR_PERSISTENT => $persistent));
$this->db->beginTransaction();
Actual result:
--------------
Error message: 'This driver doesn't support transactions'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=58600&edit=1