1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Rip out QueryTreeList structure, root and branch. Querytree

lists are now plain old garden-variety Lists, allocated with palloc,
rather than specialized expansible-array data allocated with malloc.
This substantially simplifies their handling and eliminates several
sources of memory leakage.
Several basic types of erroneous queries (syntax error, attempt to
insert a duplicate key into a unique index) now demonstrably leak
zero bytes per query.
This commit is contained in:
Tom Lane
1999-05-13 07:29:22 +00:00
parent f80642137c
commit 507a0a2ab0
18 changed files with 192 additions and 288 deletions

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.40 1999/05/12 17:04:47 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.41 1999/05/13 07:28:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -3107,25 +3107,25 @@ void create_list(Node *ptr, List **intersect_list)
* instead. */
Node *intersect_tree_analyze(Node *tree, Node *first_select, Node *parsetree)
{
Node *result = (Node *)NIL;
List *arg;
if(IsA(tree, SelectStmt))
Node *result = (Node *) NIL;
List *arg;
if (IsA(tree, SelectStmt))
{
QueryTreeList *qtree;
/* If we get to the tree given in first_select return
* parsetree instead of performing parse_analyze() */
if(tree == first_select){
result = parsetree;
}
else {
/* transform the 'raw' nodes to 'cooked' Query nodes */
qtree = parse_analyze(lcons(tree, NIL), NULL);
result = (Node *)qtree->qtrees[0];
}
/* If we get to the tree given in first_select return
* parsetree instead of performing parse_analyze() */
if (tree == first_select)
{
result = parsetree;
}
else
{
/* transform the 'raw' nodes to 'cooked' Query nodes */
List *qtree = parse_analyze(lcons(tree, NIL), NULL);
result = (Node *) lfirst(qtree);
}
}
if(IsA(tree,Expr))
{
/* Call recursively for every argument of the node */