diff options
| author | Tom Lane | 1999-05-13 07:29:22 +0000 |
|---|---|---|
| committer | Tom Lane | 1999-05-13 07:29:22 +0000 |
| commit | 507a0a2ab09144f524e3239b7fc201ad1ad1b78e (patch) | |
| tree | 77c434943724f627e3c901f06443f02ae57d467b /src/include | |
| parent | f80642137cc0d2dbdaea68b8e439de0d50a5c01f (diff) | |
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.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/executor/spi_priv.h | 6 | ||||
| -rw-r--r-- | src/include/optimizer/planner.h | 4 | ||||
| -rw-r--r-- | src/include/parser/analyze.h | 4 | ||||
| -rw-r--r-- | src/include/parser/parse_node.h | 8 | ||||
| -rw-r--r-- | src/include/parser/parser.h | 4 | ||||
| -rw-r--r-- | src/include/tcop/tcopprot.h | 6 |
6 files changed, 13 insertions, 19 deletions
diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h index 0ed47bf1e1d..ece8a5a1c74 100644 --- a/src/include/executor/spi_priv.h +++ b/src/include/executor/spi_priv.h @@ -3,7 +3,7 @@ * spi.c * Server Programming Interface private declarations * - * $Header: /cvsroot/pgsql/src/include/executor/spi_priv.h,v 1.2 1999/02/13 23:21:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/include/executor/spi_priv.h,v 1.3 1999/05/13 07:28:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ typedef struct { - QueryTreeList *qtlist; /* malloced */ + List *qtlist; uint32 processed; /* by Executor */ SPITupleTable *tuptable; Portal portal; /* portal per procedure */ @@ -25,7 +25,7 @@ typedef struct typedef struct { - QueryTreeList *qtlist; + List *qtlist; List *ptlist; int nargs; Oid *argtypes; diff --git a/src/include/optimizer/planner.h b/src/include/optimizer/planner.h index 12411789683..6bad60b6ada 100644 --- a/src/include/optimizer/planner.h +++ b/src/include/optimizer/planner.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: planner.h,v 1.10 1999/02/13 23:21:51 momjian Exp $ + * $Id: planner.h,v 1.11 1999/05/13 07:29:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,6 +22,6 @@ extern Plan *planner(Query *parse); extern Plan *union_planner(Query *parse); -extern void pg_checkretval(Oid rettype, QueryTreeList *querytree_list); +extern void pg_checkretval(Oid rettype, List *querytree_list); #endif /* PLANNER_H */ diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h index 4be7637d744..af775c84f89 100644 --- a/src/include/parser/analyze.h +++ b/src/include/parser/analyze.h @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: analyze.h,v 1.5 1999/01/18 00:10:11 momjian Exp $ + * $Id: analyze.h,v 1.6 1999/05/13 07:29:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -14,7 +14,7 @@ #include <parser/parse_node.h> -extern QueryTreeList *parse_analyze(List *pl, ParseState *parentParseState); +extern List *parse_analyze(List *pl, ParseState *parentParseState); /***S*I***/ extern void create_select_list(Node *ptr, List **select_list, bool *unionall_present); extern Node *A_Expr_to_Expr(Node *ptr, bool *intersect_present); diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index 23040b57239..9bc4cf2b13b 100644 --- a/src/include/parser/parse_node.h +++ b/src/include/parser/parse_node.h @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: parse_node.h,v 1.11 1998/09/01 04:37:35 momjian Exp $ + * $Id: parse_node.h,v 1.12 1999/05/13 07:29:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,12 +19,6 @@ #include <parser/parse_type.h> #include <utils/rel.h> -typedef struct QueryTreeList -{ - int len; /* number of queries */ - Query **qtrees; -} QueryTreeList; - /* state information used during parse analysis */ typedef struct ParseState { diff --git a/src/include/parser/parser.h b/src/include/parser/parser.h index 8d13e028809..50b99b48ce6 100644 --- a/src/include/parser/parser.h +++ b/src/include/parser/parser.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: parser.h,v 1.4 1998/09/01 04:37:42 momjian Exp $ + * $Id: parser.h,v 1.5 1999/05/13 07:29:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,6 @@ #include <parser/parse_node.h> -extern QueryTreeList *parser(char *str, Oid *typev, int nargs); +extern List *parser(char *str, Oid *typev, int nargs); #endif /* PARSER_H */ diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 96da4d56653..41bcaa43f39 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: tcopprot.h,v 1.18 1999/04/20 02:19:55 tgl Exp $ + * $Id: tcopprot.h,v 1.19 1999/05/13 07:29:22 tgl Exp $ * * OLD COMMENTS * This file was created so that other c files could get the two @@ -41,8 +41,8 @@ extern bool InError; #ifndef BOOTSTRAP_INCLUDE extern List *pg_parse_and_plan(char *query_string, Oid *typev, int nargs, - QueryTreeList **queryListP, CommandDest dest, - bool aclOverride); + List **queryListP, CommandDest dest, + bool aclOverride); extern void pg_exec_query(char *query_string); extern void pg_exec_query_acl_override(char *query_string); extern void |
