Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
4fe20123
Commit
4fe20123
authored
20 years ago
by
Neil Conway
Browse files
Options
Downloads
Patches
Plain Diff
Add regression tests for recent cursor/savepoint bug fixed by Alvaro and
Tom.
parent
aba691b7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/regress/expected/transactions.out
+47
-0
47 additions, 0 deletions
src/test/regress/expected/transactions.out
src/test/regress/sql/transactions.sql
+35
-0
35 additions, 0 deletions
src/test/regress/sql/transactions.sql
with
82 additions
and
0 deletions
src/test/regress/expected/transactions.out
+
47
−
0
View file @
4fe20123
...
@@ -470,3 +470,50 @@ ROLLBACK;
...
@@ -470,3 +470,50 @@ ROLLBACK;
DROP TABLE foo;
DROP TABLE foo;
DROP TABLE baz;
DROP TABLE baz;
DROP TABLE barbaz;
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;
This diff is collapsed.
Click to expand it.
src/test/regress/sql/transactions.sql
+
35
−
0
View file @
4fe20123
...
@@ -290,3 +290,38 @@ ROLLBACK;
...
@@ -290,3 +290,38 @@ ROLLBACK;
DROP
TABLE
foo
;
DROP
TABLE
foo
;
DROP
TABLE
baz
;
DROP
TABLE
baz
;
DROP
TABLE
barbaz
;
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
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment