The SQL query only handles the case where the new reservation start and end dates are between the star and end dates of existing reservations. That means the following two overlapping cases are not returned:
- the start date of the new reservation is before start and end dates of an existing reservation and the end date is between
- the start date of the new reservation is between and the end date is after.

To fix this issue, we can modify the WHERE conditions:

AND r.field_merci_date_value < '%s'
AND r.field_merci_date_value2 >= '%s'"

to

AND r.field_merci_date_value2 > '%s'
AND r.field_merci_date_value <= '%s'"
CommentFileSizeAuthor
#1 merci-1064724-1.patch565 bytes_toch

Comments

_toch’s picture

StatusFileSize
new565 bytes

And the patch that update the WHERE conditions

darrick’s picture

Status: Active » Needs review

I've commited a fix for this: http://drupal.org/cvs?commit=501684

darrick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.