git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04c5b69)
- During dblink_open, if transaction state was IDLE, force cursor count to
2006年6月21日 16:43:11 +0000 (16:43 +0000)
2006年6月21日 16:43:11 +0000 (16:43 +0000)
initially be 0. This is needed as a previous ABORT might have wiped out
an automatically opened transaction without maintaining the cursor count.
- Fix regression test expected file for the correct ERROR message, which
we now get given the above bug fix.


diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index e8b301857624b66183bd09ac23104de380e72248..3b7afb7ac8f8a6743a7d511a5c140b2807eb48f1 100644 (file)
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -8,7 +8,7 @@
* Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
*
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.55 2006年05月30日 22:12:12 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.56 2006年06月21日 16:43:11 joe Exp $
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@@ -361,6 +361,13 @@ dblink_open(PG_FUNCTION_ARGS)
DBLINK_RES_INTERNALERROR("begin error");
PQclear(res);
rconn->newXactForCursor = TRUE;
+ /*
+ * Since transaction state was IDLE, we force cursor count to
+ * initially be 0. This is needed as a previous ABORT might
+ * have wiped out our transaction without maintaining the
+ * cursor count for us.
+ */
+ rconn->openCursorCount = 0;
}
/* if we started a transaction, increment cursor count */
diff --git a/contrib/dblink/expected/dblink.out b/contrib/dblink/expected/dblink.out
index 55d2b9e7c4c084ceb7f9b15a5f6d72b0eb621893..f2e364a9423e872416bda12b1c45c1ed4525dbca 100644 (file)
--- a/contrib/dblink/expected/dblink.out
+++ b/contrib/dblink/expected/dblink.out
@@ -509,7 +509,7 @@ SELECT dblink_close('myconn','rmt_foo_cursor');
-- this should fail because there is no open transaction
SELECT dblink_exec('myconn','DECLARE xact_test CURSOR FOR SELECT * FROM foo');
ERROR: sql error
-DETAIL: ERROR: cursor "xact_test" already exists
+DETAIL: ERROR: DECLARE CURSOR may only be used in transaction blocks
-- reset remote transaction state
SELECT dblink_exec('myconn','ABORT');
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /