From f050a94b48499286abfb4b69f3bcb3dee5f9ea2d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 12 Sep 2023 10:43:14 +0200 Subject: SQL: clean old auto-updates (#5649) Should help with some DB lock issues. Complete https://github.com/FreshRSS/FreshRSS/pull/3558 after https://github.com/FreshRSS/FreshRSS/pull/5625 already cherry-picked from it. * Removed auto-update of MySQL GUID case sensitivity https://github.com/FreshRSS/FreshRSS/pull/2078 * Contributed to a DB lock in https://github.com/FreshRSS/FreshRSS/issues/5008 Also removed the following non-problematic auto-updates, simply because they were older than the above ones * Auto-create custom labels (1.12.0) https://github.com/FreshRSS/FreshRSS/pull/2027 * Auto-add JSON column for feeds (1.11.0) https://github.com/FreshRSS/FreshRSS/pull/1838 * Auto-create temporary tables (1.7.0) https://github.com/FreshRSS/FreshRSS/pull/1470 --- app/Models/EntryDAO.php | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 8306320a0..8a006f802 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -26,26 +26,6 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { return str_replace('INSERT INTO ', 'INSERT IGNORE INTO ', $sql); } - //TODO: Move the database auto-updates to DatabaseDAO - protected function createEntryTempTable(): bool { - $ok = false; - $hadTransaction = $this->pdo->inTransaction(); - if ($hadTransaction) { - $this->pdo->commit(); - } - try { - require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php'); - Minz_Log::warning('SQL CREATE TABLE entrytmp...'); - $ok = $this->pdo->exec($GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] . $GLOBALS['SQL_CREATE_INDEX_ENTRY_1']) !== false; - } catch (Exception $ex) { - Minz_Log::error(__method__ . ' error: ' . $ex->getMessage()); - } - if ($hadTransaction) { - $this->pdo->beginTransaction(); - } - return $ok; - } - private function updateToMediumBlob(): bool { if ($this->pdo->dbType() !== 'mysql') { return false; @@ -96,14 +76,6 @@ SQL; } } } - if ($errorInfo[0] === FreshRSS_DatabaseDAO::ER_BAD_TABLE_ERROR) { - if (stripos($errorInfo[2], 'tag') !== false) { - $tagDAO = FreshRSS_Factory::createTagDao(); - return $tagDAO->createTagTable(); //v1.12.0 - } elseif (stripos($errorInfo[2], 'entrytmp') !== false) { - return $this->createEntryTempTable(); //v1.7.0 - } - } } if (isset($errorInfo[1])) { if ($errorInfo[1] == FreshRSS_DatabaseDAO::ER_DATA_TOO_LONG) { -- cgit v1.2.3