Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4fe20123
Commit
4fe20123
authored
Jan 27, 2005
by
Neil Conway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression tests for recent cursor/savepoint bug fixed by Alvaro and
Tom.
parent
aba691b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
src/test/regress/expected/transactions.out
src/test/regress/expected/transactions.out
+47
-0
src/test/regress/sql/transactions.sql
src/test/regress/sql/transactions.sql
+35
-0
No files found.
src/test/regress/expected/transactions.out
View file @
4fe20123
...
...
@@ -470,3 +470,50 @@ ROLLBACK;
DROP TABLE foo;
DROP TABLE baz;
DROP TABLE barbaz;
-- verify that cursors created during an aborted subtransaction are
-- closed, but that we do not rollback the effect of any FETCHs
-- performed in the aborted subtransaction
begin;
savepoint x;
create table abc (a int);
insert into abc values (5);
insert into abc values (10);
declare foo cursor for select * from abc;
fetch from foo;
a
---
5
(1 row)
rollback to x;
-- should fail
fetch from foo;
ERROR: cursor "foo" does not exist
commit;
begin;
create table abc (a int);
insert into abc values (5);
insert into abc values (10);
insert into abc values (15);
declare foo cursor for select * from abc;
fetch from foo;
a
---
5
(1 row)
savepoint x;
fetch from foo;
a
----
10
(1 row)
rollback to x;
fetch from foo;
a
----
15
(1 row)
abort;
src/test/regress/sql/transactions.sql
View file @
4fe20123
...
...
@@ -290,3 +290,38 @@ ROLLBACK;
DROP
TABLE
foo
;
DROP
TABLE
baz
;
DROP
TABLE
barbaz
;
-- verify that cursors created during an aborted subtransaction are
-- closed, but that we do not rollback the effect of any FETCHs
-- performed in the aborted subtransaction
begin
;
savepoint
x
;
create
table
abc
(
a
int
);
insert
into
abc
values
(
5
);
insert
into
abc
values
(
10
);
declare
foo
cursor
for
select
*
from
abc
;
fetch
from
foo
;
rollback
to
x
;
-- should fail
fetch
from
foo
;
commit
;
begin
;
create
table
abc
(
a
int
);
insert
into
abc
values
(
5
);
insert
into
abc
values
(
10
);
insert
into
abc
values
(
15
);
declare
foo
cursor
for
select
*
from
abc
;
fetch
from
foo
;
savepoint
x
;
fetch
from
foo
;
rollback
to
x
;
fetch
from
foo
;
abort
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment