diff options
| author | 2018-10-25 22:43:13 +0200 | |
|---|---|---|
| committer | 2018-10-25 22:43:13 +0200 | |
| commit | 307e6995fec51d368beeada9e1b69c40c3e7d065 (patch) | |
| tree | 6b957ef160882351af9c65c1d7e337e123c65110 /app/Models/DatabaseDAO.php | |
| parent | 3eae8bd3b7b5f82f71aef341e6bf519483903867 (diff) | |
MySQL GUID case sensitive (#2078)
* MySQL GUID case sensitive
latin1_bin
https://github.com/FreshRSS/FreshRSS/issues/2077
* Prepare update for existing bases
* Perform DB update during actualize
* Reduce frequency slightly
* No optimize at the same time
* Take advantage of the SQL modifications in 1.12
* Move higher up
* Move to purge, which all users can manually call
Diffstat (limited to 'app/Models/DatabaseDAO.php')
| -rw-r--r-- | app/Models/DatabaseDAO.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php index 54076d7a9..dbd328bf7 100644 --- a/app/Models/DatabaseDAO.php +++ b/app/Models/DatabaseDAO.php @@ -141,4 +141,23 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo { } return $ok; } + + public function ensureCaseInsensitiveGuids() { + $ok = true; + $db = FreshRSS_Context::$system_conf->db; + if ($db['type'] === 'mysql') { + include_once(APP_PATH . '/SQL/install.sql.mysql.php'); + if (defined('SQL_UPDATE_GUID_LATIN1_BIN')) { //FreshRSS 1.12 + try { + $sql = sprintf(SQL_UPDATE_GUID_LATIN1_BIN, $this->prefix); + $stm = $this->bd->prepare($sql); + $ok = $stm->execute(); + } catch (Exception $e) { + $ok = false; + Minz_Log::error('FreshRSS_DatabaseDAO::ensureCaseInsensitiveGuids error: ' . $e->getMessage()); + } + } + } + return $ok; + } } |
