Commit 8c3fff73 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Fix offset of one for date_part(timespan) when given arguments of

 decade, century, or millenium.
parent ba71b819
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.63 1999/02/13 04:25:01 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.64 1999/02/13 05:34:24 thomas Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -1744,15 +1744,15 @@ datetime_part(text *units, DateTime *datetime)
break;
case DTK_DECADE:
*result = (tm->tm_year / 10) + 1;
*result = (tm->tm_year / 10);
break;
case DTK_CENTURY:
*result = (tm->tm_year / 100) + 1;
*result = (tm->tm_year / 100);
break;
case DTK_MILLENIUM:
*result = (tm->tm_year / 1000) + 1;
*result = (tm->tm_year / 1000);
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment