[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#9120) Searches including generalizedTime attributes with index



Howard Chu wrote:
> Howard Chu wrote:
>> markus.widmer@daasi.de wrote:
> 
>>> We could reproduce this with 2.4.42, 2.4.44 and 2.4.48. We hope you can
>>> reproduce this as well to see what is happening here.
>>
>> Yes, can reproduce this. The function that converts a component-wise time
>> into a timet is referencing time since 1970. The date in 1956 would yield a
>> negative timet value but the fields are unsigned ints, so instead it's treated
>> as 17,000 years in the future. We can probably change this to handle signed
>> timestamps but need to consider this further.
>>
> I believe the best way forward would be to allow signed values, and also to switch
> our epoch reference from 1970-01-01 to 0000-01-01 (i.e., use Gregorian Proleptic calendar).
> Year zero would be 1 BCE in this calendar, and anything earlier would be a negative year.
> 
> Changing these functions will require regenerating any indices. Looks like something
> we'll rewrite for 2.5 but leave 2.4 alone.

Fixed in git master commit 97c145919d8c702003b9cd8bac0e01083d3ab9a1

The time is now calculated with signed years, but the result is still returned
as an unsigned value (with negative years properly sorting as less than positive
years).

Note that the slapd schema validator still rejects negative years at the moment.
Will need to look further at that later.

-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/