diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2010-07-29 11:06:34 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2010-07-29 11:06:34 +0000 |
commit | 04e17bae50a73af524731fa11210d5c3f7d8e1f9 (patch) | |
tree | 90bc0dfb7cf33cf1098dd24237dcb5496357ceee /src/backend/commands/cluster.c | |
parent | f0790a642c25bc3cc869331ba04656fd47323b81 (diff) |
Add explicit regression tests for ALTER TABLE lock levels.
Use this to catch a couple of lock level assignments that slipped
through manual testing, per Peter Eisentraut.
Diffstat (limited to 'src/backend/commands/cluster.c')
-rw-r--r-- | src/backend/commands/cluster.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ce99b55a637..48132b43e59 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.204 2010/07/25 23:21:21 rhaas Exp $ + * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.205 2010/07/29 11:06:34 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -376,7 +376,7 @@ cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose, /* Check heap and index are valid to cluster on */ if (OidIsValid(indexOid)) - check_index_is_clusterable(OldHeap, indexOid, recheck); + check_index_is_clusterable(OldHeap, indexOid, recheck, AccessExclusiveLock); /* Log what we're doing (this could use more effort) */ if (OidIsValid(indexOid)) @@ -405,11 +405,11 @@ cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose, * definition can't change under us. */ void -check_index_is_clusterable(Relation OldHeap, Oid indexOid, bool recheck) +check_index_is_clusterable(Relation OldHeap, Oid indexOid, bool recheck, LOCKMODE lockmode) { Relation OldIndex; - OldIndex = index_open(indexOid, AccessExclusiveLock); + OldIndex = index_open(indexOid, lockmode); /* * Check that index is in fact an index on the given relation |