|
@@ -28,9 +28,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
|
|
|
try {
|
|
try {
|
|
|
require_once(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php');
|
|
require_once(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php');
|
|
|
Minz_Log::warning('SQL CREATE TABLE entrytmp...');
|
|
Minz_Log::warning('SQL CREATE TABLE entrytmp...');
|
|
|
- $ok = $this->pdo->exec(SQL_CREATE_TABLE_ENTRYTMP) !== false;
|
|
|
|
|
- } catch (Exception $e) {
|
|
|
|
|
- Minz_Log::error('FreshRSS_EntryDAO::createEntryTempTable error: ' . $e->getMessage());
|
|
|
|
|
|
|
+ $ok = $this->pdo->exec(SQL_CREATE_TABLE_ENTRYTMP . SQL_CREATE_INDEX_ENTRY_1) !== false;
|
|
|
|
|
+ } catch (Exception $ex) {
|
|
|
|
|
+ Minz_Log::error(__method__ . ' error: ' . $ex->getMessage());
|
|
|
}
|
|
}
|
|
|
if ($hadTransaction) {
|
|
if ($hadTransaction) {
|
|
|
$this->pdo->beginTransaction();
|
|
$this->pdo->beginTransaction();
|
|
@@ -129,7 +129,7 @@ SQL;
|
|
|
if ($this->addEntryPrepared && $this->addEntryPrepared->execute()) {
|
|
if ($this->addEntryPrepared && $this->addEntryPrepared->execute()) {
|
|
|
return true;
|
|
return true;
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $this->addEntryPrepared == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $this->addEntryPrepared->errorInfo();
|
|
|
|
|
|
|
+ $info = $this->addEntryPrepared == null ? $this->pdo->errorInfo() : $this->addEntryPrepared->errorInfo();
|
|
|
if ($this->autoUpdateDb($info)) {
|
|
if ($this->autoUpdateDb($info)) {
|
|
|
$this->addEntryPrepared = null;
|
|
$this->addEntryPrepared = null;
|
|
|
return $this->addEntry($valuesTmp);
|
|
return $this->addEntry($valuesTmp);
|
|
@@ -215,7 +215,7 @@ SQL;
|
|
|
if ($this->updateEntryPrepared && $this->updateEntryPrepared->execute()) {
|
|
if ($this->updateEntryPrepared && $this->updateEntryPrepared->execute()) {
|
|
|
return true;
|
|
return true;
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $this->updateEntryPrepared == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $this->updateEntryPrepared->errorInfo();
|
|
|
|
|
|
|
+ $info = $this->updateEntryPrepared == null ? $this->pdo->errorInfo() : $this->updateEntryPrepared->errorInfo();
|
|
|
if ($this->autoUpdateDb($info)) {
|
|
if ($this->autoUpdateDb($info)) {
|
|
|
return $this->updateEntry($valuesTmp);
|
|
return $this->updateEntry($valuesTmp);
|
|
|
}
|
|
}
|
|
@@ -252,7 +252,7 @@ SQL;
|
|
|
if ($stm && $stm->execute($values)) {
|
|
if ($stm && $stm->execute($values)) {
|
|
|
return $stm->rowCount();
|
|
return $stm->rowCount();
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markFavorite: ' . $info[2]);
|
|
Minz_Log::error('SQL error markFavorite: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -297,7 +297,7 @@ SQL;
|
|
|
if ($stm && $stm->execute($values)) {
|
|
if ($stm && $stm->execute($values)) {
|
|
|
return true;
|
|
return true;
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]);
|
|
Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -334,7 +334,7 @@ SQL;
|
|
|
$values = array_merge($values, $ids);
|
|
$values = array_merge($values, $ids);
|
|
|
$stm = $this->pdo->prepare($sql);
|
|
$stm = $this->pdo->prepare($sql);
|
|
|
if (!($stm && $stm->execute($values))) {
|
|
if (!($stm && $stm->execute($values))) {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markRead: ' . $info[2]);
|
|
Minz_Log::error('SQL error markRead: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -353,7 +353,7 @@ SQL;
|
|
|
if ($stm && $stm->execute($values)) {
|
|
if ($stm && $stm->execute($values)) {
|
|
|
return $stm->rowCount();
|
|
return $stm->rowCount();
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markRead: ' . $info[2]);
|
|
Minz_Log::error('SQL error markRead: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -402,7 +402,7 @@ SQL;
|
|
|
|
|
|
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markReadEntries: ' . $info[2]);
|
|
Minz_Log::error('SQL error markReadEntries: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -440,7 +440,7 @@ SQL;
|
|
|
|
|
|
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markReadCat: ' . $info[2]);
|
|
Minz_Log::error('SQL error markReadCat: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -479,7 +479,7 @@ SQL;
|
|
|
|
|
|
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markReadFeed: ' . $info[2] . ' with SQL: ' . $sql . $search);
|
|
Minz_Log::error('SQL error markReadFeed: ' . $info[2] . ' with SQL: ' . $sql . $search);
|
|
|
$this->pdo->rollBack();
|
|
$this->pdo->rollBack();
|
|
|
return false;
|
|
return false;
|
|
@@ -493,7 +493,7 @@ SQL;
|
|
|
$stm = $this->pdo->prepare($sql);
|
|
$stm = $this->pdo->prepare($sql);
|
|
|
$stm->bindParam(':id', $id_feed, PDO::PARAM_INT);
|
|
$stm->bindParam(':id', $id_feed, PDO::PARAM_INT);
|
|
|
if (!($stm && $stm->execute())) {
|
|
if (!($stm && $stm->execute())) {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markReadFeed cache: ' . $info[2]);
|
|
Minz_Log::error('SQL error markReadFeed cache: ' . $info[2]);
|
|
|
$this->pdo->rollBack();
|
|
$this->pdo->rollBack();
|
|
|
return false;
|
|
return false;
|
|
@@ -533,7 +533,7 @@ SQL;
|
|
|
|
|
|
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
$stm = $this->pdo->prepare($sql . $search);
|
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
if (!($stm && $stm->execute(array_merge($values, $searchValues)))) {
|
|
|
- $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error markReadTag: ' . $info[2]);
|
|
Minz_Log::error('SQL error markReadTag: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -565,7 +565,7 @@ SQL;
|
|
|
if ($stm && $stm->execute()) {
|
|
if ($stm && $stm->execute()) {
|
|
|
return $stm->rowCount();
|
|
return $stm->rowCount();
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
if ($this->autoUpdateDb($info)) {
|
|
if ($this->autoUpdateDb($info)) {
|
|
|
return $this->cleanOldEntries($id_feed, $date_min, $keep);
|
|
return $this->cleanOldEntries($id_feed, $date_min, $keep);
|
|
|
}
|
|
}
|
|
@@ -838,7 +838,7 @@ SQL;
|
|
|
if ($stm && $stm->execute($values)) {
|
|
if ($stm && $stm->execute($values)) {
|
|
|
return $stm;
|
|
return $stm;
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
Minz_Log::error('SQL error listWhereRaw: ' . $info[2]);
|
|
Minz_Log::error('SQL error listWhereRaw: ' . $info[2]);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -896,7 +896,7 @@ SQL;
|
|
|
}
|
|
}
|
|
|
return $result;
|
|
return $result;
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
if ($this->autoUpdateDb($info)) {
|
|
if ($this->autoUpdateDb($info)) {
|
|
|
return $this->listHashForFeedGuids($id_feed, $guids);
|
|
return $this->listHashForFeedGuids($id_feed, $guids);
|
|
|
}
|
|
}
|
|
@@ -920,7 +920,7 @@ SQL;
|
|
|
if ($stm && $stm->execute($values)) {
|
|
if ($stm && $stm->execute($values)) {
|
|
|
return $stm->rowCount();
|
|
return $stm->rowCount();
|
|
|
} else {
|
|
} else {
|
|
|
- $info = $stm == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $stm->errorInfo();
|
|
|
|
|
|
|
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
|
|
|
if ($this->autoUpdateDb($info)) {
|
|
if ($this->autoUpdateDb($info)) {
|
|
|
return $this->updateLastSeen($id_feed, $guids);
|
|
return $this->updateLastSeen($id_feed, $guids);
|
|
|
}
|
|
}
|