? .deps
? .regression.diffs.swp
? current.diff
? dblink.sql
? libdblink.so.0.0
? results
Index: dblink.c
===================================================================
RCS file: /cvsroot/pgsql/contrib/dblink/dblink.c,v
retrieving revision 1.55
diff -c -r1.55 dblink.c
*** dblink.c	30 May 2006 22:12:12 -0000	1.55
--- dblink.c	20 Jun 2006 16:28:01 -0000
***************
*** 361,366 ****
--- 361,373 ----
  			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 */
Index: expected/dblink.out
===================================================================
RCS file: /cvsroot/pgsql/contrib/dblink/expected/dblink.out,v
retrieving revision 1.16
diff -c -r1.16 dblink.out
*** expected/dblink.out	18 Oct 2005 02:55:49 -0000	1.16
--- expected/dblink.out	20 Jun 2006 16:28:01 -0000
***************
*** 509,515 ****
  -- 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
  
  -- reset remote transaction state
  SELECT dblink_exec('myconn','ABORT');
--- 509,515 ----
  -- 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:  DECLARE CURSOR may only be used in transaction blocks
  
  -- reset remote transaction state
  SELECT dblink_exec('myconn','ABORT');
