diff options
| author | 2019-11-18 19:46:38 +0100 | |
|---|---|---|
| committer | 2019-11-18 19:46:38 +0100 | |
| commit | 1ddf98c50b2e0388c76386202bd8be3442640418 (patch) | |
| tree | 50557fb86ac94109ae5286f8befe3484839287f4 /app/Models/CategoryDAO.php | |
| parent | d3735d04fcdb557a2ecc798f9914b9f769daf781 (diff) | |
Fix adding categories in MySQL 5.5 (#2672)
Fix https://github.com/FreshRSS/FreshRSS/issues/2670 (from
https://github.com/FreshRSS/FreshRSS/pull/2335 )
Tested with MySQL 5.5.40, the oldest version on Docker Hub
Debian 8.0 Jessie ships MySQL 5.5.43
Diffstat (limited to 'app/Models/CategoryDAO.php')
| -rw-r--r-- | app/Models/CategoryDAO.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 08dc4eef0..4bba23d9c 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -81,7 +81,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable public function addCategory($valuesTmp) { $sql = 'INSERT INTO `_category`(name, attributes) ' - . 'SELECT * FROM (SELECT TRIM(?), ?) c2 ' //TRIM() to provide a type hint as text for PostgreSQL + . 'SELECT * FROM (SELECT TRIM(?) AS name, TRIM(?) AS attributes) c2 ' //TRIM() to provide a type hint as text . 'WHERE NOT EXISTS (SELECT 1 FROM `_tag` WHERE name = TRIM(?))'; //No tag of the same name $stm = $this->pdo->prepare($sql); |
