From 6ad4ebe4317e466dad9e45fdbcf9d4c82630f1cd Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 28 May 2017 20:23:13 +0200 Subject: [PATCH] Fix SQL syntax error on MariaDB 10.2 (#5774) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_contacts.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 301f0c100..16931ef89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ CHANGELOG Roundcube Webmail - Fix POST parameter reflection in default_charset selector (#5768) - Enigma: Fix compatibility with assets_dir - Managesieve: Skip redundant LISTSCRIPTS command +- Fix SQL syntax error on MariaDB 10.2 (#5774) RELEASE 1.3-rc -------------- diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php index c26527cba..6082d8d25 100644 --- a/program/lib/Roundcube/rcube_contacts.php +++ b/program/lib/Roundcube/rcube_contacts.php @@ -487,7 +487,7 @@ class rcube_contacts extends rcube_addressbook // count contacts for this user $sql_result = $this->db->query( - "SELECT COUNT(c.`contact_id`) AS rows". + "SELECT COUNT(c.`contact_id`) AS cnt". " FROM " . $this->db->table_name($this->db_name, true) . " AS c". $join. " WHERE c.`del` <> 1". @@ -500,7 +500,7 @@ class rcube_contacts extends rcube_addressbook $sql_arr = $this->db->fetch_assoc($sql_result); - $this->cache['count'] = (int) $sql_arr['rows']; + $this->cache['count'] = (int) $sql_arr['cnt']; return $this->cache['count']; }