Skip to content

Commit 8e7764d

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent dad5bb0 commit 8e7764d

File tree

6 files changed

+33
-13
lines changed

6 files changed

+33
-13
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,5 +857,9 @@ Tue Mar 7 10:58:21 CET 2000
857857

858858
- More cleanup in ecpglib.
859859
- Fixed ecpg.c not not free variable list twice.
860+
861+
Thu Mar 9 10:12:57 CET 2000
862+
863+
- Fixed another memory bug in the parser.
860864
- Set library version to 3.1.0.
861865
- Set ecpg version to 2.7.0.

src/interfaces/ecpg/lib/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# Copyright (c) 1994, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.63 2000/03/08 01:58:24 momjian Exp $
9+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.64 2000/03/09 09:17:10 meskes Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

1313
NAME= ecpg
1414
SO_MAJOR_VERSION= 3
15-
SO_MINOR_VERSION= 1
15+
SO_MINOR_VERSION= 1.0
1616

1717
SRCDIR= @top_srcdir@
1818
include $(SRCDIR)/Makefile.global

src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ main(int argc, char *const argv[])
177177
for (ptr = cur; ptr != NULL;)
178178
{
179179
struct cursor *this = ptr;
180-
struct arguments *l1,
181-
*l2;
180+
struct arguments *l1, *l2;
182181

183182
free(ptr->command);
184183
free(ptr->connection);

src/interfaces/ecpg/preproc/extern.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ extern void add_descriptor(char *,char *);
5959
extern void drop_descriptor(char *,char *);
6060
extern struct descriptor *lookup_descriptor(char *,char *);
6161
extern void add_variable(struct arguments ** , struct variable * , struct variable *);
62+
extern void append_variable(struct arguments ** , struct variable * , struct variable *);
6263
extern void dump_variables(struct arguments *, int);
6364
extern struct typedefs *get_typedef(char *);
6465
extern void adjust_array(enum ECPGttype, int *, int *, int, int, bool);

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,13 @@ stmt: AlterTableStmt { output_statement($1, 0, NULL, connection); }
525525
}
526526

527527
/* merge variables given in prepare statement with those given here */
528-
for (p = argsinsert; p && p->next; p = p->next);
529-
if (p)
530-
p->next = ptr->argsinsert;
531-
else
532-
argsinsert = ptr->argsinsert;
528+
for (p = ptr->argsinsert; p; p = p->next)
529+
append_variable(&argsinsert, p->variable, p->indicator);
533530

534-
argsresult = ptr->argsresult;
531+
for (p = ptr->argsresult; p; p = p->next)
532+
add_variable(&argsresult, p->variable, p->indicator);
535533

536-
output_statement(ptr->command, 0, NULL, ptr->connection);
534+
output_statement(mm_strdup(ptr->command), 0, NULL, ptr->connection ? mm_strdup(ptr->connection) : NULL);
537535
}
538536
| ECPGPrepare {
539537
if (connection)

src/interfaces/ecpg/preproc/variable.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,35 @@ reset_variables(void)
189189
argsresult = NULL;
190190
}
191191

192-
/* Add a variable to a request. */
192+
/* Insert a new variable into our request list. */
193193
void
194194
add_variable(struct arguments ** list, struct variable * var, struct variable * ind)
195195
{
196-
struct arguments * p = (struct arguments *)mm_alloc(sizeof(struct arguments));
196+
struct arguments *p = (struct arguments *)mm_alloc(sizeof(struct arguments));
197+
197198
p->variable = var;
198199
p->indicator = ind;
199200
p->next = *list;
200201
*list = p;
201202
}
202203

204+
/* Append a new variable to our request list. */
205+
void
206+
append_variable(struct arguments ** list, struct variable * var, struct variable * ind)
207+
{
208+
struct arguments *p, *new = (struct arguments *)mm_alloc(sizeof(struct arguments));
209+
210+
for (p = *list; p && p->next; p = p->next);
211+
212+
new->variable = var;
213+
new->indicator = ind;
214+
new->next = NULL;
215+
216+
if (p)
217+
p->next = new;
218+
else
219+
*list = new;
220+
}
203221

204222
/* Dump out a list of all the variable on this list.
205223
This is a recursive function that works from the end of the list and

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy