Author: turnstep
Date: Sat Jan 19 10:23:36 2008
New Revision: 10615

Modified:
   DBD-Pg/trunk/Changes
   DBD-Pg/trunk/dbdimp.c

Log:
Get rid of the prohibition against preparing transactional commands.


Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes        (original)
+++ DBD-Pg/trunk/Changes        Sat Jan 19 10:23:36 2008
@@ -1,6 +1,11 @@
 ('GSM' is Greg Sabino Mullane, [EMAIL PROTECTED])
 
 2.0.0
+       - Allow raw transaction statements through - in other words, 
+               do not croak if $dbh->prepare("COMMIT") is attempted. Not 
+               only was this a little too controlling, there is a growing 
+               host of other commands such as "COMMIT PREPARED" that we
+               need to allow. [GSM].
        - Be much more flexible in test connection options. [GSM]
        - Skip item if no matching key in foreign_key_info.
                (CPAN bug #32308) [GSM]

Modified: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c       (original)
+++ DBD-Pg/trunk/dbdimp.c       Sat Jan 19 10:23:36 2008
@@ -1276,18 +1276,6 @@
                Copy(statement-newsize, imp_sth->firstword, newsize, char);
                imp_sth->firstword[newsize] = '\0';
 
-               /* Try to prevent transaction commands unless "pg_direct" is 
set */
-               if (0==strcasecmp(imp_sth->firstword, "BEGIN") ||
-                       0==strcasecmp(imp_sth->firstword, "END") ||
-                       0==strcasecmp(imp_sth->firstword, "ABORT") ||
-                       0==strcasecmp(imp_sth->firstword, "COMMIT") ||
-                       0==strcasecmp(imp_sth->firstword, "ROLLBACK") ||
-                       0==strcasecmp(imp_sth->firstword, "RELEASE") ||
-                       0==strcasecmp(imp_sth->firstword, "SAVEPOINT")
-                       ) {
-                       if (!imp_sth->direct)
-                               croak ("Please use DBI functions for 
transaction handling");
-               }
                /* Note whether this is preparable DML */
                if (0==strcasecmp(imp_sth->firstword, "SELECT") ||
                        0==strcasecmp(imp_sth->firstword, "INSERT") ||

Reply via email to