1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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

@ -3758,7 +3758,7 @@ $\ldots$/src/backend/tcop/postgres.c}.
List *
pg_parse_and_plan(char *query_string, Oid *typev,
int nargs,
QueryTreeList **queryListP,
List **queryListP,
CommandDest dest)
{
.
@ -4032,7 +4032,7 @@ instead.
if(IsA(tree, SelectStmt))
{
QueryTreeList *qtree;
List *qtrees;
/* If we get to the tree given in first_select
* return parsetree instead of performing
@ -4044,9 +4044,8 @@ instead.
else
{
/* transform the unprocessed Query nodes */
qtree =
parse_analyze(lcons(tree, NIL), NULL);
result = (Node *)qtree->qtrees[0];
qtrees = parse_analyze(lcons(tree, NIL), NULL);
result = (Node *) lfirst(qtrees);
}
}
if(IsA(tree,Expr))