mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin.
This commit is contained in:
		
							parent
							
								
									82468b428b
								
							
						
					
					
						commit
						27bdb0c40d
					
				| @ -9,7 +9,7 @@ | |||||||
|  * |  * | ||||||
|  * |  * | ||||||
|  * IDENTIFICATION |  * IDENTIFICATION | ||||||
|  *	  $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.106 2005/04/19 03:13:58 momjian Exp $ |  *	  $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.107 2005/06/05 01:48:34 tgl Exp $ | ||||||
|  * |  * | ||||||
|  *------------------------------------------------------------------------- |  *------------------------------------------------------------------------- | ||||||
|  */ |  */ | ||||||
| @ -284,7 +284,11 @@ assign_timezone(const char *value, bool doit, GucSource source) | |||||||
| 		if (doit) | 		if (doit) | ||||||
| 		{ | 		{ | ||||||
| 			/* Here we change from SQL to Unix sign convention */ | 			/* Here we change from SQL to Unix sign convention */ | ||||||
|  | #ifdef HAVE_INT64_TIMESTAMP | ||||||
|  | 			CTimeZone = -(interval->time / USECS_PER_SEC); | ||||||
|  | #else | ||||||
| 			CTimeZone = -interval->time; | 			CTimeZone = -interval->time; | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| 			HasCTZSet = true; | 			HasCTZSet = true; | ||||||
| 		} | 		} | ||||||
| @ -399,7 +403,11 @@ show_timezone(void) | |||||||
| 		Interval interval; | 		Interval interval; | ||||||
| 
 | 
 | ||||||
| 		interval.month = 0; | 		interval.month = 0; | ||||||
|  | #ifdef HAVE_INT64_TIMESTAMP | ||||||
|  | 		interval.time = -(CTimeZone * USECS_PER_SEC); | ||||||
|  | #else | ||||||
| 		interval.time = -CTimeZone; | 		interval.time = -CTimeZone; | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| 		tzn = DatumGetCString(DirectFunctionCall1(interval_out, | 		tzn = DatumGetCString(DirectFunctionCall1(interval_out, | ||||||
| 										  IntervalPGetDatum(&interval))); | 										  IntervalPGetDatum(&interval))); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user