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
e30c2d67
Commit
e30c2d67
authored
Nov 22, 1999
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
316c4c57
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
347 additions
and
759 deletions
+347
-759
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+15
-0
src/interfaces/ecpg/TODO
src/interfaces/ecpg/TODO
+5
-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
+10
-8
src/interfaces/ecpg/preproc/Makefile
src/interfaces/ecpg/preproc/Makefile
+1
-1
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+294
-742
src/interfaces/ecpg/test/test4.pgc
src/interfaces/ecpg/test/test4.pgc
+20
-6
No files found.
src/interfaces/ecpg/ChangeLog
View file @
e30c2d67
...
...
@@ -705,3 +705,18 @@ Mon Nov 1 11:22:06 CET 1999
- Print SQL error message to STDERR instead of STDOUT.
- Added a fourth test source.
- Set library version to 3.0.5.
Wed Nov 10 18:33:14 CET 1999
- Synced preproc.y with gram.y.
Thu Nov 11 07:49:44 CET 1999
- Fixed bug in SET AUTOCOMMIT.
Mon Nov 22 18:26:34 CET 1999
- Synced preproc.y with gram.y.
- Clean up parser.
- Set library version to 3.0.6.
- Set ecpg version to 2.6.10.
src/interfaces/ecpg/TODO
View file @
e30c2d67
...
...
@@ -7,6 +7,9 @@ has to be 100.
sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET
DESCRIPTOR statement will be ignored.
If a NOTICE message is given by the backend it should not be printed to
stderr. Instead it should be listed as a warning.
it would be nice to be able to use :var[:index] as cvariable
support for dynamic SQL with unknown number of variables with DESCRIPTORS
...
...
@@ -18,6 +21,8 @@ indicator-error?
Add a semantic check level, e.g. check if a table really exists.
How can on insert arrays from c variables?
Missing statements:
- exec sql ifdef
- exec sql allocate
...
...
src/interfaces/ecpg/lib/Makefile.in
View file @
e30c2d67
...
...
@@ -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
0 1999/11/02 12:11:53
meskes Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.5
1 1999/11/22 12:48:46
meskes Exp $
#
#-------------------------------------------------------------------------
NAME
=
ecpg
SO_MAJOR_VERSION
=
3
SO_MINOR_VERSION
=
0.
5
SO_MINOR_VERSION
=
0.
6
SRCDIR
=
@top_srcdir@
include
$(SRCDIR)/Makefile.global
...
...
src/interfaces/ecpg/lib/ecpglib.c
View file @
e30c2d67
...
...
@@ -84,14 +84,14 @@ struct statement
struct
variable
*
outlist
;
};
struct
prepared_statement
st
atic
st
ruct
prepared_statement
{
char
*
name
;
struct
statement
*
stmt
;
struct
prepared_statement
*
next
;
}
*
prep_stmts
=
NULL
;
struct
auto_mem
st
atic
st
ruct
auto_mem
{
void
*
pointer
;
struct
auto_mem
*
next
;
...
...
@@ -656,7 +656,7 @@ ECPGexecute(struct statement * stmt)
}
else
{
sqlca
.
sqlerrd
[
2
]
=
0
;
/* sqlca.sqlerrd[2] = 0;*/
var
=
stmt
->
outlist
;
switch
(
PQresultStatus
(
results
))
{
...
...
@@ -741,7 +741,7 @@ ECPGexecute(struct statement * stmt)
for
(
act_tuple
=
0
;
act_tuple
<
ntuples
&&
status
;
act_tuple
++
)
{
pval
=
PQgetvalue
(
results
,
act_tuple
,
act_field
);
pval
=
(
char
*
)
PQgetvalue
(
results
,
act_tuple
,
act_field
);
ECPGlog
(
"ECPGexecute line %d: RESULT: %s
\n
"
,
stmt
->
lineno
,
pval
?
pval
:
""
);
...
...
@@ -1112,6 +1112,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
}
PQclear
(
res
);
}
if
(
strcmp
(
transaction
,
"commit"
)
==
0
||
strcmp
(
transaction
,
"rollback"
)
==
0
)
{
struct
prepared_statement
*
this
;
...
...
@@ -1140,7 +1141,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
if
(
!
ecpg_init
(
con
,
connection_name
,
lineno
))
return
(
false
);
if
(
con
->
autocommit
==
true
&&
strncmp
(
mode
,
"OFF"
,
strlen
(
"OFF"
))
==
0
)
ECPGlog
(
"ECPGsetcommit line %d action = %s connection = %s
\n
"
,
lineno
,
mode
,
con
->
name
);
if
(
con
->
autocommit
==
true
&&
strncmp
(
mode
,
"off"
,
strlen
(
"off"
))
==
0
)
{
if
(
con
->
committed
)
{
...
...
@@ -1154,7 +1157,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
}
con
->
autocommit
=
false
;
}
else
if
(
con
->
autocommit
==
false
&&
strncmp
(
mode
,
"
ON"
,
strlen
(
"ON
"
))
==
0
)
else
if
(
con
->
autocommit
==
false
&&
strncmp
(
mode
,
"
on"
,
strlen
(
"on
"
))
==
0
)
{
if
(
!
con
->
committed
)
{
...
...
@@ -1213,8 +1216,6 @@ ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd
ECPGlog
(
"ECPGconnect: opening database %s %s%s
\n
"
,
dbname
?
dbname
:
"<DEFAULT>"
,
user
?
"for user "
:
""
,
user
?
user
:
""
);
sqlca
.
sqlcode
=
0
;
this
->
connection
=
PQsetdbLogin
(
NULL
,
NULL
,
NULL
,
NULL
,
dbname
,
user
,
passwd
);
if
(
PQstatus
(
this
->
connection
)
==
CONNECTION_BAD
)
...
...
@@ -1238,6 +1239,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
if
(
strcmp
(
connection_name
,
"ALL"
)
==
0
)
{
memcpy
((
char
*
)
&
sqlca
,
(
char
*
)
&
sqlca_init
,
sizeof
(
sqlca
));
for
(
con
=
all_connections
;
con
;)
{
struct
connection
*
f
=
con
;
...
...
src/interfaces/ecpg/preproc/Makefile
View file @
e30c2d67
...
...
@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION
=
2
MINOR_VERSION
=
6
PATCHLEVEL
=
9
PATCHLEVEL
=
10
CFLAGS
+=
-I
../include
-DMAJOR_VERSION
=
$(MAJOR_VERSION)
\
-DMINOR_VERSION
=
$(MINOR_VERSION)
-DPATCHLEVEL
=
$(PATCHLEVEL)
\
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
e30c2d67
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/test/test4.pgc
View file @
e30c2d67
...
...
@@ -6,7 +6,8 @@ int
main ()
{
EXEC SQL BEGIN DECLARE SECTION;
int a = 1;
int i = 1;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
double f;
EXEC SQL END DECLARE SECTION;
FILE *dbgs;
...
...
@@ -16,23 +17,31 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO mm;
EXEC SQL
CREATE TABLE test (f decimal(8,2), a int)
;
EXEC SQL
SET AUTOCOMMIT = ON
;
EXEC SQL INSERT INTO test(f,a) VALUES(17000.00,1);
EXEC SQL BEGIN WORK;
EXEC SQL CREATE TABLE test (f decimal(8,2), i int, a int[10]);
EXEC SQL INSERT INTO test(f,i,a) VALUES(17000.00,1,'{0,1,2,3,4,5,6,7,8,9}');
/* EXEC SQL INSERT INTO test(f,i,a) VALUES(140787.0,2,:a);*/
EXEC SQL COMMIT;
EXEC SQL BEGIN WORK;
EXEC SQL SELECT f::float
INTO :f
FROM test
WHERE
a = :a
;
WHERE
i = :i
;
printf("Found f::float=%f\n", f);
EXEC SQL SELECT f
INTO :f
FROM test
WHERE
a = :a
;
WHERE
i = :i
;
printf("Found f=%f\n", f);
...
...
@@ -41,4 +50,9 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL COMMIT;
EXEC SQL DISCONNECT;
}
if (dbgs != NULL)
fclose(dbgs);
return (0);
}
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