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
35ecc244
Commit
35ecc244
authored
Apr 05, 2015
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new test files for lock level patch
parent
cf376a4a
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2845 additions
and
0 deletions
+2845
-0
src/test/isolation/expected/alter-table-2.out
src/test/isolation/expected/alter-table-2.out
+1389
-0
src/test/isolation/expected/alter-table-3.out
src/test/isolation/expected/alter-table-3.out
+947
-0
src/test/isolation/expected/create-trigger.out
src/test/isolation/expected/create-trigger.out
+421
-0
src/test/isolation/specs/alter-table-2.spec
src/test/isolation/specs/alter-table-2.spec
+30
-0
src/test/isolation/specs/alter-table-3.spec
src/test/isolation/specs/alter-table-3.spec
+30
-0
src/test/isolation/specs/create-trigger.spec
src/test/isolation/specs/create-trigger.spec
+28
-0
No files found.
src/test/isolation/expected/alter-table-2.out
0 → 100644
View file @
35ecc244
This diff is collapsed.
Click to expand it.
src/test/isolation/expected/alter-table-3.out
0 → 100644
View file @
35ecc244
This diff is collapsed.
Click to expand it.
src/test/isolation/expected/create-trigger.out
0 → 100644
View file @
35ecc244
This diff is collapsed.
Click to expand it.
src/test/isolation/specs/alter-table-2.spec
0 → 100644
View file @
35ecc244
# ALTER TABLE - Add foreign keys with concurrent reads
#
# ADD CONSTRAINT uses ShareRowExclusiveLock so we mix writes with it
# to see what works or waits.
setup
{
CREATE TABLE a (i int PRIMARY KEY);
CREATE TABLE b (a_id int);
INSERT INTO a VALUES (0), (1), (2), (3);
INSERT INTO b SELECT generate_series(1,1000) % 4;
}
teardown
{
DROP TABLE a, b;
}
session "s1"
step "s1a" { BEGIN; }
step "s1b" { ALTER TABLE b ADD CONSTRAINT bfk FOREIGN KEY (a_id) REFERENCES a (i) NOT VALID; }
step "s1c" { COMMIT; }
session "s2"
step "s2a" { BEGIN; }
step "s2b" { SELECT * FROM a WHERE i = 1 LIMIT 1 FOR UPDATE; }
step "s2c" { SELECT * FROM b WHERE a_id = 3 LIMIT 1 FOR UPDATE; }
step "s2d" { INSERT INTO b VALUES (0); }
step "s2e" { INSERT INTO a VALUES (4); }
step "s2f" { COMMIT; }
src/test/isolation/specs/alter-table-3.spec
0 → 100644
View file @
35ecc244
# ALTER TABLE - Enable and disable triggers with concurrent reads
#
# ENABLE/DISABLE TRIGGER uses ShareRowExclusiveLock so we mix writes with
# it to see what works or waits.
setup
{
CREATE TABLE a (i int PRIMARY KEY);
INSERT INTO a VALUES (0), (1), (2), (3);
CREATE FUNCTION f() RETURNS TRIGGER LANGUAGE plpgsql AS 'BEGIN RETURN NULL; END;';
CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
}
teardown
{
DROP TABLE a;
DROP FUNCTION f();
}
session "s1"
step "s1a" { BEGIN; }
step "s1b" { ALTER TABLE a DISABLE TRIGGER t; }
step "s1c" { ALTER TABLE a ENABLE TRIGGER t; }
step "s1d" { COMMIT; }
session "s2"
step "s2a" { BEGIN; }
step "s2b" { SELECT * FROM a WHERE i = 1 LIMIT 1 FOR UPDATE; }
step "s2c" { INSERT INTO a VALUES (0); }
step "s2d" { COMMIT; }
src/test/isolation/specs/create-trigger.spec
0 → 100644
View file @
35ecc244
# CREATE TRIGGER - Add trigger with concurrent reads
#
# CREATE TRIGGER uses ShareRowExclusiveLock so we mix writes with it
# to see what works or waits.
setup
{
CREATE TABLE a (i int);
CREATE FUNCTION f() RETURNS TRIGGER LANGUAGE plpgsql AS 'BEGIN RETURN NULL; END;';
INSERT INTO a VALUES (0), (1), (2), (3);
}
teardown
{
DROP TABLE a;
DROP FUNCTION f();
}
session "s1"
step "s1a" { BEGIN; }
step "s1b" { CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); }
step "s1c" { COMMIT; }
session "s2"
step "s2a" { BEGIN; }
step "s2b" { SELECT * FROM a WHERE i = 1 FOR UPDATE; }
step "s2c" { UPDATE a SET i = 4 WHERE i = 3; }
step "s2d" { COMMIT; }
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