Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
50a5b4ab
Commit
50a5b4ab
authored
Dec 16, 1999
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
d033e175
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
955 additions
and
1014 deletions
+955
-1014
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+12
-0
src/interfaces/ecpg/lib/Makefile.in
src/interfaces/ecpg/lib/Makefile.in
+2
-2
src/interfaces/ecpg/lib/ecpglib.c
src/interfaces/ecpg/lib/ecpglib.c
+11
-31
src/interfaces/ecpg/preproc/Makefile
src/interfaces/ecpg/preproc/Makefile
+1
-1
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+921
-976
src/interfaces/ecpg/test/Makefile
src/interfaces/ecpg/test/Makefile
+6
-2
src/interfaces/ecpg/test/test2.pgc
src/interfaces/ecpg/test/test2.pgc
+2
-2
No files found.
src/interfaces/ecpg/ChangeLog
View file @
50a5b4ab
...
...
@@ -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.
src/interfaces/ecpg/lib/Makefile.in
View file @
50a5b4ab
...
...
@@ -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.5
3 1999/12/07 10:29:16
meskes Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.5
4 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
...
...
src/interfaces/ecpg/lib/ecpglib.c
View file @
50a5b4ab
...
...
@@ -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
)))
return
false
;
strcpy
(
mallocedval
,
"'"
);
tmp
=
quote_postgres
(
newcopy
,
stmt
->
lineno
);
if
(
!
tmp
)
mallocedval
=
quote_postgres
(
newcopy
,
stmt
->
lineno
);
if
(
!
mallocedval
)
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
;
}
...
...
src/interfaces/ecpg/preproc/Makefile
View file @
50a5b4ab
...
...
@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION
=
2
MINOR_VERSION
=
6
PATCHLEVEL
=
1
1
PATCHLEVEL
=
1
2
CFLAGS
+=
-I
../include
-DMAJOR_VERSION
=
$(MAJOR_VERSION)
\
-DMINOR_VERSION
=
$(MINOR_VERSION)
-DPATCHLEVEL
=
$(PATCHLEVEL)
\
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
50a5b4ab
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/interfaces/ecpg/test/Makefile
View file @
50a5b4ab
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
src/interfaces/ecpg/test/test2.pgc
View file @
50a5b4ab
...
...
@@ -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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment