*** empty log message ***

This commit is contained in:
Michael Meskes 1999-12-16 06:53:12 +00:00
parent d033e17530
commit 50a5b4ab41
7 changed files with 956 additions and 1015 deletions

View File

@ -737,3 +737,15 @@ Wed Dec 8 08:26:13 CET 1999
- Clean up error handling.
- Set ecpg version to 2.6.11.
Tue Dec 14 07:28:10 CET 1999
- Synced preproc.y with gram.y.
- Simplified string handling.
Wed Dec 15 08:10:52 CET 1999
- Fixed typo in parser.
- Included Bruce's patch to fix two more memory leaks in libecpg.
- Some cleanup in libecpg.
- Set library version to 3.0.9.
- Set ecpg version to 2.6.12.

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.53 1999/12/07 10:29:16 meskes Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.54 1999/12/16 06:53:10 meskes Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 0.8
SO_MINOR_VERSION= 0.9
SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global

View File

@ -230,13 +230,14 @@ static
char *
quote_postgres(char *arg, int lineno)
{
char *res = (char *) ecpg_alloc(2 * strlen(arg) + 1, lineno);
char *res = (char *) ecpg_alloc(2 * strlen(arg) + 3, lineno);
int i,
ri;
ri = 0;
if (!res)
return (res);
res[ri++] = '\'';
for (i = 0, ri = 0; arg[i]; i++, ri++)
{
switch (arg[i])
@ -253,6 +254,7 @@ quote_postgres(char *arg, int lineno)
res[ri] = arg[i];
}
res[ri++] = '\'';
res[ri] = '\0';
return res;
@ -498,7 +500,6 @@ ECPGexecute(struct statement * stmt)
{
/* set slen to string length if type is char * */
int slen = (var->varcharsize == 0) ? strlen((char *) var->value) : var->varcharsize;
char *tmp;
if (!(newcopy = ecpg_alloc(slen + 1, stmt->lineno)))
return false;
@ -506,19 +507,10 @@ ECPGexecute(struct statement * stmt)
strncpy(newcopy, (char *) var->value, slen);
newcopy[slen] = '\0';
if (!(mallocedval = (char *) ecpg_alloc(2 * strlen(newcopy) + 3, stmt->lineno)))
mallocedval = quote_postgres(newcopy, stmt->lineno);
if (!mallocedval)
return false;
strcpy(mallocedval, "'");
tmp = quote_postgres(newcopy, stmt->lineno);
if (!tmp)
return false;
strcat(mallocedval, tmp);
free(tmp);
strcat(mallocedval, "'");
free(newcopy);
tobeinserted = mallocedval;
@ -541,7 +533,6 @@ ECPGexecute(struct statement * stmt)
{
struct ECPGgeneric_varchar *variable =
(struct ECPGgeneric_varchar *) (var->value);
char *tmp;
if (!(newcopy = (char *) ecpg_alloc(variable->len + 1, stmt->lineno)))
return false;
@ -549,19 +540,10 @@ ECPGexecute(struct statement * stmt)
strncpy(newcopy, variable->arr, variable->len);
newcopy[variable->len] = '\0';
if (!(mallocedval = (char *) ecpg_alloc(2 * strlen(newcopy) + 3, stmt->lineno)))
mallocedval = quote_postgres(newcopy, stmt->lineno);
if (!mallocedval)
return false;
strcpy(mallocedval, "'");
tmp = quote_postgres(newcopy, stmt->lineno);
if (!tmp)
return false;
strcat(mallocedval, tmp);
free(tmp);
strcat(mallocedval, "'");
free(newcopy);
tobeinserted = mallocedval;
@ -1127,18 +1109,16 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0)
{
struct prepared_statement *this;
con->committed = true;
/* deallocate all prepared statements */
while(prep_stmts != NULL) {
while(prep_stmts != NULL)
{
bool b = ECPGdeallocate(lineno, prep_stmts->name);
if (!b)
return false;
}
}
return true;
@ -1415,7 +1395,7 @@ ECPGdeallocate(int lineno, char *name)
prev->next = this->next;
else
prep_stmts = this->next;
free(this);
return true;
}

View File

@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2
MINOR_VERSION=6
PATCHLEVEL=11
PATCHLEVEL=12
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,10 @@
all: test1 test2 test3 test4 perftest
LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq -lcrypt
#LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq -lcrypt
LDFLAGS=-g -I../include -I/usr/include/postgresql -L/usr/lib/postgresql -L../lib -lecpg -lpq -lcrypt
#ECPG=/usr/local/pgsql/bin/ecpg
ECPG=../preproc/ecpg -I../include
.SUFFIXES: .pgc .c
@ -11,7 +15,7 @@ test4: test4.c
perftest: perftest.c
.pgc.c:
/usr/local/pgsql/bin/ecpg $?
$(ECPG) $?
clean:
-/bin/rm test1 test2 test3 test4 perftest *.c log

View File

@ -49,8 +49,8 @@ exec sql end declare section;
exec sql insert into meskes(name, married, children) values ('Petra', '19900404', 3);
exec sql insert into meskes(name, born, age, married, children) values ('Michael', 19660117, 33, '19900404', 3);
exec sql insert into meskes(name, born, age) values ('Carsten', 19910103, 8);
exec sql insert into meskes(name, born, age) values ('Marc', 19930907, 5);
exec sql insert into meskes(name, born, age) values ('Chris', 19970923, 1);
exec sql insert into meskes(name, born, age) values ('Marc', 19930907, 6);
exec sql insert into meskes(name, born, age) values ('Chris', 19970923, 2);
strcpy(msg, "commit");
exec sql commit;