add pgxc_prepared_xact results to prepared_xacts expected output
authorTomas Vondra <[email protected]>
Sun, 22 Jan 2017 16:43:19 +0000 (17:43 +0100)
committerTomas Vondra <[email protected]>
Sun, 22 Jan 2017 16:43:19 +0000 (17:43 +0100)
The SQL file was calling pgxc_prepared_xact(), but the results were
not included in the expected file.

src/test/regress/expected/prepared_xacts.out

index f343cc0abb5ca31501e0ae2ec1574b3d5f89aa41..b795fc8151015dcf536442d2025a81eaa00a4f5f 100644 (file)
@@ -31,6 +31,13 @@ SELECT gid FROM pg_prepared_xacts ORDER BY gid;
  foo1
 (1 row)
 
+-- Test pgxc_prepared_xacts system view
+SELECT pgxc_prepared_xact FROM pgxc_prepared_xacts ORDER by 1;
+ pgxc_prepared_xact 
+--------------------
+ foo1
+(1 row)
+
 -- Test ROLLBACK PREPARED
 ROLLBACK PREPARED 'foo1';
 SELECT * FROM pxtest1  ORDER BY foobar;
@@ -39,11 +46,18 @@ SELECT * FROM pxtest1  ORDER BY foobar;
  aaa
 (1 row)
 
+-- Check prepared transactions on Coordinator
 SELECT gid FROM pg_prepared_xacts ORDER BY gid;
  gid 
 -----
 (0 rows)
 
+-- Check prepared transactions in the cluster
+SELECT pgxc_prepared_xact FROM pgxc_prepared_xacts ORDER by 1;
+ pgxc_prepared_xact 
+--------------------
+(0 rows)
+
 -- Test COMMIT PREPARED
 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
 INSERT INTO pxtest1 VALUES ('ddd');
@@ -80,19 +94,27 @@ SELECT * FROM pxtest1  ORDER BY foobar;
 (2 rows)
 
 PREPARE TRANSACTION 'foo3';
+-- Check prepared transactions on Coordinator
 SELECT gid FROM pg_prepared_xacts ORDER BY gid;
  gid  
 ------
  foo3
 (1 row)
 
+-- Check prepared transactions in the cluster
+SELECT pgxc_prepared_xact FROM pgxc_prepared_xacts ORDER by 1;
+ pgxc_prepared_xact 
+--------------------
+ foo3
+(1 row)
+
 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
 INSERT INTO pxtest1 VALUES ('fff');
 SELECT * FROM pxtest1  ORDER BY foobar;
 -- This should fail, because the gid foo3 is already in use
 PREPARE TRANSACTION 'foo3';
 ERROR:  transaction identifier "foo3" is already in use
-SELECT * FROM pxtest1;
+SELECT * FROM pxtest1  ORDER BY foobar;
  foobar 
 --------
  aaa
@@ -100,7 +122,7 @@ SELECT * FROM pxtest1;
 (2 rows)
 
 ROLLBACK PREPARED 'foo3';
-SELECT * FROM pxtest1;
+SELECT * FROM pxtest1  ORDER BY foobar;
  foobar 
 --------
  aaa
@@ -238,6 +260,13 @@ SELECT gid FROM pg_prepared_xacts;
  regress-two
 (1 row)
 
+-- Check prepared transactions in the cluster
+SELECT pgxc_prepared_xact FROM pgxc_prepared_xacts ORDER by 1;
+ pgxc_prepared_xact 
+--------------------
+ regress-two
+(1 row)
+
 -- Commit table drop
 COMMIT PREPARED 'regress-two';
 SELECT * FROM pxtest3;
@@ -250,6 +279,12 @@ SELECT gid FROM pg_prepared_xacts ORDER BY gid;
 -----
 (0 rows)
 
+-- Check prepared transactions in the cluster
+SELECT pgxc_prepared_xact FROM pgxc_prepared_xacts ORDER by 1;
+ pgxc_prepared_xact 
+--------------------
+(0 rows)
+
 -- Clean up
 DROP TABLE pxtest2;
 DROP TABLE pxtest3;  -- will still be there if prepared xacts are disabled