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)
|
foreach ($tables_ary as $field => $tables)
|
||||||
{
|
{
|
||||||
$start = 0;
|
$start = 0;
|
||||||
@ -1714,7 +1717,7 @@ class acp_forums
|
|||||||
$sql = "SELECT $field
|
$sql = "SELECT $field
|
||||||
FROM " . POSTS_TABLE . '
|
FROM " . POSTS_TABLE . '
|
||||||
WHERE forum_id = ' . $forum_id;
|
WHERE forum_id = ' . $forum_id;
|
||||||
$result = $db->sql_query_limit($sql, 500, $start);
|
$result = $db->sql_query_limit($sql, $batch_size, $start);
|
||||||
|
|
||||||
$ids = array();
|
$ids = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
@ -1733,7 +1736,7 @@ class acp_forums
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($row);
|
while (sizeof($ids) == $batch_size);
|
||||||
}
|
}
|
||||||
unset($ids);
|
unset($ids);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user