~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/test/regress/expected/prepared_xacts.out

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-07-14 18:39:43 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110714183943-eqlbsrurk6kh6lou
Tags: 9.1~beta3-1
* New upstream beta release.
  - Works around gcc 4.6.0 bug. (Closes: #633086)

  Note that this does not change the data format since Beta 2, so no need
  to dump/reload clusters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
90
90
INSERT INTO pxtest1 VALUES ('fff');
91
 
SELECT * FROM pxtest1;
92
 
 foobar 
93
 
--------
94
 
 aaa
95
 
 ddd
96
 
 fff
97
 
(3 rows)
98
 
 
99
91
-- This should fail, because the gid foo3 is already in use
100
92
PREPARE TRANSACTION 'foo3';
101
93
ERROR:  transaction identifier "foo3" is already in use
114
106
 ddd
115
107
(2 rows)
116
108
 
 
109
-- Test serialization failure (SSI)
 
110
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
 
111
UPDATE pxtest1 SET foobar = 'eee' WHERE foobar = 'ddd';
 
112
SELECT * FROM pxtest1;
 
113
 foobar 
 
114
--------
 
115
 aaa
 
116
 eee
 
117
(2 rows)
 
118
 
 
119
PREPARE TRANSACTION 'foo4';
 
120
SELECT gid FROM pg_prepared_xacts;
 
121
 gid  
 
122
------
 
123
 foo4
 
124
(1 row)
 
125
 
 
126
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
 
127
SELECT * FROM pxtest1;
 
128
 foobar 
 
129
--------
 
130
 aaa
 
131
 ddd
 
132
(2 rows)
 
133
 
 
134
-- This should fail, because the two transactions have a write-skew anomaly
 
135
INSERT INTO pxtest1 VALUES ('fff');
 
136
ERROR:  could not serialize access due to read/write dependencies among transactions
 
137
DETAIL:  Canceled on identification as a pivot, during write.
 
138
HINT:  The transaction might succeed if retried.
 
139
PREPARE TRANSACTION 'foo5';
 
140
SELECT gid FROM pg_prepared_xacts;
 
141
 gid  
 
142
------
 
143
 foo4
 
144
(1 row)
 
145
 
 
146
ROLLBACK PREPARED 'foo4';
 
147
SELECT gid FROM pg_prepared_xacts;
 
148
 gid 
 
149
-----
 
150
(0 rows)
 
151
 
117
152
-- Clean up
118
153
DROP TABLE pxtest1;
119
154
-- Test subtransactions