File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ abstract class AbstractIntegrationTestCase extends TestCase
2121{
2222 private const POSTGRES_BLOCK_SIZE = 4294967296 ;
2323
24+ private const MODE_EXCLUSIVE = 'ExclusiveLock ' ;
25+ private const MODE_SHARE = 'ShareLock ' ;
26+
2427 protected function tearDown (): void
2528 {
2629 $ this ->closeAllPostgresPdoConnections ();
@@ -101,14 +104,15 @@ private function findPostgresAdvisoryLockInConnection(
101104 AND classid = :lock_catalog_id
102105 AND objid = :lock_object_id
103106 AND pid = :connection_pid
104- AND mode = 'ExclusiveLock'
107+ AND mode = :mode
105108 SQL
106109 );
107110 $ statement ->execute (
108111 [
109112 'lock_catalog_id ' => $ lockCatalogId ,
110113 'lock_object_id ' => $ lockObjectId ,
111114 'connection_pid ' => $ dbConnection ->pgsqlGetPid (),
115+ 'mode ' => self ::MODE_EXCLUSIVE ,
112116 ]
113117 );
114118
@@ -130,10 +134,14 @@ private function findAllPostgresAdvisoryLocks(): array
130134 SELECT *
131135 FROM pg_locks
132136 WHERE locktype = 'advisory'
133- AND mode = 'ExclusiveLock'
137+ AND mode = :mode
134138 SQL
135139 );
136- $ statement ->execute ();
140+ $ statement ->execute (
141+ [
142+ 'mode ' => self ::MODE_EXCLUSIVE ,
143+ ]
144+ );
137145
138146 return $ statement ->fetchAll (PDO ::FETCH_OBJ );
139147 }
You can’t perform that action at this time.
0 commit comments