From 1fee09fd07f6507657d28e542d725c9e7845cc31 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 27 Oct 2007 18:45:20 +0000 Subject: - inlined a couple of context variables - PG two phase was calling text() without the correct bind param format, previous compiler checkin revealed issue --- lib/sqlalchemy/databases/postgres.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/databases/postgres.py') diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 6449bdc14..00b297f97 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -310,7 +310,7 @@ class PGDialect(default.DefaultDialect): self.do_begin(connection.connection) def do_prepare_twophase(self, connection, xid): - connection.execute(sql.text("PREPARE TRANSACTION %(tid)s", bindparams=[sql.bindparam('tid', xid)])) + connection.execute(sql.text("PREPARE TRANSACTION :tid", bindparams=[sql.bindparam('tid', xid)])) def do_rollback_twophase(self, connection, xid, is_prepared=True, recover=False): if is_prepared: @@ -318,7 +318,7 @@ class PGDialect(default.DefaultDialect): #FIXME: ugly hack to get out of transaction context when commiting recoverable transactions # Must find out a way how to make the dbapi not open a transaction. connection.execute(sql.text("ROLLBACK")) - connection.execute(sql.text("ROLLBACK PREPARED %(tid)s", bindparams=[sql.bindparam('tid', xid)])) + connection.execute(sql.text("ROLLBACK PREPARED :tid", bindparams=[sql.bindparam('tid', xid)])) connection.execute(sql.text("BEGIN")) self.do_rollback(connection.connection) else: @@ -328,7 +328,7 @@ class PGDialect(default.DefaultDialect): if is_prepared: if recover: connection.execute(sql.text("ROLLBACK")) - connection.execute(sql.text("COMMIT PREPARED %(tid)s", bindparams=[sql.bindparam('tid', xid)])) + connection.execute(sql.text("COMMIT PREPARED :tid", bindparams=[sql.bindparam('tid', xid)])) connection.execute(sql.text("BEGIN")) self.do_rollback(connection.connection) else: -- cgit v1.2.1