Skip to content

Commit ce0f3b5

Browse files
committed
Merge PR #106 from @k-webdesign
Fix concurrent unbuffered query dead lock
2 parents a8cc684 + 7088115 commit ce0f3b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Migration/AddSortFieldMigration.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* @package MetaModels/attribute_file
1414
* @author Ingolf Steinhardt <[email protected]>
15+
* @author Kim Wormer <[email protected]>
1516
* @copyright 2012-2022 The MetaModels team.
1617
* @license https://github.com/MetaModels/attribute_file/blob/master/LICENSE LGPL-3.0-or-later
1718
* @filesource
@@ -155,11 +156,13 @@ private function getFileAttributes()
155156
private function countMissingSortColumns($attributes): int
156157
{
157158
$countColumns = 0;
159+
$rows = $attributes->fetchAllAssociative();
158160

159-
while ($row = $attributes->fetchAssociative()) {
161+
foreach ($rows as $row) {
160162
if ($this->fieldExists($row['tableName'], $row['colname'] . '__sort')) {
161163
continue;
162164
}
165+
163166
$countColumns++;
164167
}
165168

0 commit comments

Comments
 (0)