mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix (well, add) support for ISO "week" in date_part(). Needed for ODBC.
Fix spelling of "millennium". Thanks to Mika Nystrom <mika@camembert.cs.caltech.edu> for spotting this.
This commit is contained in:
		@@ -8,7 +8,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * IDENTIFICATION
 | 
			
		||||
 *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.46 2000/04/12 17:15:49 momjian Exp $
 | 
			
		||||
 *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.47 2000/04/14 15:22:10 thomas Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -260,15 +260,14 @@ static datetkn deltatktbl[] = {
 | 
			
		||||
	{"hours", UNITS, DTK_HOUR}, /* "hours" relative time units */
 | 
			
		||||
	{"hr", UNITS, DTK_HOUR},	/* "hour" relative time units */
 | 
			
		||||
	{"hrs", UNITS, DTK_HOUR},	/* "hours" relative time units */
 | 
			
		||||
	{INVALID, RESERV, DTK_INVALID},		/* "invalid" reserved for invalid
 | 
			
		||||
										 * time */
 | 
			
		||||
	{INVALID, RESERV, DTK_INVALID},		/* reserved for invalid time */
 | 
			
		||||
	{"m", UNITS, DTK_MINUTE},	/* "minute" relative time units */
 | 
			
		||||
	{"microsecon", UNITS, DTK_MICROSEC},		/* "microsecond" relative
 | 
			
		||||
												 * time units */
 | 
			
		||||
	{"mil", UNITS, DTK_MILLENIUM},		/* "millenium" relative time units */
 | 
			
		||||
	{"mils", UNITS, DTK_MILLENIUM},		/* "millenia" relative time units */
 | 
			
		||||
	{"millenia", UNITS, DTK_MILLENIUM}, /* "millenia" relative time units */
 | 
			
		||||
	{DMILLENIUM, UNITS, DTK_MILLENIUM}, /* "millenium" relative time units */
 | 
			
		||||
	{"mil", UNITS, DTK_MILLENNIUM},		/* "millennium" relative time units */
 | 
			
		||||
	{"mils", UNITS, DTK_MILLENNIUM},	  /* "millennia" relative time units */
 | 
			
		||||
	{"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative time units */
 | 
			
		||||
	{DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative time units */
 | 
			
		||||
	{"millisecon", UNITS, DTK_MILLISEC},		/* relative time units */
 | 
			
		||||
	{"min", UNITS, DTK_MINUTE}, /* "minute" relative time units */
 | 
			
		||||
	{"mins", UNITS, DTK_MINUTE},/* "minutes" relative time units */
 | 
			
		||||
@@ -1794,7 +1793,7 @@ DecodeDateDelta(char **field, int *ftype, int nf, int *dtype, struct tm * tm, do
 | 
			
		||||
						tmask = ((fmask & DTK_M(YEAR)) ? 0 : DTK_M(YEAR));
 | 
			
		||||
						break;
 | 
			
		||||
 | 
			
		||||
					case DTK_MILLENIUM:
 | 
			
		||||
					case DTK_MILLENNIUM:
 | 
			
		||||
						tm->tm_year += val * 1000;
 | 
			
		||||
						if (fval != 0)
 | 
			
		||||
							tm->tm_mon += (fval * 12000);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user