yearMonthDuration arithmetic bug

Bug #1154367 reported by Paul J. Lucas
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Critical
Nicolae Brinza

Bug Description

Given:

let $t := xs:date("1900-01-01")
return
    for $i in 1 to 75
    return $t + xs:yearMonthDuration('P1Y') * $i

one gets:

1901-01-01 1902-01-01 1903-01-01 1904-01-01 1905-01-01 1906-01-01 1907-01-01 1908-01-01 1909-01-01 1910-01-01 1911-01-01 1912-01-01 1913-01-01 1914-01-01 1915-01-01 1916-01-01 1917-01-01 1918-01-01 1919-01-01 1920-01-01 1921-01-01 1922-01-01 1923-01-01 1924-01-01 1925-01-01 1926-01-01 1927-01-01 1928-01-01 1929-01-01 1930-01-01 1931-01-01 1932-01-01 1933-01-01 1934-01-01 1935-01-01 1936-01-01 1937-01-01 1938-01-01 1939-01-01 1940-01-01 1941-01-01 1942-01-01 1943-01-01 1944-01-01 1945-01-01 1946-01-01 1947-01-01 1948-01-01 1949-01-01 1950-01-01 1951-01-01 1952-01-01 1953-01-01 1954-01-01 1955-01-01 1956-01-01 1957-01-01 1958-01-01 1959-01-01 1960-01-01 1961-01-01 1962-01-01 1963-01-01 1964-01-01 1965-01-01 1966-01-01 1967-01-01 1968-01-01 1969-01-01 1969-02-01 1969-02-01 1969-02-01 1969-02-01 1969-02-01 1969-02-01

Notice that it gets stuck on the year 1969 at the end (and that the month changes to 02).

Initial assignment to Matthias. Nicolae has the FOTS duration bugs assigned to him. Perhaps he should have this one assign too? Reassign as appropriate.

Tags: fots

Related branches

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Assigning to Nicolae because it might be related to https://bugs.launchpad.net/zorba/+bug/1123836.

Changed in zorba:
assignee: Matthias Brantner (matthias-brantner) → Nicolae Brinza (nbrinza)
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

This may also affect FOTS tests format-date-005 and format-date-006.

Chris Hillery (ceejatec)
tags: added: fots
Nicolae Brinza (nbrinza)
Changed in zorba:
status: New → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.