From: Marcel Werk Date: Tue, 7 Nov 2023 13:03:19 +0000 (+0100) Subject: Add missing 'ORDER BY' X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=refs%2Fheads%2Fdiscourse;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.exporter.git Add missing 'ORDER BY' --- diff --git a/files/lib/system/exporter/DiscourseExporter.class.php b/files/lib/system/exporter/DiscourseExporter.class.php index 573e9be..a4fac97 100644 --- a/files/lib/system/exporter/DiscourseExporter.class.php +++ b/files/lib/system/exporter/DiscourseExporter.class.php @@ -7,7 +7,6 @@ use wcf\data\user\group\UserGroup; use wcf\system\database\PostgreSQLDatabase; use wcf\system\importer\ImportHandler; use wcf\system\WCF; -use wcf\util\StringUtil; /** * Exporter for Discourse. @@ -216,7 +215,8 @@ final class DiscourseExporter extends AbstractExporter FROM users LEFT JOIN user_emails ON (user_emails.user_id = users.id) - WHERE users.id > ?"; + WHERE users.id > ? + ORDER BY users.id"; $statement = $this->database->prepareStatement($sql, $limit, $offset); $statement->execute([0]); while ($row = $statement->fetchArray()) { @@ -670,7 +670,8 @@ final class DiscourseExporter extends AbstractExporter LEFT JOIN users ON (users.id = topic_users.user_id) WHERE topic_users.topic_id IN (SELECT id FROM topics WHERE archetype = ?) - AND topic_users.user_id > ?"; + AND topic_users.user_id > ? + ORDER BY topic_users.id"; $statement = $this->database->prepareStatement($sql, $limit, $offset); $statement->execute(['private_message', 0]); while ($row = $statement->fetchArray()) {