mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-04 00:02:52 -05:00 
			
		
		
		
	Except_Intersect_Rewrite() forgot to move LIMIT info to new
topmost SELECT node after rearranging query tree.
This commit is contained in:
		
							parent
							
								
									e1c76c2533
								
							
						
					
					
						commit
						3d5079c174
					
				@ -6,7 +6,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * IDENTIFICATION
 | 
				
			||||||
 *	  $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.60 1999/10/07 04:23:15 tgl Exp $
 | 
					 *	  $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.61 1999/10/17 23:50:43 tgl Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 *-------------------------------------------------------------------------
 | 
					 *-------------------------------------------------------------------------
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@ -1806,6 +1806,8 @@ Except_Intersect_Rewrite(Query *parsetree)
 | 
				
			|||||||
	bool		isBinary,
 | 
						bool		isBinary,
 | 
				
			||||||
				isPortal,
 | 
									isPortal,
 | 
				
			||||||
				isTemp;
 | 
									isTemp;
 | 
				
			||||||
 | 
						Node	   *limitOffset,
 | 
				
			||||||
 | 
								   *limitCount;
 | 
				
			||||||
	CmdType		commandType = CMD_SELECT;
 | 
						CmdType		commandType = CMD_SELECT;
 | 
				
			||||||
	List	   *rtable_insert = NIL;
 | 
						List	   *rtable_insert = NIL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1856,6 +1858,8 @@ Except_Intersect_Rewrite(Query *parsetree)
 | 
				
			|||||||
	isBinary = parsetree->isBinary;
 | 
						isBinary = parsetree->isBinary;
 | 
				
			||||||
	isPortal = parsetree->isPortal;
 | 
						isPortal = parsetree->isPortal;
 | 
				
			||||||
	isTemp = parsetree->isTemp;
 | 
						isTemp = parsetree->isTemp;
 | 
				
			||||||
 | 
						limitOffset = parsetree->limitOffset;
 | 
				
			||||||
 | 
						limitCount = parsetree->limitCount;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * The operator tree attached to parsetree->intersectClause is still
 | 
						 * The operator tree attached to parsetree->intersectClause is still
 | 
				
			||||||
@ -2057,6 +2061,8 @@ Except_Intersect_Rewrite(Query *parsetree)
 | 
				
			|||||||
	result->isPortal = isPortal;
 | 
						result->isPortal = isPortal;
 | 
				
			||||||
	result->isBinary = isBinary;
 | 
						result->isBinary = isBinary;
 | 
				
			||||||
	result->isTemp = isTemp;
 | 
						result->isTemp = isTemp;
 | 
				
			||||||
 | 
						result->limitOffset = limitOffset;
 | 
				
			||||||
 | 
						result->limitCount = limitCount;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * The relation to insert into is attached to the range table of the
 | 
						 * The relation to insert into is attached to the range table of the
 | 
				
			||||||
@ -2080,6 +2086,7 @@ Except_Intersect_Rewrite(Query *parsetree)
 | 
				
			|||||||
		tent->resdom->resname = lfirst(resnames);
 | 
							tent->resdom->resname = lfirst(resnames);
 | 
				
			||||||
		resnames = lnext(resnames);
 | 
							resnames = lnext(resnames);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user