plugins/calendar
Aleksander Machniak
machniak at kolabsys.com
Wed Mar 26 11:37:13 CET 2014
plugins/calendar/drivers/database/database_driver.php | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 7fb7ef6d0f262454e5388147ff303e4af645e291
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Wed Mar 26 11:36:48 2014 +0100
Fix SQL query for Postgres - removed useless GROUP BY clause
diff --git a/plugins/calendar/drivers/database/database_driver.php b/plugins/calendar/drivers/database/database_driver.php
index 44e2729..b50b23b 100644
--- a/plugins/calendar/drivers/database/database_driver.php
+++ b/plugins/calendar/drivers/database/database_driver.php
@@ -793,13 +793,12 @@ class database_driver extends calendar_driver
$events = array();
if (!empty($calendar_ids)) {
$result = $this->rc->db->query(sprintf(
- "SELECT e.*, (SELECT COUNT(attachment_id) FROM " . $this->db_attachments . "
- WHERE event_id = e.event_id OR event_id = e.recurrence_id) AS _attachments
- FROM " . $this->db_events . " AS e
+ "SELECT e.*, (SELECT COUNT(attachment_id) FROM " . $this->db_attachments . "
+ WHERE event_id = e.event_id OR event_id = e.recurrence_id) AS _attachments
+ FROM " . $this->db_events . " e
WHERE e.calendar_id IN (%s)
- AND e.start <= %s AND e.end >= %s
- %s
- GROUP BY e.event_id",
+ AND e.start <= %s AND e.end >= %s
+ %s",
join(',', $calendar_ids),
$this->rc->db->fromunixtime($end),
$this->rc->db->fromunixtime($start),
More information about the commits
mailing list