Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e7764d

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parentdad5bb0 commit8e7764d

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
structcursor*this=ptr;
180-
structarguments*l1,
181-
*l2;
180+
structarguments*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
externvoiddrop_descriptor(char*,char*);
6060
externstructdescriptor*lookup_descriptor(char*,char*);
6161
externvoidadd_variable(structarguments** ,structvariable* ,structvariable*);
62+
externvoidappend_variable(structarguments** ,structvariable* ,structvariable*);
6263
externvoiddump_variables(structarguments*,int);
6364
externstructtypedefs*get_typedef(char*);
6465
externvoidadjust_array(enumECPGttype,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 variableto a request. */
192+
/*Insert anewvariableinto our request list. */
193193
void
194194
add_variable(structarguments**list,structvariable*var,structvariable*ind)
195195
{
196-
structarguments*p= (structarguments*)mm_alloc(sizeof(structarguments));
196+
structarguments*p= (structarguments*)mm_alloc(sizeof(structarguments));
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(structarguments**list,structvariable*var,structvariable*ind)
207+
{
208+
structarguments*p,*new= (structarguments*)mm_alloc(sizeof(structarguments));
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)

[8]ページ先頭

©2009-2025 Movatter.jp