mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix error in commit e6feef57.
				
					
				
			I was careless passing a datum directly to DATE_NOT_FINITE without calling DatumGetDateADT() first. Backpatch-through: 9.4
This commit is contained in:
		@@ -1431,13 +1431,15 @@ daterange_canonical(PG_FUNCTION_ARGS)
 | 
				
			|||||||
	if (empty)
 | 
						if (empty)
 | 
				
			||||||
		PG_RETURN_RANGE_P(r);
 | 
							PG_RETURN_RANGE_P(r);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!lower.infinite && !DATE_NOT_FINITE(lower.val) && !lower.inclusive)
 | 
						if (!lower.infinite && !DATE_NOT_FINITE(DatumGetDateADT(lower.val)) &&
 | 
				
			||||||
 | 
							!lower.inclusive)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
 | 
							lower.val = DirectFunctionCall2(date_pli, lower.val, Int32GetDatum(1));
 | 
				
			||||||
		lower.inclusive = true;
 | 
							lower.inclusive = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!upper.infinite && !DATE_NOT_FINITE(upper.val) && upper.inclusive)
 | 
						if (!upper.infinite && !DATE_NOT_FINITE(DatumGetDateADT(upper.val)) &&
 | 
				
			||||||
 | 
							upper.inclusive)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
 | 
							upper.val = DirectFunctionCall2(date_pli, upper.val, Int32GetDatum(1));
 | 
				
			||||||
		upper.inclusive = false;
 | 
							upper.inclusive = false;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user