mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-25 12:33:29 +01:00
Merge branch 'ticket/bantu/9514' into develop-olympus
* ticket/bantu/9514: [ticket/9514] Correctly delete big datasets when deleting a forum including topics/posts on non-MySQL databases.
This commit is contained in:
commit
8196d7d711
@ -1705,6 +1705,9 @@ class acp_forums
|
||||
)
|
||||
);
|
||||
|
||||
// Amount of rows we select and delete in one iteration.
|
||||
$batch_size = 500;
|
||||
|
||||
foreach ($tables_ary as $field => $tables)
|
||||
{
|
||||
$start = 0;
|
||||
@ -1714,7 +1717,7 @@ class acp_forums
|
||||
$sql = "SELECT $field
|
||||
FROM " . POSTS_TABLE . '
|
||||
WHERE forum_id = ' . $forum_id;
|
||||
$result = $db->sql_query_limit($sql, 500, $start);
|
||||
$result = $db->sql_query_limit($sql, $batch_size, $start);
|
||||
|
||||
$ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@ -1733,7 +1736,7 @@ class acp_forums
|
||||
}
|
||||
}
|
||||
}
|
||||
while ($row);
|
||||
while (sizeof($ids) == $batch_size);
|
||||
}
|
||||
unset($ids);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user