Michael Braun 25d29deba0 calquery: fix $end/$finish typo that disabled the SQL end filter
In the time-range condition assembly the branch selection tested $end, but
the "end" attribute is stored in $finish ($finish = $v->GetAttribute("end")).
$end was never assigned, so isset($end) was always false: a bounded
time-range query (both start and end present) fell through to the "start
only" branch and the SQL upper-bound predicate
(first_instance_start <= :time_range_end, and the legacy
dtstart < :time_range_end) was never emitted.

The result stayed correct because a later PHP pass ($range_filter +
expand_event_instances) re-applies the true range -- which is why this was
invisible to the HTTP-level regression suite. But every bounded query
therefore fetched all events whose series starts after the requested end,
parsed each into a vComponent and ran recurrence expansion on it, only to
discard it.

Measured on a 6972-event database, a "today"/"this week" query fetched and
expanded ~99 rows (~15%) more than necessary -- worst on exactly the narrow
near-future windows clients poll most often.

Test $finish so the end predicate is emitted for bounded queries. Output is
unchanged (the existing regression suite still passes); this only lets
PostgreSQL prune events that start after the window instead of dropping them
in PHP.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-29 09:03:50 +02:00
2024-01-21 19:12:42 +13:00
2026-05-11 23:56:53 +02:00
2011-02-21 22:44:57 +13:00
2024-04-02 21:41:26 +13:00
2010-12-25 14:24:44 +13:00
2017-01-08 15:48:52 +01:00
2010-01-11 10:15:47 +13:00
2026-05-11 23:56:53 +02:00

DAViCal CalDAV Server by Andrew McMillan.

For documentation you are best advised to visit the DAViCal
website at https://www.davical.org/ or search our general mailing
list at https://lists.sourceforge.net/mailman/listinfo/davical-general

There's lots of useful information at https://wiki.davical.org/ as well,
and if you want access to update that contact us on IRC (#davical on OFTC,
be patient and stick around for a while) or send an e-mail
to <wiki-access@davical.org>.

Good luck!

Andrew McMillan

-----------------------------------------------
Copyright: 2006-2011 Andrew McMillan <andrew@mcmillan.net.nz>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
Description
DAViCal is a server for calendar sharing. It is an implementation of the CalDAV protocol which is designed for storing calendaring resources (in iCalendar format) on a remote shared server.
Readme
Languages
PHP 71%
PLpgSQL 13.2%
Perl 11.7%
Shell 2%
Prolog 0.6%
Other 1.5%