mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	interval_out failed to mention 'ago' for negative intervals in SQL and
GERMAN datestyles. Ancient bug reported by Terry Lee Tucker.
This commit is contained in:
		
							parent
							
								
									5f0a468454
								
							
						
					
					
						commit
						d3d00715e2
					
				| @ -8,7 +8,7 @@ | |||||||
|  * |  * | ||||||
|  * |  * | ||||||
|  * IDENTIFICATION |  * IDENTIFICATION | ||||||
|  *	  $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.136 2004/12/31 22:01:21 pgsql Exp $ |  *	  $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.137 2005/01/11 18:33:45 tgl Exp $ | ||||||
|  * |  * | ||||||
|  *------------------------------------------------------------------------- |  *------------------------------------------------------------------------- | ||||||
|  */ |  */ | ||||||
| @ -3932,7 +3932,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str) | |||||||
| 		cp += strlen(cp); | 		cp += strlen(cp); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (is_before && (style == USE_POSTGRES_DATES)) | 	if (is_before && (style != USE_ISO_DATES)) | ||||||
| 	{ | 	{ | ||||||
| 		strcat(cp, " ago"); | 		strcat(cp, " ago"); | ||||||
| 		cp += strlen(cp); | 		cp += strlen(cp); | ||||||
|  | |||||||
| @ -663,7 +663,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str) | |||||||
| 		cp += strlen(cp); | 		cp += strlen(cp); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (is_before && (style == USE_POSTGRES_DATES)) | 	if (is_before && (style != USE_ISO_DATES)) | ||||||
| 	{ | 	{ | ||||||
| 		strcat(cp, " ago"); | 		strcat(cp, " ago"); | ||||||
| 		cp += strlen(cp); | 		cp += strlen(cp); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user