Skip to content

Commit

Permalink
Fix commitNewEntries query
Browse files Browse the repository at this point in the history
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()
FreshRSS#1 /var/www/localhost/htdocs/FreshRSS/app/Models/EntryDAO.php(167): Minz_Pdo->exec()
FreshRSS#2 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(505): FreshRSS_EntryDAO->commitNewEntries()
FreshRSS#3 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(548): FreshRSS_feed_Controller::actualizeFeed()
FreshRSS#4 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(119): FreshRSS_feed_Controller->actualizeAction()
FreshRSS#5 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction()
FreshRSS#6 /var/www/localhost/htdocs/FreshRSS/lib/Minz/FrontController.php(81): Minz_Dispatcher->run()
FreshRSS#7 /var/www/localhost/htdocs/FreshRSS/app/actualize_script.php(75): Minz_FrontController->run()
FreshRSS#8 {main}
  thrown in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php on line 45
Results:
```
  • Loading branch information
candrews committed Jan 11, 2021
1 parent 8584f49 commit cd16aa4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/EntryDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cd16aa4

Please sign in to comment.