mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	Fix division by zero in the new range type histogram creation.
Report and analysis by Matthias.
This commit is contained in:
		
							parent
							
								
									a66fca3f0c
								
							
						
					
					
						commit
						3e6eb0dd0a
					
				| @ -158,7 +158,10 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, | ||||
| 		/* Must copy the target values into anl_context */ | ||||
| 		old_cxt = MemoryContextSwitchTo(stats->anl_context); | ||||
| 
 | ||||
| 		if (non_empty_cnt > 0) | ||||
| 		/*
 | ||||
| 		 * Generate a histogram slot entry if there are at least two values. | ||||
| 		 */ | ||||
| 		if (non_empty_cnt >= 2) | ||||
| 		{ | ||||
| 			/* Sort bound values */ | ||||
| 			qsort_arg(lowers, non_empty_cnt, sizeof(RangeBound), | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user