Skip to content

Commit 253de7e

Browse files
committed
Fix make installcheck for serializable transactions.
Commit e5550d5 added some new tests for ALTER TABLE which involved table scans. When default_transaction_isolation = 'serializable' these acquire relation-level SIReadLocks. The test results didn't cope with that. Add SIReadLock as the minimum lock level for purposes of these tests. This could also be fixed by excluding this type of lock from the my_locks view, but it would be a bug for SIReadLock to show up for a relation which was not otherwise locked, so do it this way to allow that sort of condition to cause a regression test failure. There is some question whether we could avoid taking SIReadLocks during these operations, but confirming the safety of that and figuring out how to avoid the locks is not trivial, and would be a separate patch. Backpatch to 9.4 where the new tests were added.
1 parent 3a14575 commit 253de7e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/test/regress/expected/alter_table.out

+2-1
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,8 @@ DROP TABLE check_fk_presence_1, check_fk_presence_2;
18421842
drop type lockmodes;
18431843
ERROR: type "lockmodes" does not exist
18441844
create type lockmodes as enum (
1845-
'AccessShareLock'
1845+
'SIReadLock'
1846+
,'AccessShareLock'
18461847
,'RowShareLock'
18471848
,'RowExclusiveLock'
18481849
,'ShareUpdateExclusiveLock'

src/test/regress/sql/alter_table.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,8 @@ DROP TABLE check_fk_presence_1, check_fk_presence_2;
12711271
--
12721272
drop type lockmodes;
12731273
create type lockmodes as enum (
1274-
'AccessShareLock'
1274+
'SIReadLock'
1275+
,'AccessShareLock'
12751276
,'RowShareLock'
12761277
,'RowExclusiveLock'
12771278
,'ShareUpdateExclusiveLock'

0 commit comments

Comments
 (0)