From cd16aa4b08587abaf523c8915de31fd9b6c86b32 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 11 Jan 2021 09:40:30 -0500 Subject: [PATCH] Fix commitNewEntries query There was an erroneous '; at the end of the commitNewEntries DELETE query, resulting in an exception during actualization with this output: ``` FreshRSS starting feeds actualization at 2021-01-11T14:06:09+00:00 FreshRSS actualize candrews... PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''' at line 1 in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php:45 Stack trace: #0 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php(45): PDO->exec() #1 /var/www/localhost/htdocs/FreshRSS/app/Models/EntryDAO.php(167): Minz_Pdo->exec() #2 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(505): FreshRSS_EntryDAO->commitNewEntries() #3 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(548): FreshRSS_feed_Controller::actualizeFeed() #4 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(119): FreshRSS_feed_Controller->actualizeAction() #5 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction() #6 /var/www/localhost/htdocs/FreshRSS/lib/Minz/FrontController.php(81): Minz_Dispatcher->run() #7 /var/www/localhost/htdocs/FreshRSS/app/actualize_script.php(75): Minz_FrontController->run() #8 {main} thrown in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php on line 45 Results: ``` --- app/Models/EntryDAO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 67ba84e756c..28a9b8bde5b 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -158,7 +158,7 @@ public function commitNewEntries() { FROM `_entrytmp` ORDER BY date; -DELETE FROM `_entrytmp` WHERE id <= @rank;'; +DELETE FROM `_entrytmp` WHERE id <= @rank; SQL; $hadTransaction = $this->pdo->inTransaction(); if (!$hadTransaction) {