aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-01 19:35:14 +0200
committerGravatar GitHub <noreply@github.com> 2016-10-01 19:35:14 +0200
commit0ccf100568dc76bd88443fac13c5aef15fed9ff6 (patch)
tree2b72a0afa0fc0fcbd97ed85192fa3737313e7298 /app/Models/EntryDAOSQLite.php
parent8a58795e7dfd501c6c8ac84694e695c4f0791cfb (diff)
parent32ac41439a67e2c5777f9da80324fe0bfbf394ff (diff)
Merge pull request #1195 from Alkarex/PostgreSQL
PostgreSQL
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
-rw-r--r--app/Models/EntryDAOSQLite.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index dad34a93d..fd5d25bf6 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -2,6 +2,10 @@
class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
+ public function sqlHexDecode($x) {
+ return $x;
+ }
+
protected function autoUpdateDb($errorInfo) {
if (empty($errorInfo[0]) || $errorInfo[0] == '42S22') { //ER_BAD_FIELD_ERROR
//autoAddColumn
@@ -24,7 +28,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
protected function updateCacheUnreads($catId = false, $feedId = false) {
$sql = 'UPDATE `' . $this->prefix . 'feed` '
- . 'SET cache_nbUnreads=('
+ . 'SET `cache_nbUnreads`=('
. 'SELECT COUNT(*) AS nbUnreads FROM `' . $this->prefix . 'entry` e '
. 'WHERE e.id_feed=`' . $this->prefix . 'feed`.id AND e.is_read=0) '
. 'WHERE 1';
@@ -82,7 +86,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
}
$affected = $stm->rowCount();
if ($affected > 0) {
- $sql = 'UPDATE `' . $this->prefix . 'feed` SET cache_nbUnreads=cache_nbUnreads' . ($is_read ? '-' : '+') . '1 '
+ $sql = 'UPDATE `' . $this->prefix . 'feed` SET `cache_nbUnreads`=`cache_nbUnreads`' . ($is_read ? '-' : '+') . '1 '
. 'WHERE id=(SELECT e.id_feed FROM `' . $this->prefix . 'entry` e WHERE e.id=?)';
$values = array($ids);
$stm = $this->bd->prepare($sql);