*** empty log message ***

This commit is contained in:
Michael Meskes 2000-03-09 09:17:16 +00:00
parent dad5bb01ba
commit 8e7764d9c2
6 changed files with 33 additions and 13 deletions

View File

@ -857,5 +857,9 @@ Tue Mar 7 10:58:21 CET 2000
- More cleanup in ecpglib.
- Fixed ecpg.c not not free variable list twice.
Thu Mar 9 10:12:57 CET 2000
- Fixed another memory bug in the parser.
- Set library version to 3.1.0.
- Set ecpg version to 2.7.0.

View File

@ -6,13 +6,13 @@
# Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.63 2000/03/08 01:58:24 momjian Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.64 2000/03/09 09:17:10 meskes Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 1
SO_MINOR_VERSION= 1.0
SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global

View File

@ -177,8 +177,7 @@ main(int argc, char *const argv[])
for (ptr = cur; ptr != NULL;)
{
struct cursor *this = ptr;
struct arguments *l1,
*l2;
struct arguments *l1, *l2;
free(ptr->command);
free(ptr->connection);

View File

@ -59,6 +59,7 @@ extern void add_descriptor(char *,char *);
extern void drop_descriptor(char *,char *);
extern struct descriptor *lookup_descriptor(char *,char *);
extern void add_variable(struct arguments ** , struct variable * , struct variable *);
extern void append_variable(struct arguments ** , struct variable * , struct variable *);
extern void dump_variables(struct arguments *, int);
extern struct typedefs *get_typedef(char *);
extern void adjust_array(enum ECPGttype, int *, int *, int, int, bool);

View File

@ -525,15 +525,13 @@ stmt: AlterTableStmt { output_statement($1, 0, NULL, connection); }
}
/* merge variables given in prepare statement with those given here */
for (p = argsinsert; p && p->next; p = p->next);
if (p)
p->next = ptr->argsinsert;
else
argsinsert = ptr->argsinsert;
for (p = ptr->argsinsert; p; p = p->next)
append_variable(&argsinsert, p->variable, p->indicator);
argsresult = ptr->argsresult;
for (p = ptr->argsresult; p; p = p->next)
add_variable(&argsresult, p->variable, p->indicator);
output_statement(ptr->command, 0, NULL, ptr->connection);
output_statement(mm_strdup(ptr->command), 0, NULL, ptr->connection ? mm_strdup(ptr->connection) : NULL);
}
| ECPGPrepare {
if (connection)

View File

@ -189,17 +189,35 @@ reset_variables(void)
argsresult = NULL;
}
/* Add a variable to a request. */
/* Insert a new variable into our request list. */
void
add_variable(struct arguments ** list, struct variable * var, struct variable * ind)
{
struct arguments * p = (struct arguments *)mm_alloc(sizeof(struct arguments));
struct arguments *p = (struct arguments *)mm_alloc(sizeof(struct arguments));
p->variable = var;
p->indicator = ind;
p->next = *list;
*list = p;
}
/* Append a new variable to our request list. */
void
append_variable(struct arguments ** list, struct variable * var, struct variable * ind)
{
struct arguments *p, *new = (struct arguments *)mm_alloc(sizeof(struct arguments));
for (p = *list; p && p->next; p = p->next);
new->variable = var;
new->indicator = ind;
new->next = NULL;
if (p)
p->next = new;
else
*list = new;
}
/* Dump out a list of all the variable on this list.
This is a recursive function that works from the end of the list and