From ad8305a43d1890768a613d3fb586b44f17360f29 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Wed, 24 Mar 2021 20:48:20 +0100 Subject: Add DECLARE STATEMENT command to ECPG This command declares a SQL identifier for a SQL statement to be used in other embedded SQL statements. The identifier is linked to a connection. Author: Hayato Kuroda Reviewed-by: Shawn Wang Discussion: https://www.postgresql.org/message-id/flat/TY2PR01MB24438A52DB04E71D0E501452F5630@TY2PR01MB2443.jpnprd01.prod.outlook.com --- src/interfaces/ecpg/preproc/ecpg.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/interfaces/ecpg/preproc/ecpg.c') diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index f362664fdc1..3c6506017d8 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -28,6 +28,7 @@ struct _include_path *include_paths = NULL; struct cursor *cur = NULL; struct typedefs *types = NULL; struct _defines *defines = NULL; +struct declared_list *g_declared_list = NULL; static void help(const char *progname) @@ -347,6 +348,7 @@ main(int argc, char *const argv[]) struct cursor *ptr; struct _defines *defptr; struct typedefs *typeptr; + struct declared_list *list; /* remove old cursor definitions if any are still there */ for (ptr = cur; ptr != NULL;) @@ -373,6 +375,13 @@ main(int argc, char *const argv[]) } cur = NULL; + /* remove old delared statements if any are still there */ + for (list = g_declared_list; list != NULL;) + { + struct declared_list *this = list; + free(this); + } + /* remove non-pertinent old defines as well */ while (defines && !defines->pertinent) { -- cgit v1.2.3